diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/ipr.c | 14 | ||||
-rw-r--r-- | drivers/scsi/ipr.h | 1 |
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 94345e79ef1e..3c32e08e71c1 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -1249,19 +1249,23 @@ static void ipr_log_array_error(struct ipr_ioa_cfg *ioa_cfg, | |||
1249 | 1249 | ||
1250 | /** | 1250 | /** |
1251 | * ipr_log_hex_data - Log additional hex IOA error data. | 1251 | * ipr_log_hex_data - Log additional hex IOA error data. |
1252 | * @ioa_cfg: ioa config struct | ||
1252 | * @data: IOA error data | 1253 | * @data: IOA error data |
1253 | * @len: data length | 1254 | * @len: data length |
1254 | * | 1255 | * |
1255 | * Return value: | 1256 | * Return value: |
1256 | * none | 1257 | * none |
1257 | **/ | 1258 | **/ |
1258 | static void ipr_log_hex_data(u32 *data, int len) | 1259 | static void ipr_log_hex_data(struct ipr_ioa_cfg *ioa_cfg, u32 *data, int len) |
1259 | { | 1260 | { |
1260 | int i; | 1261 | int i; |
1261 | 1262 | ||
1262 | if (len == 0) | 1263 | if (len == 0) |
1263 | return; | 1264 | return; |
1264 | 1265 | ||
1266 | if (ioa_cfg->log_level <= IPR_DEFAULT_LOG_LEVEL) | ||
1267 | len = min_t(int, len, IPR_DEFAULT_MAX_ERROR_DUMP); | ||
1268 | |||
1265 | for (i = 0; i < len / 4; i += 4) { | 1269 | for (i = 0; i < len / 4; i += 4) { |
1266 | ipr_err("%08X: %08X %08X %08X %08X\n", i*4, | 1270 | ipr_err("%08X: %08X %08X %08X %08X\n", i*4, |
1267 | be32_to_cpu(data[i]), | 1271 | be32_to_cpu(data[i]), |
@@ -1290,7 +1294,7 @@ static void ipr_log_enhanced_dual_ioa_error(struct ipr_ioa_cfg *ioa_cfg, | |||
1290 | ipr_err("%s\n", error->failure_reason); | 1294 | ipr_err("%s\n", error->failure_reason); |
1291 | ipr_err("Remote Adapter VPD:\n"); | 1295 | ipr_err("Remote Adapter VPD:\n"); |
1292 | ipr_log_ext_vpd(&error->vpd); | 1296 | ipr_log_ext_vpd(&error->vpd); |
1293 | ipr_log_hex_data(error->data, | 1297 | ipr_log_hex_data(ioa_cfg, error->data, |
1294 | be32_to_cpu(hostrcb->hcam.length) - | 1298 | be32_to_cpu(hostrcb->hcam.length) - |
1295 | (offsetof(struct ipr_hostrcb_error, u) + | 1299 | (offsetof(struct ipr_hostrcb_error, u) + |
1296 | offsetof(struct ipr_hostrcb_type_17_error, data))); | 1300 | offsetof(struct ipr_hostrcb_type_17_error, data))); |
@@ -1315,7 +1319,7 @@ static void ipr_log_dual_ioa_error(struct ipr_ioa_cfg *ioa_cfg, | |||
1315 | ipr_err("%s\n", error->failure_reason); | 1319 | ipr_err("%s\n", error->failure_reason); |
1316 | ipr_err("Remote Adapter VPD:\n"); | 1320 | ipr_err("Remote Adapter VPD:\n"); |
1317 | ipr_log_vpd(&error->vpd); | 1321 | ipr_log_vpd(&error->vpd); |
1318 | ipr_log_hex_data(error->data, | 1322 | ipr_log_hex_data(ioa_cfg, error->data, |
1319 | be32_to_cpu(hostrcb->hcam.length) - | 1323 | be32_to_cpu(hostrcb->hcam.length) - |
1320 | (offsetof(struct ipr_hostrcb_error, u) + | 1324 | (offsetof(struct ipr_hostrcb_error, u) + |
1321 | offsetof(struct ipr_hostrcb_type_07_error, data))); | 1325 | offsetof(struct ipr_hostrcb_type_07_error, data))); |
@@ -1531,7 +1535,7 @@ static void ipr_log_fabric_error(struct ipr_ioa_cfg *ioa_cfg, | |||
1531 | ((unsigned long)fabric + be16_to_cpu(fabric->length)); | 1535 | ((unsigned long)fabric + be16_to_cpu(fabric->length)); |
1532 | } | 1536 | } |
1533 | 1537 | ||
1534 | ipr_log_hex_data((u32 *)fabric, add_len); | 1538 | ipr_log_hex_data(ioa_cfg, (u32 *)fabric, add_len); |
1535 | } | 1539 | } |
1536 | 1540 | ||
1537 | /** | 1541 | /** |
@@ -1545,7 +1549,7 @@ static void ipr_log_fabric_error(struct ipr_ioa_cfg *ioa_cfg, | |||
1545 | static void ipr_log_generic_error(struct ipr_ioa_cfg *ioa_cfg, | 1549 | static void ipr_log_generic_error(struct ipr_ioa_cfg *ioa_cfg, |
1546 | struct ipr_hostrcb *hostrcb) | 1550 | struct ipr_hostrcb *hostrcb) |
1547 | { | 1551 | { |
1548 | ipr_log_hex_data(hostrcb->hcam.u.raw.data, | 1552 | ipr_log_hex_data(ioa_cfg, hostrcb->hcam.u.raw.data, |
1549 | be32_to_cpu(hostrcb->hcam.length)); | 1553 | be32_to_cpu(hostrcb->hcam.length)); |
1550 | } | 1554 | } |
1551 | 1555 | ||
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h index 44b15e4b6edf..397e502bd0f1 100644 --- a/drivers/scsi/ipr.h +++ b/drivers/scsi/ipr.h | |||
@@ -104,6 +104,7 @@ | |||
104 | #define IPR_IOASC_IOA_WAS_RESET 0x10000001 | 104 | #define IPR_IOASC_IOA_WAS_RESET 0x10000001 |
105 | #define IPR_IOASC_PCI_ACCESS_ERROR 0x10000002 | 105 | #define IPR_IOASC_PCI_ACCESS_ERROR 0x10000002 |
106 | 106 | ||
107 | #define IPR_DEFAULT_MAX_ERROR_DUMP 984 | ||
107 | #define IPR_NUM_LOG_HCAMS 2 | 108 | #define IPR_NUM_LOG_HCAMS 2 |
108 | #define IPR_NUM_CFG_CHG_HCAMS 2 | 109 | #define IPR_NUM_CFG_CHG_HCAMS 2 |
109 | #define IPR_NUM_HCAMS (IPR_NUM_LOG_HCAMS + IPR_NUM_CFG_CHG_HCAMS) | 110 | #define IPR_NUM_HCAMS (IPR_NUM_LOG_HCAMS + IPR_NUM_CFG_CHG_HCAMS) |