[PATCH] libata: implement ata_poll_qc_complete and use it in polling functions
authorTejun Heo <htejun@gmail.com>
Mon, 22 Aug 2005 08:12:45 +0000 (17:12 +0900)
committerJeff Garzik <jgarzik@pobox.com>
Tue, 23 Aug 2005 05:05:55 +0000 (01:05 -0400)
commit40e8c82c74b9be793601e098fd1313bc2632c5dc
treeb3c89b2aaa5d477e8db5acc9bf4ee6f31acf3db8
parentc1389503710ef4b4e5d21bea284afde19e9619cf
[PATCH] libata: implement ata_poll_qc_complete and use it in polling functions

[PATCH libata-dev-2.6:upstream] implement ata_poll_qc_complete and use it in polling functions

 Previously, libata polling functions turned irq back on and completed
qc commands without holding host lock.  This creates a race condition
between the polling task and interrupts from other ports on the same
host set or spurious interrupt from itself.

 This patch implements ata_poll_qc_complete which enables irq and
completes qc atomically and convert all polling functions.

 Note: atapi_packet_task() didn't use to turn irq back on or clear
ATA_FLAG_NOINTR on error exits.  This patch makes it use
ata_poll_qc_complete which does both.

 Note: With this change, ALL invocations of ata_qc_complete() are now
done under host_set lock.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
drivers/scsi/libata-core.c