aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ipr.c
diff options
context:
space:
mode:
authorbrking@us.ibm.com <brking@us.ibm.com>2005-11-01 18:02:15 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2005-11-06 14:09:22 -0500
commitee0f05b863df0a623792eaa46703019c100be2de (patch)
tree07bb5f102447be0b4ef9babae1b5569021640155 /drivers/scsi/ipr.c
parentc8f7489251269b9c4d516c3075b902d2b067b1b3 (diff)
[SCSI] ipr: New adapter error types
Handle some new types of ipr errors that can be returned by the adapter. Signed-off-by: Brian King <brking@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/ipr.c')
-rw-r--r--drivers/scsi/ipr.c175
1 files changed, 175 insertions, 0 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index a5df245c8c2c..cca4972735be 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -936,6 +936,52 @@ static void ipr_log_vpd(struct ipr_vpd *vpd)
936} 936}
937 937
938/** 938/**
939 * ipr_log_ext_vpd - Log the passed extended VPD to the error log.
940 * @vpd: vendor/product id/sn/wwn struct
941 *
942 * Return value:
943 * none
944 **/
945static void ipr_log_ext_vpd(struct ipr_ext_vpd *vpd)
946{
947 ipr_log_vpd(&vpd->vpd);
948 ipr_err(" WWN: %08X%08X\n", be32_to_cpu(vpd->wwid[0]),
949 be32_to_cpu(vpd->wwid[1]));
950}
951
952/**
953 * ipr_log_enhanced_cache_error - Log a cache error.
954 * @ioa_cfg: ioa config struct
955 * @hostrcb: hostrcb struct
956 *
957 * Return value:
958 * none
959 **/
960static void ipr_log_enhanced_cache_error(struct ipr_ioa_cfg *ioa_cfg,
961 struct ipr_hostrcb *hostrcb)
962{
963 struct ipr_hostrcb_type_12_error *error =
964 &hostrcb->hcam.u.error.u.type_12_error;
965
966 ipr_err("-----Current Configuration-----\n");
967 ipr_err("Cache Directory Card Information:\n");
968 ipr_log_ext_vpd(&error->ioa_vpd);
969 ipr_err("Adapter Card Information:\n");
970 ipr_log_ext_vpd(&error->cfc_vpd);
971
972 ipr_err("-----Expected Configuration-----\n");
973 ipr_err("Cache Directory Card Information:\n");
974 ipr_log_ext_vpd(&error->ioa_last_attached_to_cfc_vpd);
975 ipr_err("Adapter Card Information:\n");
976 ipr_log_ext_vpd(&error->cfc_last_attached_to_ioa_vpd);
977
978 ipr_err("Additional IOA Data: %08X %08X %08X\n",
979 be32_to_cpu(error->ioa_data[0]),
980 be32_to_cpu(error->ioa_data[1]),
981 be32_to_cpu(error->ioa_data[2]));
982}
983
984/**
939 * ipr_log_cache_error - Log a cache error. 985 * ipr_log_cache_error - Log a cache error.
940 * @ioa_cfg: ioa config struct 986 * @ioa_cfg: ioa config struct
941 * @hostrcb: hostrcb struct 987 * @hostrcb: hostrcb struct
@@ -968,6 +1014,46 @@ static void ipr_log_cache_error(struct ipr_ioa_cfg *ioa_cfg,
968} 1014}
969 1015
970/** 1016/**
1017 * ipr_log_enhanced_config_error - Log a configuration error.
1018 * @ioa_cfg: ioa config struct
1019 * @hostrcb: hostrcb struct
1020 *
1021 * Return value:
1022 * none
1023 **/
1024static void ipr_log_enhanced_config_error(struct ipr_ioa_cfg *ioa_cfg,
1025 struct ipr_hostrcb *hostrcb)
1026{
1027 int errors_logged, i;
1028 struct ipr_hostrcb_device_data_entry_enhanced *dev_entry;
1029 struct ipr_hostrcb_type_13_error *error;
1030
1031 error = &hostrcb->hcam.u.error.u.type_13_error;
1032 errors_logged = be32_to_cpu(error->errors_logged);
1033
1034 ipr_err("Device Errors Detected/Logged: %d/%d\n",
1035 be32_to_cpu(error->errors_detected), errors_logged);
1036
1037 dev_entry = error->dev;
1038
1039 for (i = 0; i < errors_logged; i++, dev_entry++) {
1040 ipr_err_separator;
1041
1042 ipr_phys_res_err(ioa_cfg, dev_entry->dev_res_addr, "Device %d", i + 1);
1043 ipr_log_ext_vpd(&dev_entry->vpd);
1044
1045 ipr_err("-----New Device Information-----\n");
1046 ipr_log_ext_vpd(&dev_entry->new_vpd);
1047
1048 ipr_err("Cache Directory Card Information:\n");
1049 ipr_log_ext_vpd(&dev_entry->ioa_last_with_dev_vpd);
1050
1051 ipr_err("Adapter Card Information:\n");
1052 ipr_log_ext_vpd(&dev_entry->cfc_last_with_dev_vpd);
1053 }
1054}
1055
1056/**
971 * ipr_log_config_error - Log a configuration error. 1057 * ipr_log_config_error - Log a configuration error.
972 * @ioa_cfg: ioa config struct 1058 * @ioa_cfg: ioa config struct
973 * @hostrcb: hostrcb struct 1059 * @hostrcb: hostrcb struct
@@ -1015,6 +1101,57 @@ static void ipr_log_config_error(struct ipr_ioa_cfg *ioa_cfg,
1015} 1101}
1016 1102
1017/** 1103/**
1104 * ipr_log_enhanced_array_error - Log an array configuration error.
1105 * @ioa_cfg: ioa config struct
1106 * @hostrcb: hostrcb struct
1107 *
1108 * Return value:
1109 * none
1110 **/
1111static void ipr_log_enhanced_array_error(struct ipr_ioa_cfg *ioa_cfg,
1112 struct ipr_hostrcb *hostrcb)
1113{
1114 int i, num_entries;
1115 struct ipr_hostrcb_type_14_error *error;
1116 struct ipr_hostrcb_array_data_entry_enhanced *array_entry;
1117 const u8 zero_sn[IPR_SERIAL_NUM_LEN] = { [0 ... IPR_SERIAL_NUM_LEN-1] = '0' };
1118
1119 error = &hostrcb->hcam.u.error.u.type_14_error;
1120
1121 ipr_err_separator;
1122
1123 ipr_err("RAID %s Array Configuration: %d:%d:%d:%d\n",
1124 error->protection_level,
1125 ioa_cfg->host->host_no,
1126 error->last_func_vset_res_addr.bus,
1127 error->last_func_vset_res_addr.target,
1128 error->last_func_vset_res_addr.lun);
1129
1130 ipr_err_separator;
1131
1132 array_entry = error->array_member;
1133 num_entries = min_t(u32, be32_to_cpu(error->num_entries),
1134 sizeof(error->array_member));
1135
1136 for (i = 0; i < num_entries; i++, array_entry++) {
1137 if (!memcmp(array_entry->vpd.vpd.sn, zero_sn, IPR_SERIAL_NUM_LEN))
1138 continue;
1139
1140 if (be32_to_cpu(error->exposed_mode_adn) == i)
1141 ipr_err("Exposed Array Member %d:\n", i);
1142 else
1143 ipr_err("Array Member %d:\n", i);
1144
1145 ipr_log_ext_vpd(&array_entry->vpd);
1146 ipr_phys_res_err(ioa_cfg, array_entry->dev_res_addr, "Current Location");
1147 ipr_phys_res_err(ioa_cfg, array_entry->expected_dev_res_addr,
1148 "Expected Location");
1149
1150 ipr_err_separator;
1151 }
1152}
1153
1154/**
1018 * ipr_log_array_error - Log an array configuration error. 1155 * ipr_log_array_error - Log an array configuration error.
1019 * @ioa_cfg: ioa config struct 1156 * @ioa_cfg: ioa config struct
1020 * @hostrcb: hostrcb struct 1157 * @hostrcb: hostrcb struct
@@ -1094,6 +1231,31 @@ static void ipr_log_hex_data(u32 *data, int len)
1094} 1231}
1095 1232
1096/** 1233/**
1234 * ipr_log_enhanced_dual_ioa_error - Log an enhanced dual adapter error.
1235 * @ioa_cfg: ioa config struct
1236 * @hostrcb: hostrcb struct
1237 *
1238 * Return value:
1239 * none
1240 **/
1241static void ipr_log_enhanced_dual_ioa_error(struct ipr_ioa_cfg *ioa_cfg,
1242 struct ipr_hostrcb *hostrcb)
1243{
1244 struct ipr_hostrcb_type_17_error *error;
1245
1246 error = &hostrcb->hcam.u.error.u.type_17_error;
1247 error->failure_reason[sizeof(error->failure_reason) - 1] = '\0';
1248
1249 ipr_err("%s\n", error->failure_reason);
1250 ipr_err("Remote Adapter VPD:\n");
1251 ipr_log_ext_vpd(&error->vpd);
1252 ipr_log_hex_data(error->data,
1253 be32_to_cpu(hostrcb->hcam.length) -
1254 (offsetof(struct ipr_hostrcb_error, u) +
1255 offsetof(struct ipr_hostrcb_type_17_error, data)));
1256}
1257
1258/**
1097 * ipr_log_dual_ioa_error - Log a dual adapter error. 1259 * ipr_log_dual_ioa_error - Log a dual adapter error.
1098 * @ioa_cfg: ioa config struct 1260 * @ioa_cfg: ioa config struct
1099 * @hostrcb: hostrcb struct 1261 * @hostrcb: hostrcb struct
@@ -1221,6 +1383,19 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg,
1221 case IPR_HOST_RCB_OVERLAY_ID_7: 1383 case IPR_HOST_RCB_OVERLAY_ID_7:
1222 ipr_log_dual_ioa_error(ioa_cfg, hostrcb); 1384 ipr_log_dual_ioa_error(ioa_cfg, hostrcb);
1223 break; 1385 break;
1386 case IPR_HOST_RCB_OVERLAY_ID_12:
1387 ipr_log_enhanced_cache_error(ioa_cfg, hostrcb);
1388 break;
1389 case IPR_HOST_RCB_OVERLAY_ID_13:
1390 ipr_log_enhanced_config_error(ioa_cfg, hostrcb);
1391 break;
1392 case IPR_HOST_RCB_OVERLAY_ID_14:
1393 case IPR_HOST_RCB_OVERLAY_ID_16:
1394 ipr_log_enhanced_array_error(ioa_cfg, hostrcb);
1395 break;
1396 case IPR_HOST_RCB_OVERLAY_ID_17:
1397 ipr_log_enhanced_dual_ioa_error(ioa_cfg, hostrcb);
1398 break;
1224 case IPR_HOST_RCB_OVERLAY_ID_1: 1399 case IPR_HOST_RCB_OVERLAY_ID_1:
1225 case IPR_HOST_RCB_OVERLAY_ID_DEFAULT: 1400 case IPR_HOST_RCB_OVERLAY_ID_DEFAULT:
1226 default: 1401 default: