summaryrefslogtreecommitdiffstats
path: root/freebsd
diff options
context:
space:
mode:
authorChristian Mauderer <christian.mauderer@embedded-brains.de>2020-04-01 11:39:28 +0200
committerChristian Mauderer <christian.mauderer@embedded-brains.de>2020-04-01 14:12:11 +0200
commitfa81c95416736d72fe4528a9fc886bf298f748ad (patch)
treea4d945bfd2138eb61d23c3ec5d45b4146404e3e3 /freebsd
parenttestsuite: User input define added (diff)
downloadrtems-libbsd-fa81c95416736d72fe4528a9fc886bf298f748ad.tar.bz2
mmcsd: Don't handle multiple hardware partitions.
The rtems_bsd_mmcsd_attach_worker acquired the bus without releasing it. If a MMC device has multiple hardware partitions (like eMMC which typically has at least one boot partition) the rtems_bsd_mmcsd_attach_worker would try to acquire the bus multiple times. This doesn't work. Doing it right would mean to acquire and release the bus for each access which would have an performance impact. Beneath that it would mean that partition switching has to be supported by the RTEMS code too. There is currently no known use case where the access would be necessary. Therefore this patch prefers the performance and just avoids all further hardware partitions.
Diffstat (limited to 'freebsd')
-rw-r--r--freebsd/sys/dev/mmc/mmcsd.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/freebsd/sys/dev/mmc/mmcsd.c b/freebsd/sys/dev/mmc/mmcsd.c
index 8fc06eb2..3960845c 100644
--- a/freebsd/sys/dev/mmc/mmcsd.c
+++ b/freebsd/sys/dev/mmc/mmcsd.c
@@ -436,6 +436,15 @@ rtems_bsd_mmcsd_attach_worker(rtems_media_state state, const char *src, char **d
goto error;
}
+ /*
+ * FIXME: There is no release for this acquire. Implementing
+ * this would be necessary for:
+ * - multiple hardware partitions of eMMC chips
+ * - multiple devices on one bus
+ *
+ * On the other hand it would mean that the bus has to be
+ * acquired on every read which would decrease the performance.
+ */
MMCBUS_ACQUIRE_BUS(device_get_parent(dev), dev);
status_code = rtems_bsd_mmcsd_set_block_size(dev, block_size);
@@ -764,6 +773,10 @@ mmcsd_add_part(struct mmcsd_softc *sc, u_int type, const char *name, u_int cnt,
free(part, M_DEVBUF);
return;
}
+#ifdef __rtems__
+ } else if (type != EXT_CSD_PART_CONFIG_ACC_DEFAULT) {
+ printf("%s: Additional partition. This is currently not supported in RTEMS.", part->name);
+#endif /* __rtems__ */
} else {
MMCSD_DISK_LOCK_INIT(part);