From owner-freebsd-current@FreeBSD.ORG Sun Aug 14 13:42:43 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FF361065696 for ; Sun, 14 Aug 2011 13:42:43 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9E8998FC2A for ; Sun, 14 Aug 2011 13:42:41 +0000 (UTC) Received: by fxe4 with SMTP id 4so4081448fxe.13 for ; Sun, 14 Aug 2011 06:42:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=hd6jgHcacvwKNirwR1OWcGU/72Q4z15w6cnKJA6GznQ=; b=Vu57KqsLtDnVN4F+ICmoER2CEpmaqb8p+GQJCVhQQHn0tfMAw3sQKSugqvDMzGild0 834FNRA4HsstbAQiwjPmEVLsU6+SpjbYipHJJ6gbn94GeCxg5G4F1xYHrbtrAl7qXEjl ioRQhcaffHF3jFOvDmGXSCy6OJVBfrMcuYP9g= Received: by 10.223.145.16 with SMTP id b16mr2547719fav.128.1313329360605; Sun, 14 Aug 2011 06:42:40 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id s14sm2349409fah.5.2011.08.14.06.42.38 (version=SSLv3 cipher=OTHER); Sun, 14 Aug 2011 06:42:39 -0700 (PDT) Sender: Alexander Motin Message-ID: <4E47D0BB.9060709@FreeBSD.org> Date: Sun, 14 Aug 2011 16:42:19 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110709 Thunderbird/5.0 MIME-Version: 1.0 To: Michael Butler References: <4E47ADD9.5000609@FreeBSD.org> <4E47CED2.8020404@protected-networks.net> In-Reply-To: <4E47CED2.8020404@protected-networks.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: current Subject: Re: oddity mounting MMC/SD cards X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Aug 2011 13:42:43 -0000 On 14.08.2011 16:34, Michael Butler wrote: > On 08/14/11 07:13, Alexander Motin wrote: > >> On 13.08.2011 23:56, Michael Butler wrote: >>> 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); > > That worked :-) > > However, I found another (smaller) card where it didn't help :-( > > sdhci0-slot0: Card inserted > mmc0: on sdhci0 > mmc0: Probing bus > mmc0: SD probe: OK (OCR: 0x00ff8000) > mmc0: Current OCR: 0x00ff8000 > mmc0: Probing cards > mmc0: New card detected (CID 02544d5341303447049c02a7f6009b00) > mmc0: Card at relative address 4660 added: > mmc0: card: SD High Capacity (0x2/0x544d/"SA04G" rev 0.4 m/d 11.2009 > s/n 9c02a7f6) > mmc0: bus: 4bit, 50MHz, high speed timing > mmc0: memory: 7733248 blocks, erase sector 8192 blocks, read-only > mmc0: setting transfer rate to 30.000MHz > mmcsd0: 3776MB (read-only) at mmc0 24MHz/4bit > GEOM: new disk mmcsd0 > mmc0: setting bus width to 4 bits > GEOM_PART: partition 1 has end offset beyond last LBA: 7741438> 7733247 > GEOM_PART: integrity check failed (mmcsd0, MBR) > > The complaint appears to be valid, given fdisk's output .. is this > something to do with the 'relative address'? > > imb@toshi:/usr/src> fdisk /dev/mmcsd0 > ******* Working on device /dev/mmcsd0 ******* > parameters extracted from in-core disklabel are: > cylinders=481 heads=255 sectors/track=63 (16065 blks/cyl) > > parameters to be used for BIOS calculations are: > cylinders=481 heads=255 sectors/track=63 (16065 blks/cyl) > > Media sector size is 512 > Warning: BIOS sector numbering starts with sector 1 > Information from DOS bootblock is: > The data for partition 1 is: > sysid 11 (0x0b),(DOS or Windows 95 with 32 bit FAT) > start 8192, size 7733247 (3775 Meg), flag 0 > beg: cyl 1/ head 2/ sector 3; > end: cyl 960/ head 48/ sector 48 This time it looks different. Card size looks consistent, but partition is bigger then card size. Could you check card and partition sizes in some other (USB) card reader? -- Alexander Motin