diff options
author | Wen Xiong <wenxiong@linux.vnet.ibm.com> | 2018-06-06 11:01:36 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-06-19 22:02:25 -0400 |
commit | 15c5a5e0761f9ace2e58097c405ab362b2e02c83 (patch) | |
tree | e92af39ec1a0614fbcdab79d3d7c656a86a17294 | |
parent | 7931cd918f35e1e7c9183f004f4b90b43f22adfd (diff) |
scsi: ipr: Format HCAM overlay ID 0x41
This patch adds formatting error overlay 0x41 to improve debug
capabilities.
Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/ipr.c | 25 | ||||
-rw-r--r-- | drivers/scsi/ipr.h | 7 |
2 files changed, 32 insertions, 0 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 0a9b8b387bd2..f796f0ec5ca9 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -2413,6 +2413,28 @@ static void ipr_log_sis64_fabric_error(struct ipr_ioa_cfg *ioa_cfg, | |||
2413 | } | 2413 | } |
2414 | 2414 | ||
2415 | /** | 2415 | /** |
2416 | * ipr_log_sis64_service_required_error - Log a sis64 service required error. | ||
2417 | * @ioa_cfg: ioa config struct | ||
2418 | * @hostrcb: hostrcb struct | ||
2419 | * | ||
2420 | * Return value: | ||
2421 | * none | ||
2422 | **/ | ||
2423 | static void ipr_log_sis64_service_required_error(struct ipr_ioa_cfg *ioa_cfg, | ||
2424 | struct ipr_hostrcb *hostrcb) | ||
2425 | { | ||
2426 | struct ipr_hostrcb_type_41_error *error; | ||
2427 | |||
2428 | error = &hostrcb->hcam.u.error64.u.type_41_error; | ||
2429 | |||
2430 | error->failure_reason[sizeof(error->failure_reason) - 1] = '\0'; | ||
2431 | ipr_err("Primary Failure Reason: %s\n", error->failure_reason); | ||
2432 | ipr_log_hex_data(ioa_cfg, error->data, | ||
2433 | be32_to_cpu(hostrcb->hcam.length) - | ||
2434 | (offsetof(struct ipr_hostrcb_error, u) + | ||
2435 | offsetof(struct ipr_hostrcb_type_41_error, data))); | ||
2436 | } | ||
2437 | /** | ||
2416 | * ipr_log_generic_error - Log an adapter error. | 2438 | * ipr_log_generic_error - Log an adapter error. |
2417 | * @ioa_cfg: ioa config struct | 2439 | * @ioa_cfg: ioa config struct |
2418 | * @hostrcb: hostrcb struct | 2440 | * @hostrcb: hostrcb struct |
@@ -2587,6 +2609,9 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg, | |||
2587 | case IPR_HOST_RCB_OVERLAY_ID_30: | 2609 | case IPR_HOST_RCB_OVERLAY_ID_30: |
2588 | ipr_log_sis64_fabric_error(ioa_cfg, hostrcb); | 2610 | ipr_log_sis64_fabric_error(ioa_cfg, hostrcb); |
2589 | break; | 2611 | break; |
2612 | case IPR_HOST_RCB_OVERLAY_ID_41: | ||
2613 | ipr_log_sis64_service_required_error(ioa_cfg, hostrcb); | ||
2614 | break; | ||
2590 | case IPR_HOST_RCB_OVERLAY_ID_1: | 2615 | case IPR_HOST_RCB_OVERLAY_ID_1: |
2591 | case IPR_HOST_RCB_OVERLAY_ID_DEFAULT: | 2616 | case IPR_HOST_RCB_OVERLAY_ID_DEFAULT: |
2592 | default: | 2617 | default: |
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h index 93570734cbfb..68afbbde54d3 100644 --- a/drivers/scsi/ipr.h +++ b/drivers/scsi/ipr.h | |||
@@ -1135,6 +1135,11 @@ struct ipr_hostrcb_type_30_error { | |||
1135 | struct ipr_hostrcb64_fabric_desc desc[1]; | 1135 | struct ipr_hostrcb64_fabric_desc desc[1]; |
1136 | }__attribute__((packed, aligned (4))); | 1136 | }__attribute__((packed, aligned (4))); |
1137 | 1137 | ||
1138 | struct ipr_hostrcb_type_41_error { | ||
1139 | u8 failure_reason[64]; | ||
1140 | __be32 data[200]; | ||
1141 | }__attribute__((packed, aligned (4))); | ||
1142 | |||
1138 | struct ipr_hostrcb_error { | 1143 | struct ipr_hostrcb_error { |
1139 | __be32 fd_ioasc; | 1144 | __be32 fd_ioasc; |
1140 | struct ipr_res_addr fd_res_addr; | 1145 | struct ipr_res_addr fd_res_addr; |
@@ -1173,6 +1178,7 @@ struct ipr_hostrcb64_error { | |||
1173 | struct ipr_hostrcb_type_23_error type_23_error; | 1178 | struct ipr_hostrcb_type_23_error type_23_error; |
1174 | struct ipr_hostrcb_type_24_error type_24_error; | 1179 | struct ipr_hostrcb_type_24_error type_24_error; |
1175 | struct ipr_hostrcb_type_30_error type_30_error; | 1180 | struct ipr_hostrcb_type_30_error type_30_error; |
1181 | struct ipr_hostrcb_type_41_error type_41_error; | ||
1176 | } u; | 1182 | } u; |
1177 | }__attribute__((packed, aligned (8))); | 1183 | }__attribute__((packed, aligned (8))); |
1178 | 1184 | ||
@@ -1218,6 +1224,7 @@ struct ipr_hcam { | |||
1218 | #define IPR_HOST_RCB_OVERLAY_ID_24 0x24 | 1224 | #define IPR_HOST_RCB_OVERLAY_ID_24 0x24 |
1219 | #define IPR_HOST_RCB_OVERLAY_ID_26 0x26 | 1225 | #define IPR_HOST_RCB_OVERLAY_ID_26 0x26 |
1220 | #define IPR_HOST_RCB_OVERLAY_ID_30 0x30 | 1226 | #define IPR_HOST_RCB_OVERLAY_ID_30 0x30 |
1227 | #define IPR_HOST_RCB_OVERLAY_ID_41 0x41 | ||
1221 | #define IPR_HOST_RCB_OVERLAY_ID_DEFAULT 0xFF | 1228 | #define IPR_HOST_RCB_OVERLAY_ID_DEFAULT 0xFF |
1222 | 1229 | ||
1223 | u8 reserved1[3]; | 1230 | u8 reserved1[3]; |