aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-eh.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-06-28 12:29:30 -0400
committerJeff Garzik <jeff@garzik.org>2006-07-05 21:51:42 -0400
commitb51e9e5db0e36239f786692f1cac6e435ed30c66 (patch)
tree396f2da741820f25174f0ef2d05af957a8dafc22 /drivers/scsi/libata-eh.c
parente6d902a3bfd53da375588e498251f4f4f6cd9650 (diff)
[PATCH] libata: add ap->pflags and move core dynamic flags to it
ap->flags is way too clamped. Separate out core dynamic flags to ap->pflags. ATA_FLAG_DISABLED is a dynamic flag but left alone as it's referenced by a lot of LLDs and it's gonna be removed once all LLDs are converted to new EH. 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.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/drivers/scsi/libata-eh.c b/drivers/scsi/libata-eh.c
index bf5a72aca8a4..f2f29a8bc38e 100644
--- a/drivers/scsi/libata-eh.c
+++ b/drivers/scsi/libata-eh.c
@@ -270,13 +270,13 @@ void ata_scsi_error(struct Scsi_Host *host)
270 ap->eh_context.i = ap->eh_info; 270 ap->eh_context.i = ap->eh_info;
271 memset(&ap->eh_info, 0, sizeof(ap->eh_info)); 271 memset(&ap->eh_info, 0, sizeof(ap->eh_info));
272 272
273 ap->flags |= ATA_FLAG_EH_IN_PROGRESS; 273 ap->pflags |= ATA_PFLAG_EH_IN_PROGRESS;
274 ap->flags &= ~ATA_FLAG_EH_PENDING; 274 ap->pflags &= ~ATA_PFLAG_EH_PENDING;
275 275
276 spin_unlock_irqrestore(ap_lock, flags); 276 spin_unlock_irqrestore(ap_lock, flags);
277 277
278 /* invoke EH. if unloading, just finish failed qcs */ 278 /* invoke EH. if unloading, just finish failed qcs */
279 if (!(ap->flags & ATA_FLAG_UNLOADING)) 279 if (!(ap->pflags & ATA_PFLAG_UNLOADING))
280 ap->ops->error_handler(ap); 280 ap->ops->error_handler(ap);
281 else 281 else
282 ata_eh_finish(ap); 282 ata_eh_finish(ap);
@@ -287,7 +287,7 @@ void ata_scsi_error(struct Scsi_Host *host)
287 */ 287 */
288 spin_lock_irqsave(ap_lock, flags); 288 spin_lock_irqsave(ap_lock, flags);
289 289
290 if (ap->flags & ATA_FLAG_EH_PENDING) { 290 if (ap->pflags & ATA_PFLAG_EH_PENDING) {
291 if (--repeat_cnt) { 291 if (--repeat_cnt) {
292 ata_port_printk(ap, KERN_INFO, 292 ata_port_printk(ap, KERN_INFO,
293 "EH pending after completion, " 293 "EH pending after completion, "
@@ -323,19 +323,19 @@ void ata_scsi_error(struct Scsi_Host *host)
323 /* clean up */ 323 /* clean up */
324 spin_lock_irqsave(ap_lock, flags); 324 spin_lock_irqsave(ap_lock, flags);
325 325
326 if (ap->flags & ATA_FLAG_LOADING) { 326 if (ap->pflags & ATA_PFLAG_LOADING) {
327 ap->flags &= ~ATA_FLAG_LOADING; 327 ap->pflags &= ~ATA_PFLAG_LOADING;
328 } else { 328 } else {
329 if (ap->flags & ATA_FLAG_SCSI_HOTPLUG) 329 if (ap->pflags & ATA_PFLAG_SCSI_HOTPLUG)
330 queue_work(ata_aux_wq, &ap->hotplug_task); 330 queue_work(ata_aux_wq, &ap->hotplug_task);
331 if (ap->flags & ATA_FLAG_RECOVERED) 331 if (ap->pflags & ATA_PFLAG_RECOVERED)
332 ata_port_printk(ap, KERN_INFO, "EH complete\n"); 332 ata_port_printk(ap, KERN_INFO, "EH complete\n");
333 } 333 }
334 334
335 ap->flags &= ~(ATA_FLAG_SCSI_HOTPLUG | ATA_FLAG_RECOVERED); 335 ap->pflags &= ~(ATA_PFLAG_SCSI_HOTPLUG | ATA_PFLAG_RECOVERED);
336 336
337 /* tell wait_eh that we're done */ 337 /* tell wait_eh that we're done */
338 ap->flags &= ~ATA_FLAG_EH_IN_PROGRESS; 338 ap->pflags &= ~ATA_PFLAG_EH_IN_PROGRESS;
339 wake_up_all(&ap->eh_wait_q); 339 wake_up_all(&ap->eh_wait_q);
340 340
341 spin_unlock_irqrestore(ap_lock, flags); 341 spin_unlock_irqrestore(ap_lock, flags);
@@ -360,7 +360,7 @@ void ata_port_wait_eh(struct ata_port *ap)
360 retry: 360 retry:
361 spin_lock_irqsave(ap->lock, flags); 361 spin_lock_irqsave(ap->lock, flags);
362 362
363 while (ap->flags & (ATA_FLAG_EH_PENDING | ATA_FLAG_EH_IN_PROGRESS)) { 363 while (ap->pflags & (ATA_PFLAG_EH_PENDING | ATA_PFLAG_EH_IN_PROGRESS)) {
364 prepare_to_wait(&ap->eh_wait_q, &wait, TASK_UNINTERRUPTIBLE); 364 prepare_to_wait(&ap->eh_wait_q, &wait, TASK_UNINTERRUPTIBLE);
365 spin_unlock_irqrestore(ap->lock, flags); 365 spin_unlock_irqrestore(ap->lock, flags);
366 schedule(); 366 schedule();
@@ -489,7 +489,7 @@ void ata_qc_schedule_eh(struct ata_queued_cmd *qc)
489 WARN_ON(!ap->ops->error_handler); 489 WARN_ON(!ap->ops->error_handler);
490 490
491 qc->flags |= ATA_QCFLAG_FAILED; 491 qc->flags |= ATA_QCFLAG_FAILED;
492 qc->ap->flags |= ATA_FLAG_EH_PENDING; 492 qc->ap->pflags |= ATA_PFLAG_EH_PENDING;
493 493
494 /* The following will fail if timeout has already expired. 494 /* The following will fail if timeout has already expired.
495 * ata_scsi_error() takes care of such scmds on EH entry. 495 * ata_scsi_error() takes care of such scmds on EH entry.
@@ -513,7 +513,7 @@ void ata_port_schedule_eh(struct ata_port *ap)
513{ 513{
514 WARN_ON(!ap->ops->error_handler); 514 WARN_ON(!ap->ops->error_handler);
515 515
516 ap->flags |= ATA_FLAG_EH_PENDING; 516 ap->pflags |= ATA_PFLAG_EH_PENDING;
517 scsi_schedule_eh(ap->host); 517 scsi_schedule_eh(ap->host);
518 518
519 DPRINTK("port EH scheduled\n"); 519 DPRINTK("port EH scheduled\n");
@@ -578,7 +578,7 @@ static void __ata_port_freeze(struct ata_port *ap)
578 if (ap->ops->freeze) 578 if (ap->ops->freeze)
579 ap->ops->freeze(ap); 579 ap->ops->freeze(ap);
580 580
581 ap->flags |= ATA_FLAG_FROZEN; 581 ap->pflags |= ATA_PFLAG_FROZEN;
582 582
583 DPRINTK("ata%u port frozen\n", ap->id); 583 DPRINTK("ata%u port frozen\n", ap->id);
584} 584}
@@ -646,7 +646,7 @@ void ata_eh_thaw_port(struct ata_port *ap)
646 646
647 spin_lock_irqsave(ap->lock, flags); 647 spin_lock_irqsave(ap->lock, flags);
648 648
649 ap->flags &= ~ATA_FLAG_FROZEN; 649 ap->pflags &= ~ATA_PFLAG_FROZEN;
650 650
651 if (ap->ops->thaw) 651 if (ap->ops->thaw)
652 ap->ops->thaw(ap); 652 ap->ops->thaw(ap);
@@ -731,7 +731,7 @@ static void ata_eh_detach_dev(struct ata_device *dev)
731 731
732 if (ata_scsi_offline_dev(dev)) { 732 if (ata_scsi_offline_dev(dev)) {
733 dev->flags |= ATA_DFLAG_DETACHED; 733 dev->flags |= ATA_DFLAG_DETACHED;
734 ap->flags |= ATA_FLAG_SCSI_HOTPLUG; 734 ap->pflags |= ATA_PFLAG_SCSI_HOTPLUG;
735 } 735 }
736 736
737 /* clear per-dev EH actions */ 737 /* clear per-dev EH actions */
@@ -761,7 +761,7 @@ static void ata_eh_about_to_do(struct ata_port *ap, struct ata_device *dev,
761 761
762 spin_lock_irqsave(ap->lock, flags); 762 spin_lock_irqsave(ap->lock, flags);
763 ata_eh_clear_action(dev, &ap->eh_info, action); 763 ata_eh_clear_action(dev, &ap->eh_info, action);
764 ap->flags |= ATA_FLAG_RECOVERED; 764 ap->pflags |= ATA_PFLAG_RECOVERED;
765 spin_unlock_irqrestore(ap->lock, flags); 765 spin_unlock_irqrestore(ap->lock, flags);
766} 766}
767 767
@@ -1027,7 +1027,7 @@ static void ata_eh_analyze_ncq_error(struct ata_port *ap)
1027 int tag, rc; 1027 int tag, rc;
1028 1028
1029 /* if frozen, we can't do much */ 1029 /* if frozen, we can't do much */
1030 if (ap->flags & ATA_FLAG_FROZEN) 1030 if (ap->pflags & ATA_PFLAG_FROZEN)
1031 return; 1031 return;
1032 1032
1033 /* is it NCQ device error? */ 1033 /* is it NCQ device error? */
@@ -1327,7 +1327,7 @@ static void ata_eh_autopsy(struct ata_port *ap)
1327 } 1327 }
1328 1328
1329 /* enforce default EH actions */ 1329 /* enforce default EH actions */
1330 if (ap->flags & ATA_FLAG_FROZEN || 1330 if (ap->pflags & ATA_PFLAG_FROZEN ||
1331 all_err_mask & (AC_ERR_HSM | AC_ERR_TIMEOUT)) 1331 all_err_mask & (AC_ERR_HSM | AC_ERR_TIMEOUT))
1332 action |= ATA_EH_SOFTRESET; 1332 action |= ATA_EH_SOFTRESET;
1333 else if (all_err_mask) 1333 else if (all_err_mask)
@@ -1385,7 +1385,7 @@ static void ata_eh_report(struct ata_port *ap)
1385 return; 1385 return;
1386 1386
1387 frozen = ""; 1387 frozen = "";
1388 if (ap->flags & ATA_FLAG_FROZEN) 1388 if (ap->pflags & ATA_PFLAG_FROZEN)
1389 frozen = " frozen"; 1389 frozen = " frozen";
1390 1390
1391 if (ehc->i.dev) { 1391 if (ehc->i.dev) {
@@ -1465,7 +1465,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
1465 struct ata_eh_context *ehc = &ap->eh_context; 1465 struct ata_eh_context *ehc = &ap->eh_context;
1466 unsigned int *classes = ehc->classes; 1466 unsigned int *classes = ehc->classes;
1467 int tries = ATA_EH_RESET_TRIES; 1467 int tries = ATA_EH_RESET_TRIES;
1468 int verbose = !(ap->flags & ATA_FLAG_LOADING); 1468 int verbose = !(ap->pflags & ATA_PFLAG_LOADING);
1469 unsigned int action; 1469 unsigned int action;
1470 ata_reset_fn_t reset; 1470 ata_reset_fn_t reset;
1471 int i, did_followup_srst, rc; 1471 int i, did_followup_srst, rc;
@@ -1636,7 +1636,7 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap,
1636 } 1636 }
1637 1637
1638 spin_lock_irqsave(ap->lock, flags); 1638 spin_lock_irqsave(ap->lock, flags);
1639 ap->flags |= ATA_FLAG_SCSI_HOTPLUG; 1639 ap->pflags |= ATA_PFLAG_SCSI_HOTPLUG;
1640 spin_unlock_irqrestore(ap->lock, flags); 1640 spin_unlock_irqrestore(ap->lock, flags);
1641 } 1641 }
1642 } 1642 }
@@ -1673,7 +1673,7 @@ static int ata_eh_skip_recovery(struct ata_port *ap)
1673 struct ata_eh_context *ehc = &ap->eh_context; 1673 struct ata_eh_context *ehc = &ap->eh_context;
1674 int i; 1674 int i;
1675 1675
1676 if (ap->flags & ATA_FLAG_FROZEN || ata_port_nr_enabled(ap)) 1676 if (ap->pflags & ATA_PFLAG_FROZEN || ata_port_nr_enabled(ap))
1677 return 0; 1677 return 0;
1678 1678
1679 /* skip if class codes for all vacant slots are ATA_DEV_NONE */ 1679 /* skip if class codes for all vacant slots are ATA_DEV_NONE */
@@ -1744,7 +1744,7 @@ static int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
1744 rc = 0; 1744 rc = 0;
1745 1745
1746 /* if UNLOADING, finish immediately */ 1746 /* if UNLOADING, finish immediately */
1747 if (ap->flags & ATA_FLAG_UNLOADING) 1747 if (ap->pflags & ATA_PFLAG_UNLOADING)
1748 goto out; 1748 goto out;
1749 1749
1750 /* skip EH if possible. */ 1750 /* skip EH if possible. */
@@ -1908,7 +1908,7 @@ void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
1908 ata_reset_fn_t softreset, ata_reset_fn_t hardreset, 1908 ata_reset_fn_t softreset, ata_reset_fn_t hardreset,
1909 ata_postreset_fn_t postreset) 1909 ata_postreset_fn_t postreset)
1910{ 1910{
1911 if (!(ap->flags & ATA_FLAG_LOADING)) { 1911 if (!(ap->pflags & ATA_PFLAG_LOADING)) {
1912 ata_eh_autopsy(ap); 1912 ata_eh_autopsy(ap);
1913 ata_eh_report(ap); 1913 ata_eh_report(ap);
1914 } 1914 }