diff options
author | Tejun Heo <htejun@gmail.com> | 2008-01-23 10:05:14 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-17 15:44:16 -0400 |
commit | b558edddb1c42c70a30cfe494984d4be409f7b2b (patch) | |
tree | b03275d15675a519de7d4edde709892f885a5fa0 | |
parent | 8cebf274dd1c955a6e03385a85fd6569ce445946 (diff) |
libata: kill ata_ehi_schedule_probe()
ata_ehi_schedule_probe() was created to hide details of link-resuming
reset magic. Now that all the softreset workarounds are gone,
scheduling probe is very simple - set probe_mask and request RESET.
Kill ata_ehi_schedule_probe() and open code it. This also increases
consistency as ata_ehi_schedule_probe() couldn't cover individual
device probings so they were open-coded even when the helper existed.
While at it, define ATA_ALL_DEVICES as mask of all possible devices on
a link and always use it when requesting probe on link level for
simplicity and consistency. Setting extra bits in the probe_mask
doesn't hurt anybody.
Signed-off-by: Tejun Heo <htejun@gmail.com>
-rw-r--r-- | drivers/ata/libata-core.c | 3 | ||||
-rw-r--r-- | drivers/ata/libata-eh.c | 2 | ||||
-rw-r--r-- | drivers/ata/libata-pmp.c | 12 | ||||
-rw-r--r-- | drivers/ata/libata-scsi.c | 2 | ||||
-rw-r--r-- | include/linux/libata.h | 12 |
5 files changed, 15 insertions, 16 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index baef749ec528..4dc429fd0056 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -7156,8 +7156,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) | |||
7156 | /* kick EH for boot probing */ | 7156 | /* kick EH for boot probing */ |
7157 | spin_lock_irqsave(ap->lock, flags); | 7157 | spin_lock_irqsave(ap->lock, flags); |
7158 | 7158 | ||
7159 | ehi->probe_mask = | 7159 | ehi->probe_mask |= ATA_ALL_DEVICES; |
7160 | (1 << ata_link_max_devices(&ap->link)) - 1; | ||
7161 | ehi->action |= ATA_EH_RESET; | 7160 | ehi->action |= ATA_EH_RESET; |
7162 | ehi->flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET; | 7161 | ehi->flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET; |
7163 | 7162 | ||
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index e6584fa7f456..0d0a2c0ab9e7 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1746,7 +1746,7 @@ static void ata_eh_link_autopsy(struct ata_link *link) | |||
1746 | ata_eh_analyze_serror(link); | 1746 | ata_eh_analyze_serror(link); |
1747 | } else if (rc != -EOPNOTSUPP) { | 1747 | } else if (rc != -EOPNOTSUPP) { |
1748 | /* SError read failed, force reset and probing */ | 1748 | /* SError read failed, force reset and probing */ |
1749 | ata_ehi_schedule_probe(&ehc->i); | 1749 | ehc->i.probe_mask |= ATA_ALL_DEVICES; |
1750 | ehc->i.action |= ATA_EH_RESET; | 1750 | ehc->i.action |= ATA_EH_RESET; |
1751 | ehc->i.err_mask |= AC_ERR_OTHER; | 1751 | ehc->i.err_mask |= AC_ERR_OTHER; |
1752 | } | 1752 | } |
diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c index df1d3252b9e6..39e036c8a2bc 100644 --- a/drivers/ata/libata-pmp.c +++ b/drivers/ata/libata-pmp.c | |||
@@ -435,7 +435,7 @@ static int sata_pmp_init_links(struct ata_port *ap, int nr_ports) | |||
435 | struct ata_eh_context *ehc = &link->eh_context; | 435 | struct ata_eh_context *ehc = &link->eh_context; |
436 | 436 | ||
437 | link->flags = 0; | 437 | link->flags = 0; |
438 | ehc->i.probe_mask |= 1; | 438 | ehc->i.probe_mask |= ATA_ALL_DEVICES; |
439 | ehc->i.action |= ATA_EH_RESET; | 439 | ehc->i.action |= ATA_EH_RESET; |
440 | } | 440 | } |
441 | 441 | ||
@@ -831,8 +831,12 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap, | |||
831 | ata_eh_thaw_port(ap); | 831 | ata_eh_thaw_port(ap); |
832 | 832 | ||
833 | /* PMP is reset, SErrors cannot be trusted, scan all */ | 833 | /* PMP is reset, SErrors cannot be trusted, scan all */ |
834 | ata_port_for_each_link(tlink, ap) | 834 | ata_port_for_each_link(tlink, ap) { |
835 | ata_ehi_schedule_probe(&tlink->eh_context.i); | 835 | struct ata_eh_context *ehc = &tlink->eh_context; |
836 | |||
837 | ehc->i.probe_mask |= ATA_ALL_DEVICES; | ||
838 | ehc->i.action |= ATA_EH_RESET; | ||
839 | } | ||
836 | } | 840 | } |
837 | 841 | ||
838 | /* If revalidation is requested, revalidate and reconfigure; | 842 | /* If revalidation is requested, revalidate and reconfigure; |
@@ -847,7 +851,7 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap, | |||
847 | tries--; | 851 | tries--; |
848 | 852 | ||
849 | if (rc == -ENODEV) { | 853 | if (rc == -ENODEV) { |
850 | ehc->i.probe_mask |= 1; | 854 | ehc->i.probe_mask |= ATA_ALL_DEVICES; |
851 | detach = 1; | 855 | detach = 1; |
852 | /* give it just two more chances */ | 856 | /* give it just two more chances */ |
853 | tries = min(tries, 2); | 857 | tries = min(tries, 2); |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index caffca7dd76f..798ba5e45710 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -3507,7 +3507,7 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, | |||
3507 | 3507 | ||
3508 | ata_port_for_each_link(link, ap) { | 3508 | ata_port_for_each_link(link, ap) { |
3509 | struct ata_eh_info *ehi = &link->eh_info; | 3509 | struct ata_eh_info *ehi = &link->eh_info; |
3510 | ehi->probe_mask |= (1 << ata_link_max_devices(link)) - 1; | 3510 | ehi->probe_mask |= ATA_ALL_DEVICES; |
3511 | ehi->action |= ATA_EH_RESET; | 3511 | ehi->action |= ATA_EH_RESET; |
3512 | } | 3512 | } |
3513 | } else { | 3513 | } else { |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 6eec11957e54..bc60132c7d33 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -122,6 +122,8 @@ enum { | |||
122 | 122 | ||
123 | ATAPI_MAX_DRAIN = 16 << 10, | 123 | ATAPI_MAX_DRAIN = 16 << 10, |
124 | 124 | ||
125 | ATA_ALL_DEVICES = (1 << ATA_MAX_DEVICES) - 1, | ||
126 | |||
125 | ATA_SHT_EMULATED = 1, | 127 | ATA_SHT_EMULATED = 1, |
126 | ATA_SHT_CMD_PER_LUN = 1, | 128 | ATA_SHT_CMD_PER_LUN = 1, |
127 | ATA_SHT_THIS_ID = -1, | 129 | ATA_SHT_THIS_ID = -1, |
@@ -1089,17 +1091,11 @@ extern void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...) | |||
1089 | __attribute__ ((format (printf, 2, 3))); | 1091 | __attribute__ ((format (printf, 2, 3))); |
1090 | extern void ata_ehi_clear_desc(struct ata_eh_info *ehi); | 1092 | extern void ata_ehi_clear_desc(struct ata_eh_info *ehi); |
1091 | 1093 | ||
1092 | static inline void ata_ehi_schedule_probe(struct ata_eh_info *ehi) | ||
1093 | { | ||
1094 | ehi->action |= ATA_EH_RESET; | ||
1095 | ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; | ||
1096 | } | ||
1097 | |||
1098 | static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) | 1094 | static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) |
1099 | { | 1095 | { |
1100 | ata_ehi_schedule_probe(ehi); | 1096 | ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; |
1101 | ehi->flags |= ATA_EHI_HOTPLUGGED; | 1097 | ehi->flags |= ATA_EHI_HOTPLUGGED; |
1102 | ehi->action |= ATA_EH_ENABLE_LINK; | 1098 | ehi->action |= ATA_EH_RESET | ATA_EH_ENABLE_LINK; |
1103 | ehi->err_mask |= AC_ERR_ATA_BUS; | 1099 | ehi->err_mask |= AC_ERR_ATA_BUS; |
1104 | } | 1100 | } |
1105 | 1101 | ||