public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Alexia Death <alexiadeath@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Problem: non-SDHC 2GB SD cards are unreadable
Date: Mon, 14 Apr 2008 08:48:38 +0200	[thread overview]
Message-ID: <200804140848.39226.arnd@arndb.de> (raw)
In-Reply-To: <200804140749.57049.alexiadeath@gmail.com>

On Monday 14 April 2008, Alexia Death wrote:
> On Monday 14 April 2008 03:45:32 you wrote:
>
> > My guess is that the problem is the way that the card is presented
> > to the USB mass storage driver by the reader. 
> Yes, Ive come to a conclusion that because reader does not do anything about 
> the speciality of the 2GB cards they wont be readable because Linux usb 
> storage does not know about them either.
>
> > Generally, there is no problem with 2GB SD cards,
> It seems that in case of non-USB card readers, ie the ones built-in to laptops 
> the speciality is taken care of by the reader driver...

Did you find any code in there that made you think so? Generally, the mmc
layer doesn't do much about the layout of the cards but merely represents
what is there.

On the contrary, the USB card readers go through a lot of effort to
make the card look like a SCSI device, and many of these implementations
are buggy in some way. SD cards are defined to have 512 byte sectors, while
USB mass storage can theoretically have a different sector size. Of course
any other size than 512 bytes is likely to break some code, which you have
experienced.

Note that Linux has another driver for USB mass storage, the "ub" block
driver which does not go through the SCSI software layer. It would be good
if you could check whether that has the same problem. Also, it might be
interesting to see if another operating system has the same problem
with the combination of your card and reader.

If it works on another OS, it's probably fixable on Linux, but the
effort may be significant.

> > so it would be good if you can try a different card reader with your cards.
> I have no different reader to try but I did try connecting the camera. It 
> works.
> [1249166.105850] scsi 6:0:0:0: Direct-Access     PENTAX   DIGITAL_CAMERA   
> 1.20 PQ: 0 ANSI: 0
> [1249166.117440] sd 6:0:0:0: [sdb] 3985409 512-byte hardware sectors (2041 MB)
> [1249166.122416] sd 6:0:0:0: [sdb] Write Protect is off
> [1249166.122431] sd 6:0:0:0: [sdb] Mode Sense: 0a 0a 00 01
> [1249166.122438] sd 6:0:0:0: [sdb] Assuming drive cache: write through
> [1249166.137400] sd 6:0:0:0: [sdb] 3985409 512-byte hardware sectors (2041 MB)
> [1249166.142390] sd 6:0:0:0: [sdb] Write Protect is off
> [1249166.142406] sd 6:0:0:0: [sdb] Mode Sense: 0a 0a 00 01
> [1249166.142412] sd 6:0:0:0: [sdb] Assuming drive cache: write through
> [1249166.142430]  sdb: sdb1
> [1249166.176608] sd 6:0:0:0: [sdb] Attached SCSI removable disk
> [1249166.176735] sd 6:0:0:0: Attached scsi generic sg2 type 0
> 
> As you can see the camera rewrites the hw sectors description and presents it 
> quite differently than the card presents itself. Strangely enough my 
> cardreader/photobank itself has no problem copying from these cards but still 
> presents the cards to the pc "as is".

The camera is just another implementation of a USB mass storage device on
top of an SD card. My guess remains that this one works correctly, while
your standalone reader has a quirk that prevents it from being used on Linux.

	Arnd <><

  reply	other threads:[~2008-04-14  6:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-13 20:26 Problem: non-SDHC 2GB SD cards are unreadable Alexia Death
2008-04-13 20:42 ` Alan Cox
2008-04-13 21:32   ` Alexia Death
2008-04-14  0:45 ` Arnd Bergmann
2008-04-14  4:49   ` Alexia Death
2008-04-14  6:48     ` Arnd Bergmann [this message]
2008-04-14 11:45       ` H. Peter Anvin
2008-04-14 12:40         ` Arnd Bergmann
2008-04-15 23:23         ` Daniel Barkalow
2008-04-16  2:09           ` H. Peter Anvin
2008-04-16  2:49             ` Roger Heflin
2008-04-14 16:11     ` Lennart Sorensen
2008-04-14  6:08   ` Alexia Death
2008-04-14  9:03     ` Wander Winkelhorst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200804140848.39226.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=alexiadeath@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox