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.
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 on attachment 10203 [details] libata: add a dummy set_mode() in pata_pcmcia Signed off with wrong address
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>
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.
Created attachment 10205 [details] Alternative patch introducing "can fail quietly" command handling We'll also need this for HPA handling.
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).
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