[PATCH] libata: hold host_set lock while finishing internal qc

Hold host_set lock while finishing internal qc.

Signed-off-by: Tejun Heo <htejun@gmail.com>
This commit is contained in:
Tejun Heo 2006-05-15 20:57:33 +09:00
parent 7401abf2f4
commit 158693031d
1 changed files with 5 additions and 0 deletions
drivers/scsi

View File

@ -1031,6 +1031,9 @@ unsigned ata_exec_internal(struct ata_port *ap, struct ata_device *dev,
spin_unlock_irqrestore(&ap->host_set->lock, flags); spin_unlock_irqrestore(&ap->host_set->lock, flags);
} }
/* finish up */
spin_lock_irqsave(&ap->host_set->lock, flags);
*tf = qc->tf; *tf = qc->tf;
err_mask = qc->err_mask; err_mask = qc->err_mask;
@ -1052,6 +1055,8 @@ unsigned ata_exec_internal(struct ata_port *ap, struct ata_device *dev,
ata_port_probe(ap); ata_port_probe(ap);
} }
spin_unlock_irqrestore(&ap->host_set->lock, flags);
return err_mask; return err_mask;
} }