From patchwork Wed Jul 24 22:08:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 11057677 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B2E80746 for ; Wed, 24 Jul 2019 22:08:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EBB928905 for ; Wed, 24 Jul 2019 22:08:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9107F2890B; Wed, 24 Jul 2019 22:08:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 247BA28905 for ; Wed, 24 Jul 2019 22:08:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727041AbfGXWIQ (ORCPT ); Wed, 24 Jul 2019 18:08:16 -0400 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:16724 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726470AbfGXWIQ (ORCPT ); Wed, 24 Jul 2019 18:08:16 -0400 Authentication-Results: esa2.microchip.iphmx.com; dkim=none (message not signed) header.i=none; spf=Pass smtp.mailfrom=don.brace@microsemi.com; spf=None smtp.helo=postmaster@smtp.microsemi.com Received-SPF: Pass (esa2.microchip.iphmx.com: domain of don.brace@microsemi.com designates 208.19.99.222 as permitted sender) identity=mailfrom; client-ip=208.19.99.222; receiver=esa2.microchip.iphmx.com; envelope-from="don.brace@microsemi.com"; x-sender="don.brace@microsemi.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:208.19.100.20 ip4:208.19.100.21 ip4:208.19.100.22 ip4:208.19.100.23 ip4:208.19.99.221 ip4:208.19.99.222 ip4:208.19.99.223 ip4:208.19.99.225 -all" Received-SPF: None (esa2.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@smtp.microsemi.com) identity=helo; client-ip=208.19.99.222; receiver=esa2.microchip.iphmx.com; envelope-from="don.brace@microsemi.com"; x-sender="postmaster@smtp.microsemi.com"; x-conformance=spf_only X-Ironport-Dmarc-Check-Result: validskip IronPort-SDR: Qft8pi1sf/Bo6CAIFzosyZ8iiv0RppNkL4gBEuzkXwWushR78Ofdvp8xeba0kfzvaeYZDsaGT0 CjTQAq/myOdnK+JkTiVZpEy0En+8DTfoF0b/2xf80QgeNufk+KzOm8YTbzFRInOJHE44CxRilB wpsT2JwgSq2WfIu9h51GxxdeMc+BnzwySX6k/r1qRe5ldjWinz+CwA2y48X8cwpHxKbsMcBTEW uvD4U5Q6xf7ibStsh0vhUHu3LqYCUKF9CQTZ2ECNtbVkZkZO5V1b6CGnQxMCJQG9GnP+vQsAVf eVA= X-IronPort-AV: E=Sophos;i="5.64,304,1559545200"; d="scan'208";a="42631815" Received: from unknown (HELO smtp.microsemi.com) ([208.19.99.222]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 24 Jul 2019 15:08:08 -0700 Received: from AUSMBX3.microsemi.net (10.201.34.33) by AUSMBX2.microsemi.net (10.201.34.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 24 Jul 2019 17:08:07 -0500 Received: from AUSMBX3.microsemi.net (10.201.34.33) by AUSMBX3.microsemi.net (10.201.34.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 24 Jul 2019 17:08:06 -0500 Received: from [127.0.1.1] (10.238.32.34) by ausmbx3.microsemi.net (10.201.34.33) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Wed, 24 Jul 2019 17:08:06 -0500 Subject: [PATCH 1/2] hpsa: correct scsi command status issue after reset From: Don Brace To: , , , , , , , , , , , CC: Date: Wed, 24 Jul 2019 17:08:06 -0500 Message-ID: <156400608632.14150.13988565041074356860.stgit@brunhilda> In-Reply-To: <156400599822.14150.10317539253759491318.stgit@brunhilda> References: <156400599822.14150.10317539253759491318.stgit@brunhilda> User-Agent: StGit/0.19 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Reviewed-by: Bader Ali - Saleh Reviewed-by: Scott Teel Reviewed-by: Scott Benesh Reviewed-by: Kevin Barnett Signed-off-by: Don Brace --- drivers/scsi/hpsa.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 43a6b5350775..89e71ebc5964 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -2334,6 +2334,8 @@ static int handle_ioaccel_mode2_error(struct ctlr_info *h, case IOACCEL2_SERV_RESPONSE_COMPLETE: switch (c2->error_data.status) { case IOACCEL2_STATUS_SR_TASK_COMP_GOOD: + if (cmd) + cmd->result = 0; break; case IOACCEL2_STATUS_SR_TASK_COMP_CHK_COND: cmd->result |= SAM_STAT_CHECK_CONDITION; @@ -2483,8 +2485,10 @@ static void process_ioaccel2_completion(struct ctlr_info *h, /* check for good status */ if (likely(c2->error_data.serv_response == 0 && - c2->error_data.status == 0)) + c2->error_data.status == 0)) { + cmd->result = 0; return hpsa_cmd_free_and_done(h, c, cmd); + } /* * Any RAID offload error results in retry which will use @@ -5653,6 +5657,12 @@ static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd) if (c == NULL) return SCSI_MLQUEUE_DEVICE_BUSY; + /* + * This is necessary because the SML doesn't zero out this field during + * error recovery. + */ + cmd->result = 0; + /* * Call alternate submit routine for I/O accelerated commands. * Retries always go down the normal I/O path.