Message ID | 1486064558-365-12-git-send-email-himanshu.madhani@cavium.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Return-Path: <target-devel-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 390B060236 for <patchwork-target-devel@patchwork.kernel.org>; Thu, 2 Feb 2017 19:45:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C5A028497 for <patchwork-target-devel@patchwork.kernel.org>; Thu, 2 Feb 2017 19:45:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 211592849D; Thu, 2 Feb 2017 19:45:08 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 9F7022849C for <patchwork-target-devel@patchwork.kernel.org>; Thu, 2 Feb 2017 19:45:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751648AbdBBTpD (ORCPT <rfc822;patchwork-target-devel@patchwork.kernel.org>); Thu, 2 Feb 2017 14:45:03 -0500 Received: from mail-sn1nam02on0056.outbound.protection.outlook.com ([104.47.36.56]:17424 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751209AbdBBTot (ORCPT <rfc822;target-devel@vger.kernel.org>); Thu, 2 Feb 2017 14:44:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=US3FTv7UN5QEyxgEWOAMXdY36YtPqTyngndeDUk3Byo=; b=Jfk7o4HzGXcDYqLxhL6IBLpmAxJhs2oRzv0icQA3mPQV0Em4sbC6CEc+N7vsh10EqD4TGSYoL77A98dGCE2XfXJ9qVMmqRrI0Zpxa/LpCe6XO7G9m/ItA+ViBYlXsDSN2Dqf+3ha3NrW0YRgfFNZXQm8BmE3EHzlmPuSIaYcbPc= Received: from SN1PR0701CA0059.namprd07.prod.outlook.com (10.163.126.27) by SN1PR0701MB2093.namprd07.prod.outlook.com (10.163.132.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Thu, 2 Feb 2017 19:43:25 +0000 Received: from BY2FFO11FD003.protection.gbl (2a01:111:f400:7c0c::151) by SN1PR0701CA0059.outlook.office365.com (2a01:111:e400:52fd::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16 via Frontend Transport; Thu, 2 Feb 2017 19:43:25 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; linux-iscsi.org; dkim=none (message not signed) header.d=none; linux-iscsi.org; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BY2FFO11FD003.mail.protection.outlook.com (10.1.14.125) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.874.2 via Frontend Transport; Thu, 2 Feb 2017 19:43:24 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.309.2; Thu, 2 Feb 2017 11:43:09 -0800 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 v12Jgtgf000440; Thu, 2 Feb 2017 11:42:55 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id v12JgtGT000439; Thu, 2 Feb 2017 11:42:55 -0800 From: Himanshu Madhani <himanshu.madhani@cavium.com> To: <target-devel@vger.kernel.org>, <Bart.VanAssche@sandisk.com>, <hch@infradead.org>, <nab@linux-iscsi.org> CC: <giridhar.malavali@cavium.com>, <linux-scsi@vger.kernel.org>, <himanshu.madhani@cavium.com> Subject: [PATCH 11/15] qla2xxx: Fix inadequate lock protection for ABTS. Date: Thu, 2 Feb 2017 11:42:34 -0800 Message-ID: <1486064558-365-12-git-send-email-himanshu.madhani@cavium.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1486064558-365-1-git-send-email-himanshu.madhani@cavium.com> References: <1486064558-365-1-git-send-email-himanshu.madhani@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39450400003)(2980300002)(428002)(189002)(199003)(36756003)(47776003)(69596002)(50466002)(5003940100001)(1691005)(92566002)(105586002)(8936002)(81156014)(305945005)(50226002)(80596001)(54906002)(106466001)(48376002)(81166006)(4001430100002)(8676002)(6666003)(356003)(8656002)(4326007)(4720700003)(86362001)(626004)(107886002)(38730400001)(2950100002)(2201001)(33646002)(76176999)(2906002)(42186005)(5660300001)(189998001)(5001770100001)(50986999)(101416001)(87636001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0701MB2093; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD003; 1:ujfsUhRe41FY7xSrYOZCT//Pe3ixu1n23rwx0BxHdkPldri98k98/BseX5SOX+SH14rtlKmCBav5gkR/WdeuVQ/lDeMzv+7R7w+FnSfGgtQ/ymQMwPQZsVSPP2gm56oPexyDNfYcabMybx3wJct13JCIdx8sgZN3/JoTGoo6yJz8hewasySZj0HLCOLV9txDGcCHtkV5vdlsSZCSqd5NlSOcM9VvkQ+Ychxo7t4YQJLprdpVCMdNJ3cdIKGX9JngVpop58OgDNwvz067Pp0rApcCJ/h8G4gdiVj+N9GnDljEpJcKHR9AC1fU0pWhuqs7S4NisDKfRVoSB4mVDP5Pnq2W9CdD27ialC8KNQdaDsmwElMziuTd4lf8668ZwWUdLQAa7za4GaH2iy/9TMy/oOwGwROic0DQyyTaR2rXYrH9sLiQj9WTIZG4uLZcw9XYrYlzal5D8eZs/zbYROOpco7sbtag7mT492QbCxjbT6CQeLbxgI35RZ8pfPL5BHdK9pwujSGlXfoFv3OYbtxVzIMfPfUsX3vIf0rfV7PugPk= X-MS-Office365-Filtering-Correlation-Id: 4594327f-858e-497e-0ac3-08d44ba3c0bd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:SN1PR0701MB2093; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB2093; 3:IPkjy0dK2UnUdEYS4iNao2esbxjDKYiW3d1S22RYgYHr4g16gadKy2FxDtIFtmq3BTmAoBH6Q3u0klIeLenHre8hm2UBzWJAIpms4qqxrnJ47oDp1jPaZgubCZyTHoKAxt5EQNjb3HDY4aYneqrIxkg6DxwTqXtWnmPmjRSIed9/R4PbLPBYv0BChnYRRxBmoinTNK9sUCjpOlXPclMmQIitJ+7AU6fdmeUC+HvtdQ559PKChqVkFttq2BdPtJQLEK16TW8bI5NWYCEAOaBybngb1yjdYCSQVWlGjhDwNgRtrJxJI2BbE1TZgJ7XCvAzLqHWwM5EaFN/qnFXYLWo3Wedd5xq/lZptoep9oOAXy5AsgurSfh5ZAnC+UUv7haZ; 25:BVGceZgI4W7iRJfUIZ5HSm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8oNCGFWnlL+6BSsv1MuOrDbxBGHRZjtqqMa3xvsTyNebzZLD93yVpUAnO55PilWl1qpD+uB3uSHs4CH5S4eoTmDzz7arFP37diBMx8ZgMfrVz6LgZX4PyI25lcO1IqU9TK2HIEQDGiSXJvXd9/+X4sSfBcpfbaexqEYbIso4ce03SOIDLO/XLkvuIzYsD23TSuUK4VykQRLRjKVuE7pqLY+2 X-Microsoft-Antispam-PRVS: <SN1PR0701MB209315352E0C1DB091075A65F54C0@SN1PR0701MB2093.namprd07.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(13023025)(13017025)(13015025)(13018025)(13024025)(3002001)(10201501046)(6041248)(20161123555025)(20161123558025)(20161123564025)(20161123562025)(20161123560025)(6072148); SRVR:SN1PR0701MB2093; BCL:0; PCL:0; RULEID:; SRVR:SN1PR0701MB2093; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB2093; 4:ULkOHJ7gMso0/c9+Y5yCBQrVyK+MQtPMcDzuOndFucmnY0l7Du96CjgqhJ05IFIKGxjGczjT30bzAsC09UL/+rSKw7gsILP0F/vy+tyFcGfRPOjHL1L2bc5/nMTr1jLxrEl4QcCGYV7Sqe4GF8/9+FNEX4EHo6ymw9LtZTwL3bkJHQZQKfJIPKM9KWrm3M2qJSgJnCv1xGKuPxM6J+FUA2TXHyhIHQX2M63e8IKYkEUIr5ODFavKiBT1Jl6rEQiLXgyh/wtsBy6axnaQiYeqlYjXE9AJ4BSWjq/0lxZv7Eo2NmfJbF9wiuJJB+0kfXLTIkKRljbmm5SuDlZMZdhLKKwDgWNosB89zi3/FmE07CdJqTnoj92Yuk49C0BUMvJC9NwVtx/m+GO+91HinSk00+NhwyzTPXdvpc28WezNMO9menidL0KekYAj2bLpch9HVlMsp+eytdTzliXvPMxdC+Y3xEfVVYkPqJgMoi9Ffevg8dWquowMtFwcfLp9eu/gnkk4PdIbdBl0QF+qam5viD6UWy8WEkRB66348DvYQAvwleZD9MjAlOpgo8FTL/2ysJB1CIH+ImPIsKFik3cdG0EMYSZdsZKa5HTGu9xDcVmSOD5MeTafBYU7FpWOV7dwXpMycYcOW/6aL9bYOsjGxIJfZADi5zs03Bb5I/U1H24D0CvYPvf1e1IEDeyWsp/wyEvlFfhANpV2dQUPraYROw== X-Forefront-PRVS: 02065A9E77 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0701MB2093; 23:F75/JwZ9/cU7rzKiqtmJCW51j3dB+KG9nEdGJvJ?= =?us-ascii?Q?2pLUh/xQY9Em5r+TYjT/dDlcdPq7xKz3c3mTocue7QxPlG0+vwvIQArjkYnp?= =?us-ascii?Q?5feeDi+97smJpmNGZsvOOjNaLvTxhxoEnvY2/YCyi7PEjaQ5Tw1HwgHqwBa6?= =?us-ascii?Q?i1TImRTSOATi2Lvd45hYx19qpjqamHbMuv9ptHRousOP+7gyjRUB0E0S42Ie?= =?us-ascii?Q?BK6DlRi4QVd5+lS8xsluo1o4vts+gHmIhF8oEMo7Rn2ZnNsa6Jc3bwg8p4YP?= =?us-ascii?Q?bJAVFloo8RNA90Elvre31xxyBtvI7EUVE4snQc9xmimoEnJMtUVrJss3dLMe?= =?us-ascii?Q?j5X+EtPhH2gEdF+unn5LeWqutyMm5Jdy7Oyy5LeU4UYPK0STRO3QYgfspbWb?= =?us-ascii?Q?tB/uPULEkibArdR+TZefvq36/uzO7vAPlu/pWNUf8NM7nyRKfhLG4FefBfVY?= =?us-ascii?Q?zLcCECw0lEtNwgvqv/fF7crgwkDcLUd+v3acVq+Pz6SE7JyNVKhoCGZLbrOW?= =?us-ascii?Q?0iZaGTAyJW/Tmtlkc0LtllQy11QJFNufNgYCZpVvSpQN1CqaQ4X+aNWVKXvW?= =?us-ascii?Q?NpCNljnGaxtYuB2C7jDVPUsywc0n4s9o2AR9Ane2jGEdx7xt8D+FCT5jxGjJ?= =?us-ascii?Q?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U73iuBFStl/mQYgTzp5IUoBBpSNSmjLLI6BZzsJ1e51CQ==; 5:LVN2dMDlRyDz01g44kWA/1iBAROBKHX0aWT7NMzY1tL1W0yKezXsP25Uo3/ho2vd2F/EkzTkwh/2IJ/hLVkAhDSpXbG6vI85gsM4mhAXgcP7DFqGhlAavy32mlzx/1qpEmTEj6HjyvIdNy0FmwJHBGvS86kQZnrzMlpq4QxXD04=; 24:FkDpBNmaPUuMyHNG/6QhSr950LKjXvlRcSIuZxwm889haGN64ewfY5SJVlgtgtwJN8uNjiGSR4Uy2ktXsKSFwF0DTLmD5fUGX4BwPVhLwd4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB2093; 7:j+DJyicwlG5c1Nu82seRE1MfR0Ypl7KmZbv6ghaZxi3HNgVd0eNSvn3suDNZqz6jJU9yZObDwu1ALAeYrdikWJilNGoEUXiptO6guAcKVBr4pBlKufyg4u/jUz7DAv23CB5vvP7zj+g9whyFmK/uHX0Rkk4AlYLX4Ja0hZNKCNL6lbJwgXU8YxWoJOt7hF8Z+RWURs+wIL7bl0lfdXOP2n9wU+V5BtE6fct6HJqFc0XfWh/960n6cHH0yYdGtld2au4vijIb9YPRKrlaIX/viThO2RN0x7k7tuegDZJsmXsr2PRaSK1mGnkrGKVc+AJBTB6CScyqqZOAuhPpngk8VLEHFYLPOXia2viSCSo0eCcuTADeVVasB2fLesJYU3ec7O+U7XN/R9fndLodTASHYCydv3uHxmPgkcIbLQG8VkTeTuvEsd+98CfN3p94HW/rI87my1q0L4xY40xBpyrPrqRCuYETjY2RBTamIV8FA74yLklN3UXdB03/knVzDZ4rsUIhLXcvrtaSd9it+t+AEA== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2017 19:43:24.9421 (UTC) X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0701MB2093 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: <target-devel.vger.kernel.org> X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 1bd4eff..6351132 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -128,6 +128,9 @@ static void qlt_send_term_imm_notif(struct scsi_qla_host *vha, static struct fc_port *qlt_create_sess(struct scsi_qla_host *vha, fc_port_t *fcport, bool local); void qlt_unreg_sess(struct fc_port *sess); +static void qlt_24xx_handle_abts(struct scsi_qla_host *, + struct abts_recv_from_24xx *); + /* * Global Variables */ @@ -403,6 +406,8 @@ static bool qlt_24xx_atio_pkt_all_vps(struct scsi_qla_host *vha, (struct abts_recv_from_24xx *)atio; struct scsi_qla_host *host = qlt_find_host_by_vp_idx(vha, entry->vp_index); + unsigned long flags; + if (unlikely(!host)) { ql_dbg(ql_dbg_tgt, vha, 0xffff, "qla_target(%d): Response pkt (ABTS_RECV_24XX) " @@ -410,9 +415,12 @@ static bool qlt_24xx_atio_pkt_all_vps(struct scsi_qla_host *vha, vha->vp_idx, entry->vp_index); break; } - qlt_response_pkt(host, (response_t *)atio); + if (!ha_locked) + spin_lock_irqsave(&host->hw->hardware_lock, flags); + qlt_24xx_handle_abts(host, (struct abts_recv_from_24xx *)atio); + if (!ha_locked) + spin_unlock_irqrestore(&host->hw->hardware_lock, flags); break; - } /* case PUREX_IOCB_TYPE: ql2xmvasynctoatio */