summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-09-30 13:07:17 +0400
committerJeff Garzik <jeff@garzik.org>2006-12-02 06:40:29 +0300
commit309afcb5c87b5a41da51cc0c36f61c0e0d43ca9a (patch)
tree21566a73f25ec3b91163c5a0ba0252e7079c7370 /drivers
parent722420fe6e2ab63bebc5a9ea346016b59076d75d (diff)
downloadlinux-309afcb5c87b5a41da51cc0c36f61c0e0d43ca9a.tar.xz
[PATCH] libata: make user scan wait for scan to complete
Make user scan wait for scan to complete. This way user can wait for warm plug request to complete and is prevented from causing EH event storm by repetitively issuing scan request while EH is in progress. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Fajun Chen <fajunchen@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/libata-scsi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 47ea111d5ace..6b2553dae489 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3182,10 +3182,12 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
rc = -EINVAL;
}
- if (rc == 0)
+ if (rc == 0) {
ata_port_schedule_eh(ap);
-
- spin_unlock_irqrestore(ap->lock, flags);
+ spin_unlock_irqrestore(ap->lock, flags);
+ ata_port_wait_eh(ap);
+ } else
+ spin_unlock_irqrestore(ap->lock, flags);
return rc;
}