aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-eh.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-05-31 05:28:11 -0400
committerTejun Heo <htejun@gmail.com>2006-05-31 05:28:11 -0400
commit3e706399b03bd237d087d731d4b1b029e546b33d (patch)
tree51a5de83f8493d1b78cc16b0fa0abcac2b37cebc /drivers/scsi/libata-eh.c
parentccf68c3405fca11386004674377d951b9b18e756 (diff)
[PATCH] libata-hp: implement bootplug
Implement bootplug - boot probing via hotplug path. While loading, ata_host_add() simply schedules probing and invokes EH. After EH completes, ata_host_add() scans and assicates them with SCSI devices. EH path is slightly modified to handle this (e.g. no autopsy during bootplug). The SCSI part is left in ata_host_add() because it's shared with legacy path and to keep probing order as before (ATA scan all ports in host_set then attach all). Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/scsi/libata-eh.c')
-rw-r--r--drivers/scsi/libata-eh.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/drivers/scsi/libata-eh.c b/drivers/scsi/libata-eh.c
index 733dfa532977..70c132bef68e 100644
--- a/drivers/scsi/libata-eh.c
+++ b/drivers/scsi/libata-eh.c
@@ -287,11 +287,14 @@ void ata_scsi_error(struct Scsi_Host *host)
287 /* clean up */ 287 /* clean up */
288 spin_lock_irqsave(hs_lock, flags); 288 spin_lock_irqsave(hs_lock, flags);
289 289
290 if (ap->flags & ATA_FLAG_SCSI_HOTPLUG) 290 if (ap->flags & ATA_FLAG_LOADING) {
291 queue_work(ata_aux_wq, &ap->hotplug_task); 291 ap->flags &= ~ATA_FLAG_LOADING;
292 292 } else {
293 if (ap->flags & ATA_FLAG_RECOVERED) 293 if (ap->flags & ATA_FLAG_SCSI_HOTPLUG)
294 ata_port_printk(ap, KERN_INFO, "EH complete\n"); 294 queue_work(ata_aux_wq, &ap->hotplug_task);
295 if (ap->flags & ATA_FLAG_RECOVERED)
296 ata_port_printk(ap, KERN_INFO, "EH complete\n");
297 }
295 298
296 ap->flags &= ~(ATA_FLAG_SCSI_HOTPLUG | ATA_FLAG_RECOVERED); 299 ap->flags &= ~(ATA_FLAG_SCSI_HOTPLUG | ATA_FLAG_RECOVERED);
297 300
@@ -1367,6 +1370,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
1367 struct ata_eh_context *ehc = &ap->eh_context; 1370 struct ata_eh_context *ehc = &ap->eh_context;
1368 unsigned int *classes = ehc->classes; 1371 unsigned int *classes = ehc->classes;
1369 int tries = ATA_EH_RESET_TRIES; 1372 int tries = ATA_EH_RESET_TRIES;
1373 int verbose = !(ap->flags & ATA_FLAG_LOADING);
1370 unsigned int action; 1374 unsigned int action;
1371 ata_reset_fn_t reset; 1375 ata_reset_fn_t reset;
1372 int i, did_followup_srst, rc; 1376 int i, did_followup_srst, rc;
@@ -1414,8 +1418,10 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
1414 } 1418 }
1415 1419
1416 retry: 1420 retry:
1417 ata_port_printk(ap, KERN_INFO, "%s resetting port\n", 1421 /* shut up during boot probing */
1418 reset == softreset ? "soft" : "hard"); 1422 if (verbose)
1423 ata_port_printk(ap, KERN_INFO, "%s resetting port\n",
1424 reset == softreset ? "soft" : "hard");
1419 1425
1420 /* reset */ 1426 /* reset */
1421 ata_eh_about_to_do(ap, ATA_EH_RESET_MASK); 1427 ata_eh_about_to_do(ap, ATA_EH_RESET_MASK);
@@ -1799,8 +1805,11 @@ void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
1799 ata_reset_fn_t softreset, ata_reset_fn_t hardreset, 1805 ata_reset_fn_t softreset, ata_reset_fn_t hardreset,
1800 ata_postreset_fn_t postreset) 1806 ata_postreset_fn_t postreset)
1801{ 1807{
1802 ata_eh_autopsy(ap); 1808 if (!(ap->flags & ATA_FLAG_LOADING)) {
1803 ata_eh_report(ap); 1809 ata_eh_autopsy(ap);
1810 ata_eh_report(ap);
1811 }
1812
1804 ata_eh_recover(ap, prereset, softreset, hardreset, postreset); 1813 ata_eh_recover(ap, prereset, softreset, hardreset, postreset);
1805 ata_eh_finish(ap); 1814 ata_eh_finish(ap);
1806} 1815}