aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ata/libata-eh.c21
-rw-r--r--drivers/ata/libata-pmp.c1
-rw-r--r--drivers/ata/libata-scsi.c1
-rw-r--r--include/linux/libata.h3
4 files changed, 8 insertions, 18 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 }
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 1524af6f018b..4093e3b6a8b7 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -301,7 +301,6 @@ enum {
301 301
302 /* ata_eh_info->flags */ 302 /* ata_eh_info->flags */
303 ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ 303 ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */
304 ATA_EHI_RESUME_LINK = (1 << 1), /* resume link (reset modifier) */
305 ATA_EHI_NO_AUTOPSY = (1 << 2), /* no autopsy */ 304 ATA_EHI_NO_AUTOPSY = (1 << 2), /* no autopsy */
306 ATA_EHI_QUIET = (1 << 3), /* be quiet */ 305 ATA_EHI_QUIET = (1 << 3), /* be quiet */
307 306
@@ -312,7 +311,6 @@ enum {
312 ATA_EHI_POST_SETMODE = (1 << 20), /* revaildating after setmode */ 311 ATA_EHI_POST_SETMODE = (1 << 20), /* revaildating after setmode */
313 312
314 ATA_EHI_DID_RESET = ATA_EHI_DID_SOFTRESET | ATA_EHI_DID_HARDRESET, 313 ATA_EHI_DID_RESET = ATA_EHI_DID_SOFTRESET | ATA_EHI_DID_HARDRESET,
315 ATA_EHI_RESET_MODIFIER_MASK = ATA_EHI_RESUME_LINK,
316 314
317 /* max tries if error condition is still set after ->error_handler */ 315 /* max tries if error condition is still set after ->error_handler */
318 ATA_EH_MAX_TRIES = 5, 316 ATA_EH_MAX_TRIES = 5,
@@ -1095,7 +1093,6 @@ extern void ata_ehi_clear_desc(struct ata_eh_info *ehi);
1095 1093
1096static inline void ata_ehi_schedule_probe(struct ata_eh_info *ehi) 1094static inline void ata_ehi_schedule_probe(struct ata_eh_info *ehi)
1097{ 1095{
1098 ehi->flags |= ATA_EHI_RESUME_LINK;
1099 ehi->action |= ATA_EH_RESET; 1096 ehi->action |= ATA_EH_RESET;
1100 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; 1097 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1;
1101} 1098}