Improve logging around some of the isci(4) reset and recovery paths.
Sponsored by: Intel Discussed with: scottl Approved by: re (marius) MFC after: 1 week
This commit is contained in:
parent
d43c9ec118
commit
cce45f0b07
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=256231
@ -153,11 +153,16 @@ isci_io_request_complete(SCI_CONTROLLER_HANDLE_T scif_controller,
|
||||
|
||||
case SCI_IO_FAILURE_REMOTE_DEVICE_RESET_REQUIRED:
|
||||
isci_remote_device_reset(isci_remote_device, NULL);
|
||||
ccb->ccb_h.status |= CAM_REQ_TERMIO;
|
||||
isci_log_message(0, "ISCI",
|
||||
"isci: bus=%x target=%x lun=%x cdb[0]=%x remote device reset required\n",
|
||||
ccb->ccb_h.path_id, ccb->ccb_h.target_id,
|
||||
ccb->ccb_h.target_lun, ccb->csio.cdb_io.cdb_bytes[0]);
|
||||
break;
|
||||
|
||||
/* drop through */
|
||||
case SCI_IO_FAILURE_TERMINATED:
|
||||
ccb->ccb_h.status |= CAM_REQ_TERMIO;
|
||||
isci_log_message(1, "ISCI",
|
||||
isci_log_message(0, "ISCI",
|
||||
"isci: bus=%x target=%x lun=%x cdb[0]=%x terminated\n",
|
||||
ccb->ccb_h.path_id, ccb->ccb_h.target_id,
|
||||
ccb->ccb_h.target_lun, ccb->csio.cdb_io.cdb_bytes[0]);
|
||||
|
@ -193,6 +193,35 @@ isci_sysctl_start_phy(SYSCTL_HANDLER_ARGS)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
isci_sysctl_log_frozen_lun_masks(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
struct isci_softc *isci = (struct isci_softc *)arg1;
|
||||
struct ISCI_REMOTE_DEVICE *device;
|
||||
int32_t log_frozen_devices = 0;
|
||||
int error, i, j;
|
||||
|
||||
error = sysctl_handle_int(oidp, &log_frozen_devices, 0, req);
|
||||
|
||||
if (error || log_frozen_devices == 0)
|
||||
return (error);
|
||||
|
||||
for (i = 0; i < isci->controller_count; i++) {
|
||||
for (j = 0; j < SCI_MAX_REMOTE_DEVICES; j++) {
|
||||
device = isci->controllers[i].remote_device[j];
|
||||
|
||||
if (device == NULL)
|
||||
continue;
|
||||
|
||||
device_printf(isci->device,
|
||||
"controller %d device %3d frozen_lun_mask 0x%02x\n",
|
||||
i, j, device->frozen_lun_mask);
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
void isci_sysctl_initialize(struct isci_softc *isci)
|
||||
{
|
||||
struct sysctl_ctx_list *sysctl_ctx = device_get_sysctl_ctx(isci->device);
|
||||
@ -225,5 +254,10 @@ void isci_sysctl_initialize(struct isci_softc *isci)
|
||||
SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
|
||||
"start_phy", CTLTYPE_UINT| CTLFLAG_RW, isci, 0,
|
||||
isci_sysctl_start_phy, "IU", "Start PHY on a controller");
|
||||
|
||||
SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
|
||||
"log_frozen_lun_masks", CTLTYPE_UINT| CTLFLAG_RW, isci, 0,
|
||||
isci_sysctl_log_frozen_lun_masks, "IU",
|
||||
"Log frozen lun masks to kernel log");
|
||||
}
|
||||
|
||||
|
@ -194,11 +194,20 @@ isci_task_request_complete(SCI_CONTROLLER_HANDLE_T scif_controller,
|
||||
break;
|
||||
|
||||
case SCI_TASK_FAILURE_INVALID_STATE:
|
||||
case SCI_TASK_FAILURE_INSUFFICIENT_RESOURCES:
|
||||
case SCI_FAILURE_TIMEOUT:
|
||||
retry_task = TRUE;
|
||||
isci_log_message(0, "ISCI",
|
||||
"unhandled task completion code 0x%x\n", completion_status);
|
||||
"task failure (invalid state) - retrying\n");
|
||||
break;
|
||||
|
||||
case SCI_TASK_FAILURE_INSUFFICIENT_RESOURCES:
|
||||
retry_task = TRUE;
|
||||
isci_log_message(0, "ISCI",
|
||||
"task failure (insufficient resources) - retrying\n");
|
||||
break;
|
||||
|
||||
case SCI_FAILURE_TIMEOUT:
|
||||
retry_task = TRUE;
|
||||
isci_log_message(0, "ISCI", "task timeout - retrying\n");
|
||||
break;
|
||||
|
||||
case SCI_TASK_FAILURE:
|
||||
|
Loading…
Reference in New Issue
Block a user