From: Tejun Heo Date: Mon, 15 May 2006 11:57:33 +0000 (+0900) Subject: [PATCH] libata: hold host_set lock while finishing internal qc X-Git-Tag: v2.6.18-rc1~1079^2~98^2~48 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=158693031d7c58a355ec1852052a4fca75fd3bda;p=karo-tx-linux.git [PATCH] libata: hold host_set lock while finishing internal qc Hold host_set lock while finishing internal qc. Signed-off-by: Tejun Heo --- diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 86cd0e0895d0..13bce43f1915 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -1031,6 +1031,9 @@ unsigned ata_exec_internal(struct ata_port *ap, struct ata_device *dev, spin_unlock_irqrestore(&ap->host_set->lock, flags); } + /* finish up */ + spin_lock_irqsave(&ap->host_set->lock, flags); + *tf = qc->tf; 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); } + spin_unlock_irqrestore(&ap->host_set->lock, flags); + return err_mask; }