Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 149584 - 2 SD card only 1 GB detected by kernel
Summary: 2 SD card only 1 GB detected by kernel
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL: http://bugzilla.kernel.org/show_bug.c...
Whiteboard: watch-linux-bugzilla
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-29 23:38 UTC by Wernfried Haas (RETIRED)
Modified: 2011-06-28 09:43 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
debug output from usb-storage (kernel,68.90 KB, text/plain)
2006-09-29 23:40 UTC, Wernfried Haas (RETIRED)
Details
Kernel configuration (config,31.64 KB, text/plain)
2006-09-29 23:40 UTC, Wernfried Haas (RETIRED)
Details
Log from plugging in the reader with 2.6.19-rc1 (2.6.19-rc1.log,2.89 KB, text/plain)
2006-10-15 04:13 UTC, Wernfried Haas (RETIRED)
Details
Oops, that one is better (debug,69.82 KB, text/plain)
2006-10-15 08:29 UTC, Wernfried Haas (RETIRED)
Details
Kernel messages with 2.6.19-rc3 (debug-2.6.19-rc3.txt,74.71 KB, text/plain)
2006-10-26 08:28 UTC, Wernfried Haas (RETIRED)
Details
Output from usbmon with kernel 2.6.19-rc3 (usbmon.txt,21.36 KB, text/plain)
2006-10-26 08:31 UTC, Wernfried Haas (RETIRED)
Details
partially annotated usbmon log (sd.usbmon,23.98 KB, text/plain)
2006-12-09 13:47 UTC, Daniel Drake (RETIRED)
Details
usb logfile (usbsnoop.log.bz2,69.63 KB, application/octet-stream)
2006-12-14 07:04 UTC, Wernfried Haas (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wernfried Haas (RETIRED) gentoo-dev 2006-09-29 23:38:21 UTC
I just got myself a 2 GB SD card (label says Kingston Elite Pro 50x), which causes some problems. At first i also had hardware problems, seems both my card readers were too old for a 2 GB card, as they failed also on windows and different computers. Now i bought a new card reader, which works out of the box on a fresh windows install (copied over 1.5 gigs from/to the card to make sure to pass the 1 gig limit), so i think it's not a hardware issue with this one.

Kernel: Tried with gentoo-sources linux-2.6.17-gentoo-r8 first, then linux-2.6.18-rc7-git4, seems both behave the same way. Output below is from linux-2.6.18-rc7-git4.

The card has been formatted in the camera (canon ixus 800, shows a capacity of 1.8 gigs). Placing the card in the reader and connecting it results in the following (i'll attach the whole debug output, but that parts seem important to me):
Oct  8 20:15:12 [kernel] SCSI device sdd: 1955328 512-byte hdwr sectors (1001 MB)
Oct  8 20:15:12 [kernel]  sdd: p1 exceeds device capacity
Oct  8 20:15:12 [kernel] Buffer I/O error on device sdd1, logical block 3910272
(some more errors like that one)

# fdisk -l /dev/sdd

Disk /dev/sdd: 1001 MB, 1001127936 bytes
58 heads, 57 sectors/track, 591 cylinders
Units = cylinders of 3306 * 512 = 1692672 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1        1183     1955263+   6  FAT16
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(0, 2, 4) logical=(0, 2, 16)
Partition 1 has different physical/logical endings:
     phys=(969, 57, 57) logical=(1182, 51, 57)

# lsusb 
Bus 001 Device 005: ID 0aec:3260 Neodio Technologies Corp. 7-in-1 Card Reader

If i mount the card it shows up as 2 GB, but once i try to access files located above the first GB i get i/o errors.

Anything else i should try/add?
Comment 1 Wernfried Haas (RETIRED) gentoo-dev 2006-09-29 23:40:06 UTC
Created attachment 98427 [details]
debug output from usb-storage
Comment 2 Wernfried Haas (RETIRED) gentoo-dev 2006-09-29 23:40:46 UTC
Created attachment 98428 [details]
Kernel configuration
Comment 3 Wernfried Haas (RETIRED) gentoo-dev 2006-10-15 04:13:11 UTC
Created attachment 99718 [details]
Log from plugging in the reader with 2.6.19-rc1

Gave it a shot with 2.6.19-rc1, put the card in the reader and then plugged it in. Kernel config is same as before (apart from running make oldconfig for .19 and leaving everything new to default values).
Comment 4 Daniel Drake (RETIRED) gentoo-dev 2006-10-15 07:49:36 UTC
You need to enable USB storage debugging otherwise the logs aren't interesting
Comment 5 Wernfried Haas (RETIRED) gentoo-dev 2006-10-15 08:29:47 UTC
Created attachment 99733 [details]
Oops, that one is better

Even worse, when using metalog you need to take the right file (kernel, not everything). ;-)
Comment 6 Daniel Drake (RETIRED) gentoo-dev 2006-10-25 19:53:18 UTC
Nothing obvious, next step is to look at the data flying around. Please look at /usr/src/linux/Documentation/usb/usbmon.txt and capture usbmon logs *and* new debug logs from the same session in the same way as before. It's important that you provide the two logs from the same usage attempt.
Comment 7 Wernfried Haas (RETIRED) gentoo-dev 2006-10-26 08:28:47 UTC
Created attachment 100531 [details]
Kernel messages with 2.6.19-rc3
Comment 8 Wernfried Haas (RETIRED) gentoo-dev 2006-10-26 08:31:37 UTC
Created attachment 100532 [details]
Output from usbmon with kernel 2.6.19-rc3

Here are the logs for both things from the same plugin event of the card reader - hope i got everything right with usbmon, it's output doesn't make much sense to  me. ;-)
Comment 9 Daniel Drake (RETIRED) gentoo-dev 2006-12-09 13:47:01 UTC
Created attachment 103717 [details]
partially annotated usbmon log
Comment 10 Daniel Drake (RETIRED) gentoo-dev 2006-12-09 13:54:51 UTC
Sorry for the delay in looking at this. I've gone over the transfer and the device is reporting 1GB capacity.

I have a couple of ideas where the device may be reporting things incorrectly, but the next step would be to see what windows does. 

Please download and run this:
http://benoit.papillault.free.fr/stats/get.php?location=../usbsnoop/sniff-bin-1.8.zip

Install the filter on the card reader device then plug it in with card already inserted. Wait long enough for windows to detect the media but not too long for the longs to get overly huge. THen uninstall the filter, and unplug it. Compress the log and attach it here.
Comment 11 Wernfried Haas (RETIRED) gentoo-dev 2006-12-14 07:04:05 UTC
Created attachment 104044 [details]
usb logfile

(In reply to comment #10)
> Install the filter on the card reader device then plug it in with card already
> inserted. Wait long enough for windows to detect the media but not too long for
> the longs to get overly huge. THen uninstall the filter, and unplug it.
> Compress the log and attach it here.

I hope it worked, the log really seems to log quite fast. I hope the one i made is OK from both size vs. information.
Comment 12 Daniel Drake (RETIRED) gentoo-dev 2006-12-16 19:30:26 UTC
Hmm...

I have run over that log and I don't see any reason for windows to believe that's *not* a 1GB card.

Windows is doing some extra commands. It does READ FORMAT CAPACITIES which is primarily for optical devices, but this agrees with the READ CAPACITY (0x1dd600 512 byte blocks). It also does some mode sensing without any interesting results.

I guess the next step is to file a bug at http://bugzilla.kernel.org
Attach the usbmon log and link to the usbsnoop one. I'll comment on my findings once you have opened the bug there.
Comment 13 Daniel Drake (RETIRED) gentoo-dev 2007-04-07 15:12:36 UTC
Please test 2.6.21-rc6, file upstream, and post new URL here.