Permalink
Browse files

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
  • Loading branch information...
1 parent cc9e8d9 commit 40003e03dd1bc3afb919f8348506188ae16f597a @jimharris jimharris committed Oct 9, 2013
Showing with 52 additions and 4 deletions.
  1. +7 −2 sys/dev/isci/isci_io_request.c
  2. +34 −0 sys/dev/isci/isci_sysctl.c
  3. +11 −2 sys/dev/isci/isci_task_request.c
@@ -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]);
View
@@ -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:
+ retry_task = TRUE;
+ isci_log_message(0, "ISCI",
+ "task failure (invalid state) - retrying\n");
+ break;
+
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 (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:

0 comments on commit 40003e0

Please sign in to comment.