oddity mounting MMC/SD cards

Alexander Motin mav at FreeBSD.org
Sun Aug 14 11:13:51 UTC 2011


Hi.

On 13.08.2011 23:56, Michael Butler wrote:
> I tried to mount a card from my phone (it's quicker to copy directly
> than through USB) but I get this .. what am I missing here?
>
> Aug 13 16:53:37 toshi kernel: sdhci0-slot0: Card inserted
> Aug 13 16:53:37 toshi kernel: mmc0:<MMC/SD bus>  on sdhci0
> Aug 13 16:53:37 toshi kernel: mmc0: Probing bus
> Aug 13 16:53:37 toshi kernel: mmc0: SD probe: OK (OCR: 0x00ff8000)
> Aug 13 16:53:37 toshi kernel: mmc0: Current OCR: 0x00ff8000
> Aug 13 16:53:38 toshi kernel: mmc0: Probing cards
> Aug 13 16:53:38 toshi kernel: mmc0: New card detected (CID
> 03534453553136478080d4290400a300)
> Aug 13 16:53:38 toshi kernel: mmc0: Card at relative address 36832 added:
> Aug 13 16:53:38 toshi kernel: mmc0:  card: SD High Capacity
> (0x3/0x5344/"SU16G" rev 8.0 m/d 03.2010 s/n 80d42904)
> Aug 13 16:53:38 toshi kernel: mmc0:  bus: 4bit, 50MHz, high speed timing
> Aug 13 16:53:38 toshi kernel: mmc0:  memory: 31116288 blocks, erase
> sector 8192 blocks, read-only
> Aug 13 16:53:38 toshi kernel: mmc0: setting transfer rate to 30.000MHz
> Aug 13 16:53:38 toshi kernel: mmcsd0: 2905MB<SDHC Memory Card>
> (read-only) at mmc0 24MHz/4bit
> Aug 13 16:53:38 toshi kernel: GEOM: new disk mmcsd0
> Aug 13 16:53:38 toshi kernel: mmc0: setting bus width to 4 bits
>
> vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> Aug 13 16:53:38 toshi kernel: GEOM_PART: partition 1 has end offset
> beyond last LBA: 31116287>  5950463
> Aug 13 16:53:38 toshi kernel: GEOM_PART: integrity check failed (mmcsd0,
> MBR)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

It looks like consequence of r222475. Could you try this patch:

--- dev/mmc/mmcsd.c.prev        2011-08-14 14:09:35.000000000 +0300
+++ dev/mmc/mmcsd.c     2011-08-14 14:09:14.000000000 +0300
@@ -137,7 +137,7 @@ mmcsd_attach(device_t dev)
         d->d_drv1 = sc;
         d->d_maxsize = 4*1024*1024;     /* Maximum defined SD card AU 
size. */
         d->d_sectorsize = mmc_get_sector_size(dev);
-       d->d_mediasize = mmc_get_media_size(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);

-- 
Alexander Motin


More information about the freebsd-current mailing list