aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-pmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-pmp.c')
-rw-r--r--drivers/ata/libata-pmp.c47
1 files changed, 11 insertions, 36 deletions
diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c
index 39e036c8a2bc..a7cb1498c9b2 100644
--- a/drivers/ata/libata-pmp.c
+++ b/drivers/ata/libata-pmp.c
@@ -962,14 +962,6 @@ static int sata_pmp_handle_link_fail(struct ata_link *link, int *link_tries)
962/** 962/**
963 * sata_pmp_eh_recover - recover PMP-enabled port 963 * sata_pmp_eh_recover - recover PMP-enabled port
964 * @ap: ATA port to recover 964 * @ap: ATA port to recover
965 * @prereset: prereset method (can be NULL)
966 * @softreset: softreset method
967 * @hardreset: hardreset method
968 * @postreset: postreset method (can be NULL)
969 * @pmp_prereset: PMP prereset method (can be NULL)
970 * @pmp_softreset: PMP softreset method (can be NULL)
971 * @pmp_hardreset: PMP hardreset method (can be NULL)
972 * @pmp_postreset: PMP postreset method (can be NULL)
973 * 965 *
974 * Drive EH recovery operation for PMP enabled port @ap. This 966 * Drive EH recovery operation for PMP enabled port @ap. This
975 * function recovers host and PMP ports with proper retrials and 967 * function recovers host and PMP ports with proper retrials and
@@ -982,12 +974,9 @@ static int sata_pmp_handle_link_fail(struct ata_link *link, int *link_tries)
982 * RETURNS: 974 * RETURNS:
983 * 0 on success, -errno on failure. 975 * 0 on success, -errno on failure.
984 */ 976 */
985static int sata_pmp_eh_recover(struct ata_port *ap, 977static int sata_pmp_eh_recover(struct ata_port *ap)
986 ata_prereset_fn_t prereset, ata_reset_fn_t softreset,
987 ata_reset_fn_t hardreset, ata_postreset_fn_t postreset,
988 ata_prereset_fn_t pmp_prereset, ata_reset_fn_t pmp_softreset,
989 ata_reset_fn_t pmp_hardreset, ata_postreset_fn_t pmp_postreset)
990{ 978{
979 struct ata_port_operations *ops = ap->ops;
991 int pmp_tries, link_tries[SATA_PMP_MAX_PORTS]; 980 int pmp_tries, link_tries[SATA_PMP_MAX_PORTS];
992 struct ata_link *pmp_link = &ap->link; 981 struct ata_link *pmp_link = &ap->link;
993 struct ata_device *pmp_dev = pmp_link->device; 982 struct ata_device *pmp_dev = pmp_link->device;
@@ -1005,8 +994,8 @@ static int sata_pmp_eh_recover(struct ata_port *ap,
1005 retry: 994 retry:
1006 /* PMP attached? */ 995 /* PMP attached? */
1007 if (!ap->nr_pmp_links) { 996 if (!ap->nr_pmp_links) {
1008 rc = ata_eh_recover(ap, prereset, softreset, hardreset, 997 rc = ata_eh_recover(ap, ops->prereset, ops->softreset,
1009 postreset, NULL); 998 ops->hardreset, ops->postreset, NULL);
1010 if (rc) { 999 if (rc) {
1011 ata_link_for_each_dev(dev, &ap->link) 1000 ata_link_for_each_dev(dev, &ap->link)
1012 ata_dev_disable(dev); 1001 ata_dev_disable(dev);
@@ -1024,8 +1013,8 @@ static int sata_pmp_eh_recover(struct ata_port *ap,
1024 } 1013 }
1025 1014
1026 /* recover pmp */ 1015 /* recover pmp */
1027 rc = sata_pmp_eh_recover_pmp(ap, prereset, softreset, hardreset, 1016 rc = sata_pmp_eh_recover_pmp(ap, ops->prereset, ops->softreset,
1028 postreset); 1017 ops->hardreset, ops->postreset);
1029 if (rc) 1018 if (rc)
1030 goto pmp_fail; 1019 goto pmp_fail;
1031 1020
@@ -1035,8 +1024,8 @@ static int sata_pmp_eh_recover(struct ata_port *ap,
1035 goto pmp_fail; 1024 goto pmp_fail;
1036 1025
1037 /* recover links */ 1026 /* recover links */
1038 rc = ata_eh_recover(ap, pmp_prereset, pmp_softreset, pmp_hardreset, 1027 rc = ata_eh_recover(ap, ops->pmp_prereset, ops->pmp_softreset,
1039 pmp_postreset, &link); 1028 ops->pmp_hardreset, ops->pmp_postreset, &link);
1040 if (rc) 1029 if (rc)
1041 goto link_fail; 1030 goto link_fail;
1042 1031
@@ -1132,16 +1121,8 @@ static int sata_pmp_eh_recover(struct ata_port *ap,
1132} 1121}
1133 1122
1134/** 1123/**
1135 * sata_pmp_do_eh - do standard error handling for PMP-enabled host 1124 * sata_pmp_error_handler - do standard error handling for PMP-enabled host
1136 * @ap: host port to handle error for 1125 * @ap: host port to handle error for
1137 * @prereset: prereset method (can be NULL)
1138 * @softreset: softreset method
1139 * @hardreset: hardreset method
1140 * @postreset: postreset method (can be NULL)
1141 * @pmp_prereset: PMP prereset method (can be NULL)
1142 * @pmp_softreset: PMP softreset method (can be NULL)
1143 * @pmp_hardreset: PMP hardreset method (can be NULL)
1144 * @pmp_postreset: PMP postreset method (can be NULL)
1145 * 1126 *
1146 * Perform standard error handling sequence for PMP-enabled host 1127 * Perform standard error handling sequence for PMP-enabled host
1147 * @ap. 1128 * @ap.
@@ -1149,16 +1130,10 @@ static int sata_pmp_eh_recover(struct ata_port *ap,
1149 * LOCKING: 1130 * LOCKING:
1150 * Kernel thread context (may sleep). 1131 * Kernel thread context (may sleep).
1151 */ 1132 */
1152void sata_pmp_do_eh(struct ata_port *ap, 1133void sata_pmp_error_handler(struct ata_port *ap)
1153 ata_prereset_fn_t prereset, ata_reset_fn_t softreset,
1154 ata_reset_fn_t hardreset, ata_postreset_fn_t postreset,
1155 ata_prereset_fn_t pmp_prereset, ata_reset_fn_t pmp_softreset,
1156 ata_reset_fn_t pmp_hardreset, ata_postreset_fn_t pmp_postreset)
1157{ 1134{
1158 ata_eh_autopsy(ap); 1135 ata_eh_autopsy(ap);
1159 ata_eh_report(ap); 1136 ata_eh_report(ap);
1160 sata_pmp_eh_recover(ap, prereset, softreset, hardreset, postreset, 1137 sata_pmp_eh_recover(ap);
1161 pmp_prereset, pmp_softreset, pmp_hardreset,
1162 pmp_postreset);
1163 ata_eh_finish(ap); 1138 ata_eh_finish(ap);
1164} 1139}