From patchwork Fri Feb 10 08:45:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 140533 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 74E77B6EF7 for ; Fri, 10 Feb 2012 19:30:44 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758545Ab2BJIal (ORCPT ); Fri, 10 Feb 2012 03:30:41 -0500 Received: from mga02.intel.com ([134.134.136.20]:30844 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758443Ab2BJIal (ORCPT ); Fri, 10 Feb 2012 03:30:41 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 10 Feb 2012 00:30:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,352,1309762800"; d="scan'208";a="106020193" Received: from dwillia2-linux.jf.intel.com ([10.23.45.91]) by orsmga001.jf.intel.com with ESMTP; 10 Feb 2012 00:30:40 -0800 Received: from dwillia2-linux.jf.intel.com (localhost.localdomain [IPv6:::1]) by dwillia2-linux.jf.intel.com (Postfix) with ESMTP id D41C381ED4; Fri, 10 Feb 2012 00:45:35 -0800 (PST) Subject: [PATCH v8 11/13] libsas: use ->lldd_I_T_nexus_reset for ->eh_bus_reset_handler To: linux-scsi@vger.kernel.org From: Dan Williams Cc: linux-ide@vger.kernel.org, Jack Wang , Luben Tuikov , Xiangliang Yu Date: Fri, 10 Feb 2012 00:45:35 -0800 Message-ID: <20120210084535.25701.74616.stgit@dwillia2-linux.jf.intel.com> In-Reply-To: <20120210084411.25701.94502.stgit@dwillia2-linux.jf.intel.com> References: <20120210084411.25701.94502.stgit@dwillia2-linux.jf.intel.com> User-Agent: StGit/0.15-7-g9bfb-dirty MIME-Version: 1.0 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org sas_eh_bus_reset_handler() amounts to sas_phy_reset() without notification of the reset to the lldd. If this is triggered from eh-cmnd recovery there may be sas_tasks for the lldd to terminate, so ->lldd_I_T_nexus_reset is warranted. Cc: Xiangliang Yu Cc: Luben Tuikov Cc: Jack Wang Signed-off-by: Dan Williams --- drivers/scsi/libsas/sas_scsi_host.c | 19 ++++++++----------- 1 files changed, 8 insertions(+), 11 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index 82f7532..86ffd8f 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c @@ -505,25 +505,22 @@ int sas_eh_device_reset_handler(struct scsi_cmnd *cmd) return FAILED; } -/* Attempt to send a phy (bus) reset */ int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd) { - struct domain_device *dev = cmd_to_domain_dev(cmd); - struct sas_phy *phy = sas_get_local_phy(dev); - struct Scsi_Host *host = cmd->device->host; int res; + struct Scsi_Host *host = cmd->device->host; + struct domain_device *dev = cmd_to_domain_dev(cmd); + struct sas_internal *i = to_sas_internal(host->transportt); if (current != host->ehandler) return FAILED; - res = sas_phy_reset(phy, 1); - if (res) - SAS_DPRINTK("Bus reset of %s failed 0x%x\n", - kobject_name(&phy->dev.kobj), - res); - sas_put_local_phy(phy); + if (!i->dft->lldd_I_T_nexus_reset) + return FAILED; - if (res == TMF_RESP_FUNC_SUCC || res == TMF_RESP_FUNC_COMPLETE) + res = i->dft->lldd_I_T_nexus_reset(dev); + if (res == TMF_RESP_FUNC_SUCC || res == TMF_RESP_FUNC_COMPLETE || + res == -ENODEV) return SUCCESS; return FAILED;