Re: Problem accessing Sandisk CompactFlash Cards (Connected to theIDE bus)

From: Neil Horman
Date: Mon Aug 30 2004 - 09:25:02 EST


Marc Strämke wrote:
Marcelo Tosatti wrote:

Indeed this is a typo but has been fixed on 2.4.26:

if (drive->removable && id != NULL) {

It never gets past this check because drive->removable is not set!
Theres actually a more interesting difference to notice:

In the working dmesg output I see this:
> hda: SanDisk SDCFB-128, CFA DISK drive

While in the non working dmesg output we have:
> hdb: SanDisk SDCFB-128, ATA DISK drive

Tracing back through the code it looks to me like we get the ATA disk print in the event that this test in do_identify:
/*
* Check for an ATAPI device
*/
if (cmd == WIN_PIDENTIFY) {

that would explain why the drive_is_flashcard test is getting skipped, why setting removable is making no difference, and why your card is being identified as an ATA device. It looks as though the WIN_PIDENTIFY command is sent down to this routine from ide_probe_for_drive in this snip of code:

/* if !(success||timed-out) */
if (do_probe(drive, WIN_IDENTIFY) >= 2) {
/* look for ATAPI device */
(void) do_probe(drive, WIN_PIDENTIFY);
}

So it would seem that WIN_PIDENTIFY is issued only if a WIN_IDENTIFY command fails with an rc greater than 2. I would suggest instrumenting this area of the code to see what the WIN_IDENTIFY command is returning on the working and non-working systems. I'm betting you will find a difference, and we'll be able to track down the problem from there.

HTH
Neil
--
/***************************************************
*Neil Horman
*Software Engineer
*Red Hat, Inc.
*nhorman@xxxxxxxxxx
*gpg keyid: 1024D / 0x92A74FA1
*http://pgp.mit.edu
***************************************************/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/