Message ID | 20180425130905.6385-19-chad.dupuis@cavium.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show
Return-Path: <linux-scsi-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 C4F4F6032C for <patchwork-linux-scsi@patchwork.kernel.org>; Wed, 25 Apr 2018 13:10:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B390628E00 for <patchwork-linux-scsi@patchwork.kernel.org>; Wed, 25 Apr 2018 13:10:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A845828E08; Wed, 25 Apr 2018 13:10:12 +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,DKIM_SIGNED, DKIM_VALID, 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 2858928E00 for <patchwork-linux-scsi@patchwork.kernel.org>; Wed, 25 Apr 2018 13:10:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753975AbeDYNKL (ORCPT <rfc822;patchwork-linux-scsi@patchwork.kernel.org>); Wed, 25 Apr 2018 09:10:11 -0400 Received: from mail-co1nam03on0071.outbound.protection.outlook.com ([104.47.40.71]:36427 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752829AbeDYNJ7 (ORCPT <rfc822;linux-scsi@vger.kernel.org>); Wed, 25 Apr 2018 09:09:59 -0400 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=JfrfkEJ4FWy7l3UsITYI0gPnTFcQV6BepoQUmZGcaKw=; b=lepAH3JP1u5pxd91ZcBGtgVQKNT9iZTxJ8BDNw9lZOS1bbzwWgyimfxSkvjAAqva/1SpQ5KB+AlVluK5Hu+BP1vhmgKMvMnVp/sVPK/9cxG+V6s2+1SDLjAO6kYOVgcHEWAT+Q7Q7yGEoWgDszHZ55fU3JE09KMRu05X6BhhOoc= Received: from BY2PR07CA0078.namprd07.prod.outlook.com (2a01:111:e400:7bff::31) by SN1PR07MB1517.namprd07.prod.outlook.com (2a01:111:e400:5838::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.14; Wed, 25 Apr 2018 13:09:47 +0000 Received: from BN1AFFO11FD013.protection.gbl (2a01:111:f400:7c10::117) by BY2PR07CA0078.outlook.office365.com (2a01:111:e400:7bff::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.696.13 via Frontend Transport; Wed, 25 Apr 2018 13:09:47 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; oracle.com; dkim=none (message not signed) header.d=none;oracle.com; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1AFFO11FD013.mail.protection.outlook.com (10.58.52.73) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.653.14 via Frontend Transport; Wed, 25 Apr 2018 13:09:47 +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.347.0; Wed, 25 Apr 2018 06:09:23 -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 w3PD99QG006492; Wed, 25 Apr 2018 06:09:09 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w3PD994A006491; Wed, 25 Apr 2018 06:09:09 -0700 From: Chad Dupuis <chad.dupuis@cavium.com> To: <martin.petersen@oracle.com> CC: <linux-scsi@vger.kernel.org>, <james.bottomley@hansenpartnership.com>, <QLogic-Storage-Upstream@cavium.com> Subject: [PATCH 18/21] qedf: Set the UNLOADING flag when removing a vport. Date: Wed, 25 Apr 2018 06:09:02 -0700 Message-ID: <20180425130905.6385-19-chad.dupuis@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180425130905.6385-1-chad.dupuis@cavium.com> References: <20180425130905.6385-1-chad.dupuis@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)(39860400002)(39380400002)(346002)(396003)(376002)(2980300002)(438002)(199004)(189003)(478600001)(86362001)(47776003)(6916009)(51416003)(6666003)(186003)(50226002)(76176011)(50466002)(69596002)(2906002)(575784001)(87636003)(80596001)(81166006)(81156014)(2351001)(54906003)(8676002)(48376002)(106002)(356003)(16586007)(42186006)(316002)(26005)(446003)(5660300001)(106466001)(1076002)(486006)(4326008)(72206003)(59450400001)(44832011)(11346002)(36756003)(126002)(107886003)(336012)(305945005)(2616005)(476003)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR07MB1517; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Pass; LANG:en; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD013; 1:FEF3rZKfXz6/kpzO0bUHkNnbVQGZsb5ZZgGoR0IUKVPjy2HmVPeDlgLJm8jMoM9JPgXeHqmGGGeq7ydYli/bTG80fBUy+4QnKUBpj5XIZFilL3zpjLFdnfls7sSBf2oa X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:SN1PR07MB1517; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB1517; 3:xJtKC2PEsLueo2AtKf9h7KeoLEiZyFRLqGKZ78Xh6NrzZew4XTMDWwYOT0w335OQZ66xxv8v0wIPAkRp94qAM7GV8fzptxt0sIH8/4zwOs6+4S8JFHyeKp/wAkNUOOlZVhQXHHlolLiEkhHi9wk7wK0ovXz3o9JF1CTHPHGfYBOGuThKBC/FrDG0s0IsxepD+8lgcARGDBdj0ghOPum0RaQBe8jvgScNNJx7nF93R100XThpnyVv/vROef4aD/cGgb2i2UrPKtNovuu6+qhQuD1zlTGCw+nAexEiblD50kZob9Am+uDM1z+trXcssqX2UUOf9iIzjVQbDltSDiuTz5/X1rlEp0ZbmRn55Zc9TLM=; 25:s/HE/BaLVEQdYO+vclPnXJ3wdKoro8WV2/1IVee52HRUH2/Yrs8TMqbGYu1EFvdsbQrcodpBqZzG4YeM1Jht+9ihdt5rY0oBALPbGPbHR5T6g+OMmMhL1Vy9zzoKmBNy4+tp8dwHRWW8aPNKYbKcr+Igqhk04oEOigDuK2/erY14jXa8nVRrZbOQ61tOu9N/xokNLNupqleEAHrY8NRRjvbQuR/BwnUz3+Cijr5xynN2wX8r9O3mSElfV+/fc6G4CZzLekSoBdcmk2Ug1d3hkzDPDSQ4H/ddPkLJ5MAln5bPAOUPliF8bxZQIPWYBLly1pCO1BWfq/RlTTZ7j2Z7Sg== X-MS-TrafficTypeDiagnostic: SN1PR07MB1517: X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB1517; 31:CNlpN+2k1Mx12fmAMk6wXC7vS04q9H9hJK4hPlMVrYp8R5eU6h1XFYLJXMnQTrwI2TnjgNArEVY1qQPg9FHXTBhig9QFGfoYqs30ePz61Pt5H5hC6qhXgzBZ56XpDexZUDBD2cu7/O2SlFt6kh38mWs77QUTwW6l/kQIfJFiTSWQWYJ+WMmE/bCIQFHlhdRKdCzLuSMHrUkmEOg1q0LF4VmFcr6Lk9BqyUGZ7CvhQA8=; 20:zY1YIcZGi5w2NcCjP0cPg+1N1Cd2iX3VTshe/R1oXK3CpF2D1tjj/RlUbkmsXWrjt7sHqMxAQ6dA1G+Qmz2KPSzSEt7z6xxdsTVu2XM00adWgvijhEi5piHBrrodpegz/Lj7brzvSQeXRBzOxUKXu8u8kRnjtNQ91wFZDYLyfZwKRO1WAFSPTDv0lyPkvbC2zIJjMaJqEfMtGFiC3OQvN07+WZCJDZjI+aDJmGAGwAbAzNIzMLFEdUh6Ii6usUojgHOxIjQGKOgJYbEMvzXYFKRyil03jxY1vsNMwyFnPjXNwrIO+h+8jErmHOzM6Sl4VSP4OabjTIVlGaO0D5r7mR0oJK47c5A6R6BPXc2oCcfk5myiAZrOH09CQ/uqfVko6I+tc4nHib4RLD1c+pugXUq8NOK4PRhUr5wyHRY5YpM83oqZzr60rawW6ohetw8UURXQLouBmHEIEwVk+4jy4fCNR98vuBry2X80jrVRexsJSTIKST8uJN3sFbdR71xP X-Microsoft-Antispam-PRVS: <SN1PR07MB151734808DAB9E9DD1C0B2099E8F0@SN1PR07MB1517.namprd07.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231232)(944501410)(52105095)(10201501046)(3002001)(93006095)(93004095)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:SN1PR07MB1517; BCL:0; PCL:0; RULEID:; SRVR:SN1PR07MB1517; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB1517; 4:xkpLEN3eake2jSOdjYEVBN347dglRwB6VZrnOHM6kYuhNiFocbNTi2w4RMi6zPKd847ifAKb5ztCbEcjBxdU9uL4kAseL/HYhj8X9Aqk3yyyazWR8al3xqmU6mOuxKs4IWQja/TXnNDN2xCEFeWPrUV0cb95WK0PRC0iLpD/4gweshSl+/Knq3GZp1jD8TOSe1AhgHS4+/3hjZKKJ1dwvXoMjPVs44QLDSAHQa0zvfn5KXFCANB1Zy9eXzI68EkUHkc57qVplgR9l59RwLMeiA== X-Forefront-PRVS: 06530126A4 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR07MB1517; 23:M2na7OnOsl2VAVKINpG9Ld6HJzCBl/lMRXe+ZaSzj?= =?us-ascii?Q?pfzK/5i0k3KeC5GV9UjrhDhA9l2ivF9U1FNc163M6Q1gKNGbCObBPQk+9EmY?= =?us-ascii?Q?73bNEtYgLfTq7OwgtgXw+vfOpZcZ5z8sDlMvIAMlPbp9E7xiS6Z0Q55j03CS?= =?us-ascii?Q?NMC00yK5OrGekdMrjiVD47eSAEqSFMr/8k/B9bYI9MbLXi/05dUdmNtga9Lc?= =?us-ascii?Q?5+ZsAduHwTNSsiobGPdfk80r1Ih/1BeXwbAzWQ2q0JTKB2pIsT0d85NZejJA?= =?us-ascii?Q?4UCN4TFCsIrrng5wggkkEq/LVnvlQKWqqtgszCfjn/UYP+ki/0yhROyJYR0R?= =?us-ascii?Q?k4yUIDlOcPR4nEvjN3ux/n93JfiFulqn42cYPCoK8EvpMNTYfNpVu9y76xsP?= =?us-ascii?Q?7+C2aHLqXVzLO5d8x7e8cBC350ObBzYINjGRSzngx/QQfgbQdWFknmb9QNZd?= =?us-ascii?Q?vZPG8ygznsTMtAB8egNpPC0MwTmBqMP/zAuFrj4FPJoeIastgrl9BWwmFadW?= =?us-ascii?Q?pdfprQ6teBaUknqbj/lM6xtto3SAGuOpI74SFno6YQzEwDFtj03r5bWwL+0b?= =?us-ascii?Q?yQ1asxxaJuBl1rCpLwbZq0l2fHG27uJpc+slpoQEcRpIykehWHRod3Wx8SY6?= =?us-ascii?Q?Gv8elwL7w4avOQLMw05kVe+jVjIjbw7/lLMFugVXePr33Ff3bES3TD4N17rd?= =?us-ascii?Q?H9tEF476jNpCJkZH/lRmhni9nvdVY7QJHGTXhyalPb2ic8Y516EvHI2KsxXS?= =?us-ascii?Q?tUA8ckTxTYQ4pyp/m4zzDfTySGMKAzp0lREnRfB08aSCFCxEVHUSO7jbvB+C?= =?us-ascii?Q?foNZZGSsKInmejWEwXKYnAtlq/CO9vbqmASToEo0/12wt66fBOkiu4rd0YId?= =?us-ascii?Q?9ewCAk/0E67DYCHoRYXh4XD7xUBROhTsZkdSX6H6Yl/y8Ggb4ANjL/FGhPP3?= =?us-ascii?Q?4H2jWWup7MTZ4BP+YspkfIUWSAI78cmNEdxc2QM1S9Eo5EIwc6N7LVNF/Vff?= =?us-ascii?Q?8ErXb72Li5BcyXR1KmbXp/Lht3XsF/sI40USkJexeCEyRyC3/jSRQSw9LtgU?= =?us-ascii?Q?4lRx5yWHoUm57TBEUHy2rO6lO3I++qYicTzFbM6IAaiKZ3iDNEYVp3ffaFg/?= =?us-ascii?Q?NQ/qVtwwAmgqQjHIwoVf3gsl09iOzX716YoxOgzjDhRAWeF8MEjlP/EuqctK?= =?us-ascii?Q?4kx7gUUWyG4y9mpquJPisvwqgO+QgivGrUw?= X-Microsoft-Antispam-Message-Info: IQMpNlNZzLz0Z7bBGYarnF5fo6tZApCJxhlDnZHbJ+dfzfuamXV9Swl776KE8LnWKqIkVS3UiVeD60hr9ovuUYcfeuXZyd/lObz7zFXawMXFfkgFOAJU2MZ8/SfqO5VIEkrFJKntNEx0LaMLuBtpRiR6sgo0c3FXjwisCqNCo+RhxIbM8nBIPCcjCE8dzQPN X-Microsoft-Exchange-Diagnostics: 1; SN1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3j/qHNooedsGb1srC3 X-MS-Office365-Filtering-Correlation-Id: dd6dd91c-45a1-4618-fd94-08d5aaadd257 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2018 13:09:47.4407 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dd6dd91c-45a1-4618-fd94-08d5aaadd257 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: SN1PR07MB1517 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: <linux-scsi.vger.kernel.org> X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 31fc64b23566..59bcb7916441 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -1677,6 +1677,15 @@ static int qedf_vport_destroy(struct fc_vport *vport) struct Scsi_Host *shost = vport_to_shost(vport); struct fc_lport *n_port = shost_priv(shost); struct fc_lport *vn_port = vport->dd_data; + struct qedf_ctx *qedf = lport_priv(vn_port); + + if (!qedf) { + QEDF_ERR(NULL, "qedf is NULL.\n"); + goto out; + } + + /* Set unloading bit on vport qedf_ctx to prevent more I/O */ + set_bit(QEDF_UNLOADING, &qedf->flags); mutex_lock(&n_port->lp_mutex); list_del(&vn_port->list); @@ -1703,6 +1712,7 @@ static int qedf_vport_destroy(struct fc_vport *vport) if (vn_port->host) scsi_host_put(vn_port->host); +out: return 0; }
Similar to what we do when we remove a PCI function, set the QEDF_UNLOADING flag to prevent any requests from being queued while a vport is being deleted. This prevents any requests from getting stuck in limbo when the vport is unloaded or deleted. Fixes the crash: PID: 106676 TASK: ffff9a436aa90000 CPU: 12 COMMAND: "multipathd" #0 [ffff9a43567d3550] machine_kexec+522 at ffffffffaca60b2a #1 [ffff9a43567d35b0] __crash_kexec+114 at ffffffffacb13512 #2 [ffff9a43567d3680] crash_kexec+48 at ffffffffacb13600 #3 [ffff9a43567d3698] oops_end+168 at ffffffffad117768 #4 [ffff9a43567d36c0] no_context+645 at ffffffffad106f52 #5 [ffff9a43567d3710] __bad_area_nosemaphore+116 at ffffffffad106fe9 #6 [ffff9a43567d3760] bad_area+70 at ffffffffad107379 #7 [ffff9a43567d3788] __do_page_fault+1247 at ffffffffad11a8cf #8 [ffff9a43567d37f0] do_page_fault+53 at ffffffffad11a915 #9 [ffff9a43567d3820] page_fault+40 at ffffffffad116768 [exception RIP: qedf_init_task+61] RIP: ffffffffc0e13c2d RSP: ffff9a43567d38d0 RFLAGS: 00010046 RAX: 0000000000000000 RBX: ffffbe920472c738 RCX: ffff9a434fa0e3e8 RDX: ffff9a434f695280 RSI: ffffbe920472c738 RDI: ffff9a43aa359c80 RBP: ffff9a43567d3950 R8: 0000000000000c15 R9: ffff9a3fb09b9880 R10: ffff9a434fa0e3e8 R11: ffff9a43567d35ce R12: 0000000000000000 R13: ffff9a434f695280 R14: ffff9a43aa359c80 R15: ffff9a3fb9e005c0 ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> --- drivers/scsi/qedf/qedf_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+)