Re: [PATCH 2.6.13] libata: use common pci remove in ahci

Jeff Garzik
2005-09-07T02:01:47Z

Brett Russ wrote:
> Jeff Garzik wrote:
>> Brett Russ wrote:
>>> 2) Isn't it wrong for the IRQ disable at the chip to occur *after*
>>> free_irq() is called to disconnect the handler (independent of
>>> question 1...since this is the case currently)? Granted, all of the
>>> ports have gone through scsi_remove_host() but theoretically there
>>> still is a possibility the chip could interrupt.

Answer: depends on hardware.

For all hardware, the conditions that generate interrupts should be shut
down, and then free_irq() is called after that.

Some hardware only needs per-port disable, or nothing besides clearing
any commands, to ensure that interrupts from that hardware are disabled
(this excludes shared interrupts, of course).

This logic is another reason why a driver author may choose to implement
their own PCI ->remove() hook, rather than using the generic
ata_pci_remove_one(). Eliminates the need for a ->host_stop() hook
implementation, and allows one to perform tasks before calling
free_irq(), as well as tasks after the call (normal ->host_stop stuff).

Jeff