aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-01-23 10:05:14 -0500
committerJeff Garzik <jgarzik@redhat.com>2008-04-17 15:44:16 -0400
commit672b2d65ba83a6f3f801fd3d58851aa9c0725a54 (patch)
treeed3a2fe8013bf8322df637838deccf9f2bc9c92c /drivers
parentd692abd92f22a81b38d52c39601871003262841c (diff)
libata: kill ATA_EHI_RESUME_LINK
ATA_EHI_RESUME_LINK has two functions - promote reset to hardreset if ATA_LFLAG_HRST_TO_RESUME is set and preventing EH from shortcutting reset action when probing is requested. The former is gone now and the latter can easily be achieved by making EH to perform at least one reset if reset is requested, which also makes more sense than depending on RESUME_LINK flag. As ATA_EHI_RESUME_LINK was the only EHI reset modifier, this also kills reset modifier handling. Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/libata-eh.c21
-rw-r--r--drivers/ata/libata-pmp.c1
-rw-r--r--drivers/ata/libata-scsi.c1
3 files changed, 8 insertions, 15 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index f7cae6400155..e6584fa7f456 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1079,12 +1079,6 @@ void ata_eh_about_to_do(struct ata_link *link, struct ata_device *dev,
1079 1079
1080 spin_lock_irqsave(ap->lock, flags); 1080 spin_lock_irqsave(ap->lock, flags);
1081 1081
1082 /* suck in and clear reset modifier */
1083 if (action & ATA_EH_RESET) {
1084 ehc->i.flags |= ehi->flags & ATA_EHI_RESET_MODIFIER_MASK;
1085 ehi->flags &= ~ATA_EHI_RESET_MODIFIER_MASK;
1086 }
1087
1088 ata_eh_clear_action(link, dev, ehi, action); 1082 ata_eh_clear_action(link, dev, ehi, action);
1089 1083
1090 if (!(ehc->i.flags & ATA_EHI_QUIET)) 1084 if (!(ehc->i.flags & ATA_EHI_QUIET))
@@ -1110,10 +1104,6 @@ void ata_eh_done(struct ata_link *link, struct ata_device *dev,
1110{ 1104{
1111 struct ata_eh_context *ehc = &link->eh_context; 1105 struct ata_eh_context *ehc = &link->eh_context;
1112 1106
1113 /* if reset is complete, clear reset modifier */
1114 if (action & ATA_EH_RESET)
1115 ehc->i.flags &= ~ATA_EHI_RESET_MODIFIER_MASK;
1116
1117 ata_eh_clear_action(link, dev, &ehc->i, action); 1107 ata_eh_clear_action(link, dev, &ehc->i, action);
1118} 1108}
1119 1109
@@ -2491,6 +2481,7 @@ static int ata_link_nr_vacant(struct ata_link *link)
2491 2481
2492static int ata_eh_skip_recovery(struct ata_link *link) 2482static int ata_eh_skip_recovery(struct ata_link *link)
2493{ 2483{
2484 struct ata_port *ap = link->ap;
2494 struct ata_eh_context *ehc = &link->eh_context; 2485 struct ata_eh_context *ehc = &link->eh_context;
2495 struct ata_device *dev; 2486 struct ata_device *dev;
2496 2487
@@ -2498,9 +2489,13 @@ static int ata_eh_skip_recovery(struct ata_link *link)
2498 if (link->flags & ATA_LFLAG_DISABLED) 2489 if (link->flags & ATA_LFLAG_DISABLED)
2499 return 1; 2490 return 1;
2500 2491
2501 /* thaw frozen port, resume link and recover failed devices */ 2492 /* thaw frozen port and recover failed devices */
2502 if ((link->ap->pflags & ATA_PFLAG_FROZEN) || 2493 if ((ap->pflags & ATA_PFLAG_FROZEN) || ata_link_nr_enabled(link))
2503 (ehc->i.flags & ATA_EHI_RESUME_LINK) || ata_link_nr_enabled(link)) 2494 return 0;
2495
2496 /* reset at least once if reset is requested */
2497 if ((ehc->i.action & ATA_EH_RESET) &&
2498 !(ehc->i.flags & ATA_EHI_DID_RESET))
2504 return 0; 2499 return 0;
2505 2500
2506 /* skip if class codes for all vacant slots are ATA_DEV_NONE */ 2501 /* skip if class codes for all vacant slots are ATA_DEV_NONE */
diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c
index 7f8bcffa81ad..df1d3252b9e6 100644
--- a/drivers/ata/libata-pmp.c
+++ b/drivers/ata/libata-pmp.c
@@ -437,7 +437,6 @@ static int sata_pmp_init_links(struct ata_port *ap, int nr_ports)
437 link->flags = 0; 437 link->flags = 0;
438 ehc->i.probe_mask |= 1; 438 ehc->i.probe_mask |= 1;
439 ehc->i.action |= ATA_EH_RESET; 439 ehc->i.action |= ATA_EH_RESET;
440 ehc->i.flags |= ATA_EHI_RESUME_LINK;
441 } 440 }
442 441
443 return 0; 442 return 0;
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 1f036a7b14f3..caffca7dd76f 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3517,7 +3517,6 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
3517 struct ata_eh_info *ehi = &dev->link->eh_info; 3517 struct ata_eh_info *ehi = &dev->link->eh_info;
3518 ehi->probe_mask |= 1 << dev->devno; 3518 ehi->probe_mask |= 1 << dev->devno;
3519 ehi->action |= ATA_EH_RESET; 3519 ehi->action |= ATA_EH_RESET;
3520 ehi->flags |= ATA_EHI_RESUME_LINK;
3521 } else 3520 } else
3522 rc = -EINVAL; 3521 rc = -EINVAL;
3523 } 3522 }