diff options
author | Tejun Heo <htejun@gmail.com> | 2006-07-03 03:07:26 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-07-05 22:16:27 -0400 |
commit | 1cdaf534f829b8759ba30f97d5e8dceb2ab77ba4 (patch) | |
tree | 4cad6cd3a04d3c10ab42e7d2c76c8f6e2467e506 /drivers/scsi/libata-eh.c | |
parent | e9c839142d698086d3fe33a0daafde55ddd00c4e (diff) |
[PATCH] libata: implement ATA_EHI_NO_AUTOPSY and QUIET
Implement ATA_EHI_NO_AUTOPSY and QUIET. These used to be implied by
ATA_PFLAG_LOADING, but new power management and PMP support need to
use these separately. e.g. Suspend/resume operations shouldn't print
full EH messages and resume shouldn't be recorded as an error.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi/libata-eh.c')
-rw-r--r-- | drivers/scsi/libata-eh.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/scsi/libata-eh.c b/drivers/scsi/libata-eh.c index d19666c376ad..1e9e73d13485 100644 --- a/drivers/scsi/libata-eh.c +++ b/drivers/scsi/libata-eh.c | |||
@@ -322,14 +322,13 @@ void ata_scsi_error(struct Scsi_Host *host) | |||
322 | /* clean up */ | 322 | /* clean up */ |
323 | spin_lock_irqsave(ap->lock, flags); | 323 | spin_lock_irqsave(ap->lock, flags); |
324 | 324 | ||
325 | if (ap->pflags & ATA_PFLAG_LOADING) { | 325 | if (ap->pflags & ATA_PFLAG_LOADING) |
326 | ap->pflags &= ~ATA_PFLAG_LOADING; | 326 | ap->pflags &= ~ATA_PFLAG_LOADING; |
327 | } else { | 327 | else if (ap->pflags & ATA_PFLAG_SCSI_HOTPLUG) |
328 | if (ap->pflags & ATA_PFLAG_SCSI_HOTPLUG) | 328 | queue_work(ata_aux_wq, &ap->hotplug_task); |
329 | queue_work(ata_aux_wq, &ap->hotplug_task); | 329 | |
330 | if (ap->pflags & ATA_PFLAG_RECOVERED) | 330 | if (ap->pflags & ATA_PFLAG_RECOVERED) |
331 | ata_port_printk(ap, KERN_INFO, "EH complete\n"); | 331 | ata_port_printk(ap, KERN_INFO, "EH complete\n"); |
332 | } | ||
333 | 332 | ||
334 | ap->pflags &= ~(ATA_PFLAG_SCSI_HOTPLUG | ATA_PFLAG_RECOVERED); | 333 | ap->pflags &= ~(ATA_PFLAG_SCSI_HOTPLUG | ATA_PFLAG_RECOVERED); |
335 | 334 | ||
@@ -759,8 +758,12 @@ static void ata_eh_about_to_do(struct ata_port *ap, struct ata_device *dev, | |||
759 | unsigned long flags; | 758 | unsigned long flags; |
760 | 759 | ||
761 | spin_lock_irqsave(ap->lock, flags); | 760 | spin_lock_irqsave(ap->lock, flags); |
761 | |||
762 | ata_eh_clear_action(dev, &ap->eh_info, action); | 762 | ata_eh_clear_action(dev, &ap->eh_info, action); |
763 | ap->pflags |= ATA_PFLAG_RECOVERED; | 763 | |
764 | if (!(ap->eh_context.i.flags & ATA_EHI_QUIET)) | ||
765 | ap->pflags |= ATA_PFLAG_RECOVERED; | ||
766 | |||
764 | spin_unlock_irqrestore(ap->lock, flags); | 767 | spin_unlock_irqrestore(ap->lock, flags); |
765 | } | 768 | } |
766 | 769 | ||
@@ -1274,6 +1277,9 @@ static void ata_eh_autopsy(struct ata_port *ap) | |||
1274 | 1277 | ||
1275 | DPRINTK("ENTER\n"); | 1278 | DPRINTK("ENTER\n"); |
1276 | 1279 | ||
1280 | if (ehc->i.flags & ATA_EHI_NO_AUTOPSY) | ||
1281 | return; | ||
1282 | |||
1277 | /* obtain and analyze SError */ | 1283 | /* obtain and analyze SError */ |
1278 | rc = sata_scr_read(ap, SCR_ERROR, &serror); | 1284 | rc = sata_scr_read(ap, SCR_ERROR, &serror); |
1279 | if (rc == 0) { | 1285 | if (rc == 0) { |
@@ -1464,7 +1470,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify, | |||
1464 | struct ata_eh_context *ehc = &ap->eh_context; | 1470 | struct ata_eh_context *ehc = &ap->eh_context; |
1465 | unsigned int *classes = ehc->classes; | 1471 | unsigned int *classes = ehc->classes; |
1466 | int tries = ATA_EH_RESET_TRIES; | 1472 | int tries = ATA_EH_RESET_TRIES; |
1467 | int verbose = !(ap->pflags & ATA_PFLAG_LOADING); | 1473 | int verbose = !(ehc->i.flags & ATA_EHI_QUIET); |
1468 | unsigned int action; | 1474 | unsigned int action; |
1469 | ata_reset_fn_t reset; | 1475 | ata_reset_fn_t reset; |
1470 | int i, did_followup_srst, rc; | 1476 | int i, did_followup_srst, rc; |
@@ -1907,11 +1913,8 @@ void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset, | |||
1907 | ata_reset_fn_t softreset, ata_reset_fn_t hardreset, | 1913 | ata_reset_fn_t softreset, ata_reset_fn_t hardreset, |
1908 | ata_postreset_fn_t postreset) | 1914 | ata_postreset_fn_t postreset) |
1909 | { | 1915 | { |
1910 | if (!(ap->pflags & ATA_PFLAG_LOADING)) { | 1916 | ata_eh_autopsy(ap); |
1911 | ata_eh_autopsy(ap); | 1917 | ata_eh_report(ap); |
1912 | ata_eh_report(ap); | ||
1913 | } | ||
1914 | |||
1915 | ata_eh_recover(ap, prereset, softreset, hardreset, postreset); | 1918 | ata_eh_recover(ap, prereset, softreset, hardreset, postreset); |
1916 | ata_eh_finish(ap); | 1919 | ata_eh_finish(ap); |
1917 | } | 1920 | } |