aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWendy Xiong <wenxiong@linux.vnet.ibm.com>2014-03-12 17:08:51 -0400
committerJames Bottomley <JBottomley@Parallels.com>2014-03-19 18:04:42 -0400
commit169b9ec83f0f1cf1e0c7876b41d04d66c28f16a0 (patch)
treeca37090920c5973983645a81b10d12bb3c04a429
parent60e76b771f349bb1b50e0b382ad8bf0296a53819 (diff)
[SCSI] ipr: Format HCAM overlay ID 0x21
This patch adds formatting error overlay 0x21 to improve debug capabilities. [jejb: checkpatch fixes] Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com> Acked-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/ipr.c39
-rw-r--r--drivers/scsi/ipr.h14
2 files changed, 53 insertions, 0 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 3d7b6af98e5e..1c6a18a39e85 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -2368,6 +2368,42 @@ static void ipr_log_generic_error(struct ipr_ioa_cfg *ioa_cfg,
2368} 2368}
2369 2369
2370/** 2370/**
2371 * ipr_log_sis64_device_error - Log a cache error.
2372 * @ioa_cfg: ioa config struct
2373 * @hostrcb: hostrcb struct
2374 *
2375 * Return value:
2376 * none
2377 **/
2378static void ipr_log_sis64_device_error(struct ipr_ioa_cfg *ioa_cfg,
2379 struct ipr_hostrcb *hostrcb)
2380{
2381 struct ipr_hostrcb_type_21_error *error;
2382 char buffer[IPR_MAX_RES_PATH_LENGTH];
2383
2384 error = &hostrcb->hcam.u.error64.u.type_21_error;
2385
2386 ipr_err("-----Failing Device Information-----\n");
2387 ipr_err("World Wide Unique ID: %08X%08X%08X%08X\n",
2388 be32_to_cpu(error->wwn[0]), be32_to_cpu(error->wwn[1]),
2389 be32_to_cpu(error->wwn[2]), be32_to_cpu(error->wwn[3]));
2390 ipr_err("Device Resource Path: %s\n",
2391 __ipr_format_res_path(error->res_path,
2392 buffer, sizeof(buffer)));
2393 error->primary_problem_desc[sizeof(error->primary_problem_desc) - 1] = '\0';
2394 error->second_problem_desc[sizeof(error->second_problem_desc) - 1] = '\0';
2395 ipr_err("Primary Problem Description: %s\n", error->primary_problem_desc);
2396 ipr_err("Secondary Problem Description: %s\n", error->second_problem_desc);
2397 ipr_err("SCSI Sense Data:\n");
2398 ipr_log_hex_data(ioa_cfg, error->sense_data, sizeof(error->sense_data));
2399 ipr_err("SCSI Command Descriptor Block: \n");
2400 ipr_log_hex_data(ioa_cfg, error->cdb, sizeof(error->cdb));
2401
2402 ipr_err("Additional IOA Data:\n");
2403 ipr_log_hex_data(ioa_cfg, error->ioa_data, be32_to_cpu(error->length_of_error));
2404}
2405
2406/**
2371 * ipr_get_error - Find the specfied IOASC in the ipr_error_table. 2407 * ipr_get_error - Find the specfied IOASC in the ipr_error_table.
2372 * @ioasc: IOASC 2408 * @ioasc: IOASC
2373 * 2409 *
@@ -2468,6 +2504,9 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg,
2468 case IPR_HOST_RCB_OVERLAY_ID_20: 2504 case IPR_HOST_RCB_OVERLAY_ID_20:
2469 ipr_log_fabric_error(ioa_cfg, hostrcb); 2505 ipr_log_fabric_error(ioa_cfg, hostrcb);
2470 break; 2506 break;
2507 case IPR_HOST_RCB_OVERLAY_ID_21:
2508 ipr_log_sis64_device_error(ioa_cfg, hostrcb);
2509 break;
2471 case IPR_HOST_RCB_OVERLAY_ID_23: 2510 case IPR_HOST_RCB_OVERLAY_ID_23:
2472 ipr_log_sis64_config_error(ioa_cfg, hostrcb); 2511 ipr_log_sis64_config_error(ioa_cfg, hostrcb);
2473 break; 2512 break;
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 649d8f697147..c343afef4e19 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -899,6 +899,18 @@ struct ipr_hostrcb_type_01_error {
899 __be32 ioa_data[236]; 899 __be32 ioa_data[236];
900}__attribute__((packed, aligned (4))); 900}__attribute__((packed, aligned (4)));
901 901
902struct ipr_hostrcb_type_21_error {
903 __be32 wwn[4];
904 u8 res_path[8];
905 u8 primary_problem_desc[32];
906 u8 second_problem_desc[32];
907 __be32 sense_data[8];
908 __be32 cdb[4];
909 __be32 residual_trans_length;
910 __be32 length_of_error;
911 __be32 ioa_data[236];
912}__attribute__((packed, aligned (4)));
913
902struct ipr_hostrcb_type_02_error { 914struct ipr_hostrcb_type_02_error {
903 struct ipr_vpd ioa_vpd; 915 struct ipr_vpd ioa_vpd;
904 struct ipr_vpd cfc_vpd; 916 struct ipr_vpd cfc_vpd;
@@ -1128,6 +1140,7 @@ struct ipr_hostrcb64_error {
1128 struct ipr_hostrcb_type_ff_error type_ff_error; 1140 struct ipr_hostrcb_type_ff_error type_ff_error;
1129 struct ipr_hostrcb_type_12_error type_12_error; 1141 struct ipr_hostrcb_type_12_error type_12_error;
1130 struct ipr_hostrcb_type_17_error type_17_error; 1142 struct ipr_hostrcb_type_17_error type_17_error;
1143 struct ipr_hostrcb_type_21_error type_21_error;
1131 struct ipr_hostrcb_type_23_error type_23_error; 1144 struct ipr_hostrcb_type_23_error type_23_error;
1132 struct ipr_hostrcb_type_24_error type_24_error; 1145 struct ipr_hostrcb_type_24_error type_24_error;
1133 struct ipr_hostrcb_type_30_error type_30_error; 1146 struct ipr_hostrcb_type_30_error type_30_error;
@@ -1171,6 +1184,7 @@ struct ipr_hcam {
1171#define IPR_HOST_RCB_OVERLAY_ID_16 0x16 1184#define IPR_HOST_RCB_OVERLAY_ID_16 0x16
1172#define IPR_HOST_RCB_OVERLAY_ID_17 0x17 1185#define IPR_HOST_RCB_OVERLAY_ID_17 0x17
1173#define IPR_HOST_RCB_OVERLAY_ID_20 0x20 1186#define IPR_HOST_RCB_OVERLAY_ID_20 0x20
1187#define IPR_HOST_RCB_OVERLAY_ID_21 0x21
1174#define IPR_HOST_RCB_OVERLAY_ID_23 0x23 1188#define IPR_HOST_RCB_OVERLAY_ID_23 0x23
1175#define IPR_HOST_RCB_OVERLAY_ID_24 0x24 1189#define IPR_HOST_RCB_OVERLAY_ID_24 0x24
1176#define IPR_HOST_RCB_OVERLAY_ID_26 0x26 1190#define IPR_HOST_RCB_OVERLAY_ID_26 0x26