summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMark Lord <liml@rtr.ca>2006-06-07 12:53:29 -0400
committerJeff Garzik <jeff@garzik.org>2006-06-11 23:03:18 -0400
commit2f9719b61e1fcf7422a016ac4f2420a0cc6ba320 (patch)
tree1d2f66dcd86d4d7bf65f6628edd0e57cf3f35440 /drivers
parent650fb8382287f7990d5127a82a54295139224606 (diff)
downloadkernel-crypto-2f9719b61e1fcf7422a016ac4f2420a0cc6ba320.tar.gz
kernel-crypto-2f9719b61e1fcf7422a016ac4f2420a0cc6ba320.tar.xz
kernel-crypto-2f9719b61e1fcf7422a016ac4f2420a0cc6ba320.zip
[PATCH] sata_mv: grab host lock inside eng_timeout
Bug fix: mv_eng_timeout() calls mv_err_intr() without first grabbing the host lock, which can lead to all sorts of interesting scenarios. This whole error-handling portion of sata_mv is nasty (and will get fixed for the new EH stuff), but for now this patch will help keep it on life-support. Signed-off-by: Mark Lord <liml@rtr.ca> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/sata_mv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/sata_mv.c b/drivers/scsi/sata_mv.c
index 9b8bca1ac1f..f16f92a6ec0 100644
--- a/drivers/scsi/sata_mv.c
+++ b/drivers/scsi/sata_mv.c
@@ -2035,6 +2035,7 @@ static void mv_phy_reset(struct ata_port *ap)
static void mv_eng_timeout(struct ata_port *ap)
{
struct ata_queued_cmd *qc;
+ unsigned long flags;
printk(KERN_ERR "ata%u: Entering mv_eng_timeout\n",ap->id);
DPRINTK("All regs @ start of eng_timeout\n");
@@ -2046,8 +2047,10 @@ static void mv_eng_timeout(struct ata_port *ap)
ap->host_set->mmio_base, ap, qc, qc->scsicmd,
&qc->scsicmd->cmnd);
+ spin_lock_irqsave(&ap->host_set->lock, flags);
mv_err_intr(ap, 0);
mv_stop_and_reset(ap);
+ spin_unlock_irqrestore(&ap->host_set->lock, flags);
WARN_ON(!(qc->flags & ATA_QCFLAG_ACTIVE));
if (qc->flags & ATA_QCFLAG_ACTIVE) {