diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-08-26 02:01:20 (GMT) |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-26 02:01:20 (GMT) |
commit | b8f6153ee421014f42b620238f4203a4106db309 (patch) | |
tree | ebc9eac4517325be0a91a4e2b2cb38f08d36812e /drivers/scsi/ahci.c | |
parent | 617e44fdfd7ee3d53388ab295d9411b826437ce9 (diff) | |
download | linux-b8f6153ee421014f42b620238f4203a4106db309.tar.xz |
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/ahci.c')
-rw-r--r-- | drivers/scsi/ahci.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c index 3484939..841f4e2 100644 --- a/drivers/scsi/ahci.c +++ b/drivers/scsi/ahci.c @@ -586,12 +586,16 @@ static void ahci_intr_error(struct ata_port *ap, u32 irq_stat) static void ahci_eng_timeout(struct ata_port *ap) { - void *mmio = ap->host_set->mmio_base; + struct ata_host_set *host_set = ap->host_set; + void *mmio = host_set->mmio_base; void *port_mmio = ahci_port_base(mmio, ap->port_no); struct ata_queued_cmd *qc; + unsigned long flags; DPRINTK("ENTER\n"); + spin_lock_irqsave(&host_set->lock, flags); + ahci_intr_error(ap, readl(port_mmio + PORT_IRQ_STAT)); qc = ata_qc_from_tag(ap, ap->active_tag); @@ -609,6 +613,7 @@ static void ahci_eng_timeout(struct ata_port *ap) ata_qc_complete(qc, ATA_ERR); } + spin_unlock_irqrestore(&host_set->lock, flags); } static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc) |