From patchwork Thu Mar 28 17:09:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10875449 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 3A8F7186E for ; Thu, 28 Mar 2019 17:11:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1805E28E1A for ; Thu, 28 Mar 2019 17:11:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C90C28CD0; Thu, 28 Mar 2019 17:11:34 +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 F306F28EB3 for ; Thu, 28 Mar 2019 17:11:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727572AbfC1RLc (ORCPT ); Thu, 28 Mar 2019 13:11:32 -0400 Received: from mail-eopbgr760074.outbound.protection.outlook.com ([40.107.76.74]:61798 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725948AbfC1RLc (ORCPT ); Thu, 28 Mar 2019 13:11:32 -0400 Received: from DM6PR07CA0071.namprd07.prod.outlook.com (2603:10b6:5:74::48) by DM6PR07MB5371.namprd07.prod.outlook.com (2603:10b6:5:44::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.18; Thu, 28 Mar 2019 17:11:29 +0000 Received: from BY2NAM05FT037.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::206) by DM6PR07CA0071.outlook.office365.com (2603:10b6:5:74::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1750.16 via Frontend Transport; Thu, 28 Mar 2019 17:11:29 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by BY2NAM05FT037.mail.protection.outlook.com (10.152.100.174) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1771.6 via Frontend Transport; Thu, 28 Mar 2019 17:11:29 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Thu, 28 Mar 2019 10:10:20 -0700 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id x2SHAJ7E026464; Thu, 28 Mar 2019 10:10:19 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x2SHAJcQ026463; Thu, 28 Mar 2019 10:10:19 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 01/15] qla2xxx: Set the SCSI command result before calling the command done Date: Thu, 28 Mar 2019 10:09:58 -0700 Message-ID: <20190328171012.26425-2-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190328171012.26425-1-hmadhani@marvell.com> References: <20190328171012.26425-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131982666896076334;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(346002)(136003)(396003)(376002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(97736004)(80596001)(305945005)(48376002)(105606002)(85426001)(69596002)(2616005)(4326008)(336012)(26005)(126002)(53936002)(87636003)(26826003)(51416003)(486006)(106466001)(11346002)(476003)(8936002)(36906005)(47776003)(8676002)(2906002)(50226002)(68736007)(42186006)(81166006)(356004)(6666004)(36756003)(316002)(16586007)(498600001)(4744005)(54906003)(110136005)(5660300002)(86362001)(446003)(50466002)(1076003)(81156014)(76176011);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR07MB5371;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a55d94cb-4cd9-4db9-f8dc-08d6b3a06b4f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600127)(711020)(4605104)(2017052603328);SRVR:DM6PR07MB5371; X-MS-TrafficTypeDiagnostic: DM6PR07MB5371: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0990C54589 X-Microsoft-Antispam-Message-Info: beBFqM8FKADDey4YqSk6kH5yoDBBQ0cU3v3Uke3K2zBsdlB0uT8vcmOWl8xPNb/cMPsaU3tF900hRo0xFBYKbBo/DNcijteOfCbbnE1KkN9vWL9ZpJ97pQ75uLs70LxhFKEtrkZEwNak3w40qY3Xogkxz9MDNW8+UDCrIEkMokTNbIEgPj23aWESmYn7JYGA+CZpoxSKPL037fG4zMhq5pp+oiwDJS103CGrdotuyd3BaIUFU5ACfgbIhe9PFD5j8ZphKzXA5X45fYydmAZQ6VXUWhm4hC9nG+P+obggaUBJcnuUvofaZFEA8YGx5FJ/ag3xHAw1mU5atkIuHkPPRLoyFaU+hGW6RGL8aIXYe5l+q3h+MG6VpagzJG6MGNIdklQC465bBodp28c9dkhj69RLNfT4LY5Vl/QqtSJ+vv8= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2019 17:11:29.3524 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a55d94cb-4cd9-4db9-f8dc-08d6b3a06b4f X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB5371 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 From: Giridhar Malavali This patch sets SCSI cmd->result before scsi_done() is called. Signed-off-by: Giridhar Malavali Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_os.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index a58a2885fb70..34db83b6f932 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -765,8 +765,6 @@ qla2x00_sp_compl(void *ptr, int res) srb_t *sp = ptr; struct scsi_cmnd *cmd = GET_CMD_SP(sp); - cmd->result = res; - if (atomic_read(&sp->ref_count) == 0) { ql_dbg(ql_dbg_io, sp->vha, 0x3015, "SP reference-count to ZERO -- sp=%p cmd=%p.\n", @@ -779,6 +777,7 @@ qla2x00_sp_compl(void *ptr, int res) return; sp->free(sp); + cmd->result = res; cmd->scsi_done(cmd); }