From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:37:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BD07358A; Wed, 9 Oct 2013 19:37:42 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A9DDF2029; Wed, 9 Oct 2013 19:37:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99Jbg7H081886; Wed, 9 Oct 2013 19:37:42 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JbgxT081883; Wed, 9 Oct 2013 19:37:42 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201310091937.r99JbgxT081883@svn.freebsd.org> From: Jim Harris Date: Wed, 9 Oct 2013 19:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256231 - head/sys/dev/isci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Oct 2013 19:37:42 -0000 Author: jimharris Date: Wed Oct 9 19:37:41 2013 New Revision: 256231 URL: http://svnweb.freebsd.org/changeset/base/256231 Log: 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 Modified: head/sys/dev/isci/isci_io_request.c head/sys/dev/isci/isci_sysctl.c head/sys/dev/isci/isci_task_request.c Modified: head/sys/dev/isci/isci_io_request.c ============================================================================== --- head/sys/dev/isci/isci_io_request.c Wed Oct 9 19:34:11 2013 (r256230) +++ head/sys/dev/isci/isci_io_request.c Wed Oct 9 19:37:41 2013 (r256231) @@ -153,11 +153,16 @@ isci_io_request_complete(SCI_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]); Modified: head/sys/dev/isci/isci_sysctl.c ============================================================================== --- head/sys/dev/isci/isci_sysctl.c Wed Oct 9 19:34:11 2013 (r256230) +++ head/sys/dev/isci/isci_sysctl.c Wed Oct 9 19:37:41 2013 (r256231) @@ -193,6 +193,35 @@ isci_sysctl_start_phy(SYSCTL_HANDLER_ARG 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_ 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"); } Modified: head/sys/dev/isci/isci_task_request.c ============================================================================== --- head/sys/dev/isci/isci_task_request.c Wed Oct 9 19:34:11 2013 (r256230) +++ head/sys/dev/isci/isci_task_request.c Wed Oct 9 19:37:41 2013 (r256231) @@ -194,11 +194,20 @@ isci_task_request_complete(SCI_CONTROLLE 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: