From patchwork Wed Apr 25 13:08:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dupuis, Chad" X-Patchwork-Id: 10363153 Return-Path: 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 B23B96032C for ; Wed, 25 Apr 2018 13:09:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1E1328DF1 for ; Wed, 25 Apr 2018 13:09:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 961D028DFA; Wed, 25 Apr 2018 13:09:16 +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 B411328DF1 for ; Wed, 25 Apr 2018 13:09:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752985AbeDYNJP (ORCPT ); Wed, 25 Apr 2018 09:09:15 -0400 Received: from mail-bn3nam01on0061.outbound.protection.outlook.com ([104.47.33.61]:3104 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751705AbeDYNJM (ORCPT ); Wed, 25 Apr 2018 09:09:12 -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=fj6oppDzbukyuCU/ZzXPlE0AbVnmv8/fvCCYnQpo9Ws=; b=j7gGRO9YGxBv+Zt7vF74/y4ytvyHja7KqUgFcRVZbOq8FY7gxkat7u7LYejcr6ziuvF5zxM4ZZXd8fpmUYtm+5ffqqXeOKG/pqz4owmOuimQ9YsjvcNGVRKzQ0JUBCOKJKDb823offq9RSudObMCjLf3ebH5VWTDsWYY+WDeJrQ= Received: from BY2PR07CA0025.namprd07.prod.outlook.com (2a01:111:e400:7bff::20) by MWHPR07MB3182.namprd07.prod.outlook.com (2603:10b6:300:e1::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Wed, 25 Apr 2018 13:09:10 +0000 Received: from BN1AFFO11FD013.protection.gbl (2a01:111:f400:7c10::137) by BY2PR07CA0025.outlook.office365.com (2a01:111:e400:7bff::20) 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:10 +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:10 +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: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 w3PD96Ks006424; Wed, 25 Apr 2018 06:09:06 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w3PD96Kv006423; Wed, 25 Apr 2018 06:09:06 -0700 From: Chad Dupuis To: CC: , , Subject: [PATCH 01/21] qedf: Synchronize rport restarts when multiple ELS commands time out. Date: Wed, 25 Apr 2018 06:08:45 -0700 Message-ID: <20180425130905.6385-2-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 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39850400004)(376002)(39380400002)(396003)(346002)(2980300002)(438002)(51234002)(189003)(199004)(87636003)(446003)(2351001)(476003)(45080400002)(336012)(16586007)(478600001)(72206003)(107886003)(2616005)(47776003)(1076002)(316002)(186003)(6666003)(42186006)(106002)(126002)(305945005)(6916009)(26005)(54906003)(5660300001)(11346002)(76176011)(59450400001)(575784001)(86362001)(50466002)(106466001)(486006)(8676002)(48376002)(81166006)(36756003)(4326008)(356003)(81156014)(51416003)(50226002)(44832011)(69596002)(2906002)(8936002)(80596001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3182; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Pass; LANG:en; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD013; 1:JZw5JpVxrJ0nZPANZ2trMifDztLX250KEuaZ9n1TGQLPSd6uslKrqccJjEu8R7J8iqtabBLV9IS63UC/HQ1NIWBJGFzjJa4T2EcWpqdFIXtfJoOvGmM7WVdX9fvQUkWY X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:MWHPR07MB3182; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3182; 3:H37va6e9qfSqCHxh4CGeHcbAkH0WE9CgbiZpUwOOVXwTWxeREu31xXcVdRhj/oKrALW4izvSwsPwVYvbcPqj+rLR41a5OVkEb/ZMWZQq53HNIapFPVmsXEbGfl2I0aCh+fAJkgkI4bPdWOtW6Ghj+B3TsZ3C3lIKfOw8mL7WTXHG+oa8F8csHbEuJXYgf0nzajYP1k3Kd+BAS/0ap8uf/4dqBKeLkKyK3H7D5VW8UkOAJmQ7ARLbj916qGDpe+YJWP++CjM1b0H34+rx5wfE8YUHI6e/9yc81/+VeDqIS7/40T9Iodho8WrKKzLp4dH1r3hf/IdNh2JdENSFxs6XC/PJ9NceOREcxo0SObuk3Xs=; 25:szqnv4Q36J6TCp22vE1xK2gZrXlNR8fNYR9Nar6IrXJuw5JV4lqZO6tkGGCtMgxVP543DmjacYiXVThDqKnAIatr4A0UYt3Q4dRmxh3LDmLjH3LSe/xC8grX/vknI7cQAI+esIyIODBiYLESaHFT9mY0U8ooR+oUMrUt4tJ9Fvb42dHVFSrAXxR2SjQ6ZAdNWNrIi1JQ0GIu2/zGYF26T7gbIASrgo8DhNsxyXYzsNPJvv5wBO9DkfNEqw/bBpydkbeZdkgmgYLPLCQo1QYGtx0vmqNdTMwee1wKINoHB42H24czdbdhuBBJLpjfe2exqdq0oikVYy9g/g1EYpdayQ== X-MS-TrafficTypeDiagnostic: MWHPR07MB3182: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3182; 31:1UyzGXeblGuFi6jDEO9gDKeu6YvjeMR5NVAshFJrldP4PkrC81UR/eOl4d5JPDf0AeK0QTMUwHxp79Nak4jMp5nGVwysw3ZCdeNiwJ7vfhkgz3rOVQAt556QCou1fzpjMVhyrWNRmmY8UiVFe8HQgj7q8pg6yRWKMrX/8ccZwKfAw6n2HAVubMJoP+hvOJqV+BGslI6VqKbX6GbMnnTF6Bja7WYf9Euv3l4KUJHwnmQ=; 20:31MU8mPS4fNqwVLw0RhPuavfE4ecHEOMQ7g/usTNeg9dQ9FQ+zu/1+cDMjklqjwVvLxrA+igwED5+AUb42EdGBYY0ELMURn3N9Sasm8CaY89DXsKadSaYFoyp6w88AfgDRmZvydfypJbxjSYwgyM/JnNdwVDlkB/WE0U3MHZsiJpvI2jn/6cimYvg+MSrfx0FTpsqNP6r5QVHBIIyDQLHUwuyTsXtGy8mc5UjR8qdmROTIeR6AeFIt5PKY2DCt37Vm+q1Sx8JbtAlILHNceYccqDziaEYtF2a2mkqlI7l5VfIYLkEMcWUGGcC5Z81jAWkhfIN1zmPk9NWfQILX9gUeUXfFlXuEvnmsZkIO88lTYAD4Ug6STV8crp+HRt7EkFTTHX2g8CDhoRm1tsuTFLUsTH5T1bWdYAHYvg2JA0F+IqqJ23YKXx0+mCqVLDCnFWAgNEIk0LUaa6Im8AlgKdLSai8Pw+QJhv0VUeTHgLYs/VH1+TbyEd0NHZRw8Mns5p X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231232)(944501410)(52105095)(93006095)(93004095)(3002001)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:MWHPR07MB3182; BCL:0; PCL:0; RULEID:; SRVR:MWHPR07MB3182; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3182; 4:5j5k5TJoi7dPSFXym967YcucGRPeTrLGWtXLoikv98JyhAzZRJCCYGmA0oQQMYQ0+8IRkPLTtbyjRRn/RlRNy/kYBASIi5EVeUbohrzK2/4e4uM34lV6cL1nPBEBdFCpvFRCEcQdus/gP1yYVEeRFZ9TxNYGbrUozjNVCUHNT5Swytbvi91ke+NNChfTKF2kjrM+JGRClX4j0ko3Tb7gMkFeJq423EmW2PfKtbWv8SrxAcJxdJ2QMZ6kh7mZmJypmZyHgWQQ6cAxX4Cc9IgaPg== X-Forefront-PRVS: 06530126A4 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR07MB3182; 23:kUV9dJ9xrkZVPTiCIDSWjDlAOCROE5nW7Nk/PyC+0?= =?us-ascii?Q?6EG85SHTAKEfTg2qUtqh9M5A14tXg7+/Fw2oL9uDcTR8Z4/bSpqtkSQvO1De?= =?us-ascii?Q?x/g7sBkzBgS0i4YLO1ZtwrMtzondmpbbDMDUhtxTyPBBsTrUfPtKi87pLqK6?= =?us-ascii?Q?Ag2Pjik5xrU8Py7JNj9Yl23NfHbn8xZ3DS2bcqO6jKwwxCICFmKNjZ7pOpn8?= =?us-ascii?Q?0tOnjSXOUV9kN9zbYdEnXgFno+L2lRD4Wh+XpRwoFv79P07J0dP7ym073x7W?= =?us-ascii?Q?NxymP6cz5Cg2gQd3Sp48wUA/GH32giBrSI2wtnBoMpuXMyAlIiVVK6kbFnef?= =?us-ascii?Q?l4RyGvBeaGdq3N/lRpwppy4DGpc74KSLLKekghCHtWkk9qAmCDRY7Dw0+oG6?= =?us-ascii?Q?potZEBcC+tAi3HskMGa4MlGZKj6NhrnC+Wirl5ATgNjZt0iWNnNfQPTzbXfC?= =?us-ascii?Q?t6yNT6HOIBHUjwLWADhjptmNLQ2q3zZEPBrRr3SCEAdRr5L/5HYe0hDDrgS1?= =?us-ascii?Q?cGGooa2qFMEPFxc40HlZo0Sh+tG9GWxuk02+btoj8Sw6nr2TQdIm6kC1Qvf8?= =?us-ascii?Q?3Kk5RPMj1Jyd0QEPFPfOx7Zr9cKh/TgTq8sVMre9Dfxyy+/R5B/YGh3AXsoS?= =?us-ascii?Q?g7gjtIz0KfSwRJ3TkhTMljr2OzNor1RKo7WH88C7JW80Iv54ZjwIfeu1dBx5?= =?us-ascii?Q?fhise+ekL6YYMZAM2riQECfHc4CQfsYWeM396RCYb9ZdWTIznWbnvrH4KJPT?= =?us-ascii?Q?oNVsYSmGhBuM/RsnHJlfn1fZRYJ7Jijn/y/zAiePyMo2WVg9INHAbAxn2Xwf?= =?us-ascii?Q?viHM1bnttyCP0QZRSEFWgj7+VHK/SlA/YpBuzAAkOZPvEpWvV2CSe9Wjgvvd?= =?us-ascii?Q?IkoKzATcykFisjYrRzHlmmh7IOVIC60MLmG9YjtZSPrkPEs6eOzFCPbYiVRt?= =?us-ascii?Q?IM9doJmCsAE43IZhteWUwXPsCw80hSY33A9hUXx3cwE3h7+biiA3TbmDlNaP?= =?us-ascii?Q?Y8IkupOjZGIW+Bc4x+eKCYRpt7uMpKcluINaMPXuKqWr29Zs8ZA+2VlVpe49?= =?us-ascii?Q?/0DIbbX3wHqYQBydQu7TSUmByzVbpsRFqPwiBwy3YHSPRGl1VbGHvDUxzNs7?= =?us-ascii?Q?3SEKwG9GQVmhAX5J/5gdQPhmWvJ9j58ItEXZvYZeXNzIa7GKJqkNi5pVeKSN?= =?us-ascii?Q?6h1P4ra4CqGVb9YoV5JZm6YtK4S1AmIGW4jn4q6wNa6sJNdW8vNahmRyCBlR?= =?us-ascii?Q?LT/m1Iebi8AJ1T73gKLbjPFgqKVOMaVKJW78FJT?= X-Microsoft-Antispam-Message-Info: LGnPlyrPzfZbskakoWogcJOMPCvwSKPAXhQfeRVohncJxg70IXk97p9ZETDt251FuJwmun1kBzGL+cyf+EU8DCu2XeCDHQfhJg6N7Hm09QxBJXZ/+uuG1J61rOpOCdJ6XGXLUzctIw/kQr+HO7xdoVktcmpw9mTN2kVUJwXuaDjc9/6thgpwvytotcDyHpueMQ8VxKO7TDruxw7E1mGwEg== X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3182; 6:MPxE3u9OCgw+mNG1WvnnTbf5kHTPfpuIW4O+Mvw/rTDe9prZwgPri4YdkLBrQwWx87aFmLWol4pqS39+s6qd2WLW1Wo7RaW7OOeCjbrNWFKhI6e4jrMVn7uwELy/C87Bm0AYMuPuI+64gznB5RSr9UCckBQZlGJOf1j54XN0kgLmHiarwVk0gytf8EAOLuse0YhbkrHcwRz+Y/FQyG5yLfl1xLx7kVycSmNc3R64BYsivtkKo5LSLAUSbuw4zuf/xalo5RwaLk23mxIFphGxCqPsIZkX+J6O7S7XCsN/2dq6jbNFm7NkadCJFT6JPFmwhHxotq4LAuZWZ/g4NTxhBbb3KvyaAD7+ZsN4ORI279Ky9x6AIk+dQmr5nee6zjkc/M+LqFiJ3+wHjUzDIliR822gXl/XBCNiVZY8qg5Acf9C1ZjDcQoLNzzosYjdO7Ga0Omx2Wfk1Qy4bAGelD2whA==; 5:b4IRoXm3PwZlwHLqbFFKo1LFaLITkJ7hkbCv77uLDVKpWBDsWL581sh4tirtsmM7Y4wcvqKwdVS8+uzTKu8a8iW0/5Rj7tFXKxXDtbrlPaIbvruFvZr8tv8r6J7kfV3nJLMvmVPf8KRJTPrhZYXF7kE8juoi30NIy6i+GDftUcY=; 24:rCPqwySpGWxJlco3pngBZDKuOq6vzEMC9Ky4GbB/Wmw4SAikJRj4eGwY86euLenZaz/eRbLY6NYgJSGDCFGCUGCssMVfdyyQVZAxKXbpnWk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3182; 7:4tYmYibTFURz8TBqFPjZ2vHXw1Trjvv8TZHLPYOGkPTgIQ1DeQmxt32Nvow7GOKZ0QEssN+XHwwXUgGa9DYZmBtySswh8lMPatWgxyUkf+nVhIPkBW63Ky+0/zwutKlKS+NBnzSFxXuec+XJK2GRB2RM4uIDbKJU/J/bnliZ6ZJw4MxfTrPy5fZy1QswNhYb3DqjsSj44iePjUF/gwn5CTD77x1jtjH1Ig72IfgtB9g2zilYa8V0IiVtxOsfTVdL X-MS-Office365-Filtering-Correlation-Id: 5876df6e-3bbb-406e-cc8d-08d5aaadbc17 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2018 13:09:10.1101 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5876df6e-3bbb-406e-cc8d-08d5aaadbc17 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: MWHPR07MB3182 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 If multiple ELS commands time out, such as aborts, they could all try to restart the same rport and the same time. This could mean multiple multiple processes trying to clean up any outstanding commands or trying to upload the same port. Add a new flag (QEDF_RPORT_IN_RESET) and check other fcport state flags before trying to reset the port. Fixes the crash: [17501.824701] ------------[ cut here ]------------ [17501.824733] kernel BUG at include/asm-generic/dma-mapping-common.h:65! [17501.824760] invalid opcode: 0000 [#1] SMP [17501.824781] Modules linked in: xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ipt_REJECT nf_reject_ipv4 tun bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter ses enclosure dm_service_time vfat fat sb_edac edac_core intel_powerclamp coretemp intel_rapl iosf_mbi kvm_intel kvm irqbypass joydev btrfs hpilo raid6_pq iTCO_wdt iTCO_vendor_support xor hpwdt ipmi_ssif sg crc32_pclmul ghash_clmulni_intel aesni_intel lrw gf128mul ioatdma lpc_ich glue_helper ablk_helper i2c_i801 shpchp cryptd ipmi_si pcspkr acpi_power_meter ipmi_devintf pcc_cpufreq dca wmi ipmi_msghandler dm_multipath nfsd auth_rpcgss nfs_acl lockd grace sunrpc ip_tables xfs libcrc32c sr_mod cdrom sd_mod [17501.825119] crc_t10dif crct10dif_generic mgag200 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm qedf(OE) drm libfcoe ahci qedi(OE) crct10dif_pclmul libfc libahci uio crct10dif_common crc32c_intel libiscsi libata scsi_transport_iscsi scsi_transport_fc tg3 qede(OE) scsi_tgt hpsa qed(OE) i2c_core ptp scsi_transport_sas pps_core iscsi_boot_sysfs dm_mirror dm_region_hash dm_log dm_mod [17501.825292] CPU: 8 PID: 10531 Comm: kworker/u96:1 Tainted: G OE ------------ 3.10.0-693.el7.x86_64 #1 [17501.825330] Hardware name: HP ProLiant DL380 Gen9/ProLiant DL380 Gen9, BIOS P89 06/02/2016 [17501.825372] Workqueue: fc_rport_eq fc_rport_work [libfc] [17501.825395] task: ffff88101bca8000 ti: ffff881025278000 task.ti: ffff881025278000 [17501.825424] RIP: 0010:[] [] qedf_unmap_sg_list.isra.15+0x89/0x90 [qedf] [17501.825471] RSP: 0018:ffff88102527bb98 EFLAGS: 00010212 [17501.825493] RAX: ffff8800224eac00 RBX: ffffc9000cd05210 RCX: 0000000000001000 [17501.825520] RDX: 000000007e655e40 RSI: 0000000000001000 RDI: ffff88107fe3b098 [17501.826683] RBP: ffff88102527bba0 R08: ffffffff81a13200 R09: 0000000000000286 [17501.827747] R10: 0000000000000004 R11: 0000000000000005 R12: ffffc9000cd051b8 [17501.828804] R13: ffff881037640c28 R14: 0000000000000007 R15: ffffc9000cd05200 [17501.829850] FS: 0000000000000000(0000) GS:ffff88103fa00000(0000) knlGS:0000000000000000 [17501.830910] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [17501.831966] CR2: 00007f9b94005f38 CR3: 00000000019f2000 CR4: 00000000003407e0 [17501.833027] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [17501.834087] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [17501.835142] Stack: [17501.836201] ffff881033ddbb80 ffff88102527bc30 ffffffffc042f834 0000000000002710 [17501.837264] ffff88102527bbd0 ffffffff8133d9dd ffffc9000cd052a0 ffff88102527bc30 [17501.838325] ffffffff816a9c65 0000000000000001 ffff88101bca8000 ffffffff810c4810 [17501.839388] Call Trace: [17501.840446] [] qedf_scsi_done+0x54/0x1d0 [qedf] [17501.841504] [] ? list_del+0xd/0x30 [17501.842537] [] ? wait_for_completion_timeout+0x125/0x140 [17501.843560] [] ? wake_up_state+0x20/0x20 [17501.844577] [] qedf_initiate_cleanup+0x2e1/0x310 [qedf] [17501.845587] [] qedf_flush_active_ios+0x10e/0x260 [qedf] [17501.846612] [] qedf_cleanup_fcport+0x5f/0x370 [qedf] [17501.847613] [] qedf_rport_event_handler+0x398/0x950 [qedf] [17501.848602] [] ? dequeue_entity+0x11c/0x5d0 [17501.849581] [] ? __internal_add_timer+0xab/0x130 [17501.850555] [] ? dequeue_task_fair+0x41e/0x660 [17501.851528] [] fc_rport_work+0xf4/0x6c0 [libfc] [17501.852490] [] process_one_work+0x17a/0x440 [17501.853446] [] worker_thread+0x126/0x3c0 Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf.h | 1 + drivers/scsi/qedf/qedf_els.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/scsi/qedf/qedf.h b/drivers/scsi/qedf/qedf.h index c105a2e48ac1..996bd791783d 100644 --- a/drivers/scsi/qedf/qedf.h +++ b/drivers/scsi/qedf/qedf.h @@ -180,6 +180,7 @@ struct qedf_rport { spinlock_t rport_lock; #define QEDF_RPORT_SESSION_READY 1 #define QEDF_RPORT_UPLOADING_CONNECTION 2 +#define QEDF_RPORT_IN_RESET 3 unsigned long flags; unsigned long retry_delay_timestamp; struct fc_rport *rport; diff --git a/drivers/scsi/qedf/qedf_els.c b/drivers/scsi/qedf/qedf_els.c index aa22b11436ba..7024a2154ed1 100644 --- a/drivers/scsi/qedf/qedf_els.c +++ b/drivers/scsi/qedf/qedf_els.c @@ -322,6 +322,17 @@ void qedf_restart_rport(struct qedf_rport *fcport) if (!fcport) return; + if (test_bit(QEDF_RPORT_IN_RESET, &fcport->flags) || + !test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags) || + test_bit(QEDF_RPORT_UPLOADING_CONNECTION, &fcport->flags)) { + QEDF_ERR(&(fcport->qedf->dbg_ctx), "fcport %p already in reset or not offloaded.\n", + fcport); + return; + } + + /* Set that we are now in reset */ + set_bit(QEDF_RPORT_IN_RESET, &fcport->flags); + rdata = fcport->rdata; if (rdata) { lport = fcport->qedf->lport; @@ -334,6 +345,7 @@ void qedf_restart_rport(struct qedf_rport *fcport) if (rdata) fc_rport_login(rdata); } + clear_bit(QEDF_RPORT_IN_RESET, &fcport->flags); } static void qedf_l2_els_compl(struct qedf_els_cb_arg *cb_arg)