2.2.10: PCMCIA ATA screws up DMA on /dev/hda

Klaus Kudielka (klaus.kudielka@ieee.org)
Tue, 20 Jul 1999 08:57:36 +0900


Hello,

I have a Sony VAIO 505V and a few Compactflash cards.
BM-DMA on /dev/hda works perfectly only if I _don't_ insert any of those
CF cards (at least I had uptimes of a week without any problems).

_If_ I insert a CF card, I may get a DMA timeout on /dev/hda immediately or
several hours later. If I let the system running, eventually I get
quite corrupted ext2 filesystems.

The cause of the problem seems to be in the IDE driver. Basically,
ide_scan_pcibus() detects two IDE controllers at boot, ide0 and ide1.
ide_setup_pci_device() then sets up the data structures for ide0 and ide1.
ide1 doesn't have any drive attached, and thus probe_hwif() doesn't set
the hwif->present flag.

Now, when the PCMCIA subsystem calls ide_register, ide1 gets re-used,
because the hwif->present flag is zero. And this seems to be bad.

I work around this problem by forcing the base I/O address of the
CF card to be 0x160, which causes ide_register() to use ide5 instead.
But the correct solution, IMHO, would be either

* avoid re-use of a PCI IDE interface entry which has no drives
attached (probably by just setting hwif->present to 1?)

or

* when re-using the entry, make sure that all data structures are
set up correctly. I didn't check, but suspect that AT LEAST
ide_hwifs[0]->mate still points to ide_hwifs[1]. Also, free
the I/O region occupied by ide_setup_dma().

Now the question to the IDE specialists: Which one is better?

-Klaus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/