summaryrefslogtreecommitdiff
path: root/drivers/scsi/sata_sx4.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-08-25 22:01:20 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-08-25 22:01:20 -0400
commitb8f6153ee421014f42b620238f4203a4106db309 (patch)
treeebc9eac4517325be0a91a4e2b2cb38f08d36812e /drivers/scsi/sata_sx4.c
parent617e44fdfd7ee3d53388ab295d9411b826437ce9 (diff)
libata: fix EH locking
Wrap ata_qc_complete() calls in EH context in spinlocks, to prevent races (mainly in ATAPI code paths).
Diffstat (limited to 'drivers/scsi/sata_sx4.c')
-rw-r--r--drivers/scsi/sata_sx4.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c
index e2db499f22dd..a20d4285090a 100644
--- a/drivers/scsi/sata_sx4.c
+++ b/drivers/scsi/sata_sx4.c
@@ -848,10 +848,14 @@ static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance, struct pt_re
static void pdc_eng_timeout(struct ata_port *ap)
{
u8 drv_stat;
+ struct ata_host_set *host_set = ap->host_set;
struct ata_queued_cmd *qc;
+ unsigned long flags;
DPRINTK("ENTER\n");
+ spin_lock_irqsave(&host_set->lock, flags);
+
qc = ata_qc_from_tag(ap, ap->active_tag);
if (!qc) {
printk(KERN_ERR "ata%u: BUG: timeout without command\n",
@@ -885,6 +889,7 @@ static void pdc_eng_timeout(struct ata_port *ap)
}
out:
+ spin_unlock_irqrestore(&host_set->lock, flags);
DPRINTK("EXIT\n");
}