aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/mmc')
-rw-r--r--sys/dev/mmc/mmc_fdt_helpers.c11
-rw-r--r--sys/dev/mmc/mmcsd.c8
2 files changed, 15 insertions, 4 deletions
diff --git a/sys/dev/mmc/mmc_fdt_helpers.c b/sys/dev/mmc/mmc_fdt_helpers.c
index aed85dab55f4..980785464a00 100644
--- a/sys/dev/mmc/mmc_fdt_helpers.c
+++ b/sys/dev/mmc/mmc_fdt_helpers.c
@@ -160,6 +160,17 @@ cd_setup(struct mmc_helper *helper, phandle_t node)
}
/*
+ * If the device has no card-detection, treat it as non-removable.
+ * This could be improved by polling for detection.
+ */
+ if (helper->props & MMC_PROP_BROKEN_CD) {
+ helper->cd_disabled = true;
+ if (bootverbose)
+ device_printf(dev, "Broken card-detect\n");
+ return;
+ }
+
+ /*
* If there is no cd-gpios property, then presumably the hardware
* PRESENT_STATE register and interrupts will reflect card state
* properly, and there's nothing more for us to do. Our get_present()
diff --git a/sys/dev/mmc/mmcsd.c b/sys/dev/mmc/mmcsd.c
index 5b9cb93c7b31..f2965048b285 100644
--- a/sys/dev/mmc/mmcsd.c
+++ b/sys/dev/mmc/mmcsd.c
@@ -1422,7 +1422,7 @@ mmcsd_task(void *arg)
struct mmcsd_softc *sc;
struct bio *bp;
device_t dev, mmcbus;
- int bio_error, err, sz;
+ int abio_error, err, sz;
part = arg;
sc = part->sc;
@@ -1430,7 +1430,7 @@ mmcsd_task(void *arg)
mmcbus = sc->mmcbus;
while (1) {
- bio_error = 0;
+ abio_error = 0;
MMCSD_DISK_LOCK(part);
do {
if (part->running == 0)
@@ -1475,11 +1475,11 @@ mmcsd_task(void *arg)
} else if (bp->bio_cmd == BIO_DELETE)
block = mmcsd_delete(part, bp);
else
- bio_error = EOPNOTSUPP;
+ abio_error = EOPNOTSUPP;
release:
MMCBUS_RELEASE_BUS(mmcbus, dev);
if (block < end) {
- bp->bio_error = (bio_error == 0) ? EIO : bio_error;
+ bp->bio_error = (abio_error == 0) ? EIO : abio_error;
bp->bio_resid = (end - block) * sz;
bp->bio_flags |= BIO_ERROR;
} else