Bug 7711 - pata_pcmcia fails to access CF card
Summary: pata_pcmcia fails to access CF card
Status: CLOSED CODE_FIX
Alias: None
Product: IO/Storage
Classification: Unclassified
Component: Serial ATA (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Alan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-19 01:10 UTC by Wilfried Klaebe
Modified: 2007-06-05 06:15 UTC (History)
4 users (show)

See Also:
Kernel Version: 2.6.19.1
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
libata: add a dummy set_mode() in pata_pcmcia (1.54 KB, patch)
2007-01-28 02:11 UTC, Arnd Bergmann
Details | Diff
same patch, proper s-o-b (1.53 KB, patch)
2007-01-28 02:17 UTC, Arnd Bergmann
Details | Diff
Alternative patch introducing "can fail quietly" command handling (2.31 KB, patch)
2007-01-28 04:34 UTC, Alan
Details | Diff

Description Wilfried Klaebe 2006-12-19 01:10:50 UTC
Most recent kernel where this bug did *NOT* occur: none known
Distribution: debian (kernel self-compiled)
Hardware Environment: HP Compaq nx6110
Software Environment: Debian GNU/Linux
Problem Description: pata_pcmcia fails to access all tried CF cards, while
ide_cs does.

Steps to reproduce:
compile kernel without IDE, but with ATA support and cardbus in the kernel and
pata_pcmcia as module. boot it, insert CF card into PCMCIA adapter, insert into
slot.

dmesg:
[30593.614000] pccard: PCMCIA card inserted into slot 0
[30593.614000] cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xcffff
0xe0000-0xfffff
[30593.642000] cs: memory probe 0x10000000-0x11ffffff: excluding
0x10000000-0x11ffffff
[30593.642000] cs: memory probe 0x60000000-0x60ffffff: clean.
[30593.656000] cs: memory probe 0xa0000000-0xa0ffffff: clean.
[30593.670000] cs: memory probe 0xd0000000-0xd03fffff: excluding
0xd0000000-0xd003ffff
[30593.684000] pcmcia: registering new device pcmcia0.0
[30593.803000] ata3: PATA max PIO0 cmd 0x3100 ctl 0x310E bmdma 0x0 irq 16
[30593.803000] scsi2 : pata_pcmcia
[30593.956000] ata3.00: CFA, max PIO0, 1018080 sectors: LBA 
[30593.956000] ata3.00: ata3: dev 0 multi count 0
[30593.956000] ata3.00: failed to set xfermode (err_mask=0x1)
[30593.956000] ata3.00: disabled

remove card. rmmod pata_pcmcia, build and install modules ide-core, ide-disk and
ide-cs. modprobe ide-cs.

[31862.754000] Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
[31862.755000] ide: Assuming 33MHz system bus speed for PIO modes; override with
idebus=xx
[31870.289000] pccard: PCMCIA card inserted into slot 0
[31870.289000] pcmcia: registering new device pcmcia0.0
[31870.330000] Probing IDE interface ide0...
[31870.594000] hda: SAMSUNG CF/ATA, CFA DISK drive
[31870.900000] ide0 at 0x3100-0x3107,0x310e on irq 16
[31870.900000] ide-cs: hda: Vpp = 0.0
[31870.938000] hda: max request size: 128KiB
[31870.938000] hda: 1018080 sectors (521 MB) w/0KiB Cache, CHS=1010/16/63
[31870.938000]  hda: hda1

Accessing the CF card works this way.
Comment 1 Arnd Bergmann 2007-01-28 02:11:17 UTC
Created attachment 10203 [details]
libata: add a dummy set_mode() in pata_pcmcia

CompactFlash cards in a passive PCMCIA adapter don't seem
to like the ATA_CMD_SET_FEATURES command, which causes
libata device probing to fail.

Since PCMCIA only allows PIO mode 0 anyway, there is no
point in ever setting a higher speed. Adding the dummy
function seems to do the right thing.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Comment 2 Arnd Bergmann 2007-01-28 02:13:33 UTC
Comment on attachment 10203 [details]
libata: add a dummy set_mode() in pata_pcmcia

Signed off with wrong address
Comment 3 Arnd Bergmann 2007-01-28 02:17:07 UTC
Created attachment 10204 [details]
same patch, proper s-o-b

Subject: libata: add a dummy set_mode() in pata_pcmcia

CompactFlash cards in a passive PCMCIA adapter don't seem
to like the ATA_CMD_SET_FEATURES command, which causes
libata device probing to fail.

Since PCMCIA only allows PIO mode 0 anyway, there is no
point in ever setting a higher speed. Adding the dummy
function seems to do the right thing.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Comment 4 Alan 2007-01-28 04:29:44 UTC
NAK

I have a better patch waiting in my tree for further testing. The underlying
problem that some CF devices do not understand set xfer mode, applies for 1.x
version cards even in trueide mode so the work around we need is more tricky.

The patch I'm testing does the following
- Add a taskfile flag to say "dont report errors on this one" (which we need anyway)
- Allow set_xfer_mode to fail silently for PIO modes on CFA devices only

I'll attach a patch for comment.

Comment 5 Alan 2007-01-28 04:34:41 UTC
Created attachment 10205 [details]
Alternative patch introducing "can fail quietly" command handling

We'll also need this for HPA handling.
Comment 6 Arnd Bergmann 2007-01-28 05:24:27 UTC
What about real PCMCIA storage cards that are not CF? Do you know if they might 
also need an exception like this?
Your patch only checks for ata_id_is_cfa(), so if there are PCMCIA cards with 
the same problem, we might need both patches (or another variant thereof).
Comment 7 Alan 2007-01-28 06:27:19 UTC
The ATA standard makes set features/xfer rate mandatory. The CFA 1.x standard
does not include it although CFA3 and CFA4 do. Any device claiming to be ATA
that does not support set features appears to be broken, and I've yet to
encounter one although it wouldn't suprise me. The PCMCIA hard disks I have
accept set-features/xfer-rate.

Alan

Note You need to log in before you can comment on or make changes to this bug.