summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2024-02-16 12:42:47 -0600
committerJoel Sherrill <joel@rtems.org>2024-03-05 08:51:03 -0600
commitf980e47f88e694cc50a99f91bed057a9b5c3d48c (patch)
treea1ca48cfd0fb2a8b25b68debfaa3c0e050e1f4ac
parentrtemsbsd: Remove unused variable (diff)
downloadrtems-libbsd-f980e47f88e694cc50a99f91bed057a9b5c3d48c.tar.bz2
freebsd/mmcsd: Disable on-device cache usage
This disables any usage of the on-device R/W cache since all device cache maintenance functions are compiled out under RTEMS leaving no way to flush the cache before system reset and making data loss possible.
-rw-r--r--freebsd/sys/dev/mmc/mmcsd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/freebsd/sys/dev/mmc/mmcsd.c b/freebsd/sys/dev/mmc/mmcsd.c
index bd45b419..1369f7f1 100644
--- a/freebsd/sys/dev/mmc/mmcsd.c
+++ b/freebsd/sys/dev/mmc/mmcsd.c
@@ -546,6 +546,11 @@ mmcsd_attach(device_t dev)
*/
rev = ext_csd[EXT_CSD_REV];
+/*
+ * Cache flush functions are currently not available. Use of on-device cache can
+ * cause data loss.
+ */
+#ifndef __rtems__
/*
* With revision 1.5 (MMC v4.5, EXT_CSD_REV == 6) and later, take
* advantage of the device R/W cache if present and useage is not
@@ -567,6 +572,7 @@ mmcsd_attach(device_t dev)
sc->flags |= MMCSD_FLUSH_CACHE;
}
}
+#endif
/*
* Ignore user-creatable enhanced user data area and general purpose