<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>On 01/04/2020 10:41, Sebastian Huber wrote:<br>
</p>
<blockquote type="cite"
cite="mid:502855a8-cc34-6923-2b8a-f45e11506ff6@embedded-brains.de">
<blockquote type="cite" style="color: #000000;"> for (i =
0; i < buffer_count; ++i) {
<br>
@@ -394,6 +399,7 @@ rtems_bsd_mmcsd_disk_read_write(struct
mmcsd_part *part, rtems_blkdev_request *b
<br>
error:
<br>
MMCSD_DISK_UNLOCK(part);
<br>
+ MMCBUS_RELEASE_BUS(device_get_parent(dev), dev);
<br>
rtems_blkdev_request_done(blkreq, status_code);
<br>
@@ -436,8 +442,6 @@
rtems_bsd_mmcsd_attach_worker(rtems_media_state state, const
char *src, char **d
<br>
goto error;
<br>
}
<br>
- MMCBUS_ACQUIRE_BUS(device_get_parent(dev), dev);
<br>
</blockquote>
<br>
I think the bus acquire here is necessary to prevent an
rtems_blkdev_create() while the bus is detached in parallel, e.g.
a fast plug/unplug of an USB stick.
<br>
</blockquote>
Sorry, this comment makes little sense, this code is not for USB
sticks. However, if we want to support hot plugging of MMC busses
and devices, then the rtems_blkdev_create() during a concurrent
detach is something we have to consider.<br>
<blockquote type="cite"
cite="mid:502855a8-cc34-6923-2b8a-f45e11506ff6@embedded-brains.de">
<br>
After reviewing the code I think this bus acquire without a
release (which is in the code since the import from libusb in
2015) was a hack to improve the read/write performance. We didn't
support hot plugging of MMC busses and devices. Do we need this
feature now?
</blockquote>
<br>
</body>
</html>