summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2015-05-29 20:50:41 +0000
committermarcel <marcel@FreeBSD.org>2015-05-29 20:50:41 +0000
commit9a1d54a1000576601d35cb26c877936608660cf6 (patch)
treeb3c5f682f5300f7f3b262faa365d25bf855f49c1 /sys/dev
parentd7f3fa6b201b38738f0f5cfd150354399b691ea2 (diff)
downloadFreeBSD-src-9a1d54a1000576601d35cb26c877936608660cf6.zip
FreeBSD-src-9a1d54a1000576601d35cb26c877936608660cf6.tar.gz
Do not set d_fwsectors nor d_fwheads. Primarily because the values
tend to be invalid. On a Beaglebone Black, we get 8192 sectors per track and that causes major breakages. Differential Revision: D2646 Reviewed by: ian@ imp@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/mmc/mmcsd.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/sys/dev/mmc/mmcsd.c b/sys/dev/mmc/mmcsd.c
index 3be2158..4ca0c24 100644
--- a/sys/dev/mmc/mmcsd.c
+++ b/sys/dev/mmc/mmcsd.c
@@ -163,33 +163,10 @@ mmcsd_attach(device_t dev)
d->d_sectorsize = mmc_get_sector_size(dev);
d->d_maxsize = mmc_get_max_data(dev) * d->d_sectorsize;
d->d_mediasize = (off_t)mmc_get_media_size(dev) * d->d_sectorsize;
- d->d_stripeoffset = 0;
d->d_stripesize = mmc_get_erase_sector(dev) * d->d_sectorsize;
d->d_unit = device_get_unit(dev);
d->d_flags = DISKFLAG_CANDELETE;
- d->d_delmaxsize = mmc_get_erase_sector(dev) * d->d_sectorsize * 1; /* conservative */
- /*
- * The d_fw* values are fake. However, layout is aided by making the
- * number of fwsectors equal to the erase sectors from the drive since
- * we set the stripe size equal to that. We set fwheads such that there
- * are ~20 cylinder groups since all values are somewhat arbitrary here
- * and this gives good behavior with ffs without wasting too much
- * space. Sadly, geom_part wants to round partitions to these
- * values. While not bad, in and of itself, the values we present here
- * will almost certainly be different then the values that USB SD
- * adapters use and there's too much variation between brands to just
- * use those values here. Also SD to ATA adapters favor traditional
- * ata sizes, which are different again from the USB adapters (which
- * favor SCSI values). This rounding leads to a loss of up to 5% of the
- * usable space (usually much less, but that's why 20 was selected: to
- * limit this effect at a few percent). gpart needs a way to override
- * this behavior for situations like this, but doesn't provide
- * one. Perhaps this behavior should be tunable as well, but maybe that
- * belongs in the disk layer. These values will be much better than
- * the default ones.
- */
- d->d_fwsectors = mmc_get_erase_sector(dev);
- d->d_fwheads = mmc_get_media_size(dev) / (d->d_fwsectors * 20);
+ d->d_delmaxsize = mmc_get_erase_sector(dev) * d->d_sectorsize;
strlcpy(d->d_ident, mmc_get_card_sn_string(dev), sizeof(d->d_ident));
strlcpy(d->d_descr, mmc_get_card_id_string(dev), sizeof(d->d_descr));
OpenPOWER on IntegriCloud