From patchwork Mon Jul 2 20:01:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10502321 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 0E09E60284 for ; Mon, 2 Jul 2018 20:02:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDB3628B13 for ; Mon, 2 Jul 2018 20:02:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E009328B53; Mon, 2 Jul 2018 20:02:17 +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 4BD4028B13 for ; Mon, 2 Jul 2018 20:02:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752258AbeGBUCQ (ORCPT ); Mon, 2 Jul 2018 16:02:16 -0400 Received: from mail-sn1nam02on0086.outbound.protection.outlook.com ([104.47.36.86]:27470 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752274AbeGBUCP (ORCPT ); Mon, 2 Jul 2018 16:02:15 -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:X-MS-Exchange-SenderADCheck; bh=rwS73Z4kLcaPKXfPag/sU54C9uVVP0kjK20pDyCpRu0=; b=Q3AqVwF+0sJHp2X5oboQzQPMxBxL0OcUNre8CeTSa59rz3oytQB8amxnzfGjaG6X7EyBJLAjwzv0hrhZdmebUo75oMO1enEiANTJ34nxGu35mWUlb4s/0UH8vG2V7k7aBVKoUrINPHdzwzLPPSo57SL5HMPx4XltPWNw742dzmI= Received: from DM5PR07CA0097.namprd07.prod.outlook.com (2603:10b6:4:ae::26) by DM2PR07MB1466.namprd07.prod.outlook.com (2a01:111:e400:50c3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.20; Mon, 2 Jul 2018 20:02:13 +0000 Received: from BY2NAM05FT021.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::204) by DM5PR07CA0097.outlook.office365.com (2603:10b6:4:ae::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.906.25 via Frontend Transport; Mon, 2 Jul 2018 20:02:12 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; 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 BY2NAM05FT021.mail.protection.outlook.com (10.152.100.158) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.930.2 via Frontend Transport; Mon, 2 Jul 2018 20:02:11 +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; Mon, 2 Jul 2018 13:02:01 -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 w62K20fg005231; Mon, 2 Jul 2018 13:02:00 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w62K20lN005230; Mon, 2 Jul 2018 13:02:00 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 2/3] qla2xxx: Fix kernel crash due to late workqueue allocation Date: Mon, 2 Jul 2018 13:01:59 -0700 Message-ID: <20180702200200.5188-3-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180702200200.5188-1-himanshu.madhani@cavium.com> References: <20180702200200.5188-1-himanshu.madhani@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)(136003)(39860400002)(376002)(396003)(346002)(2980300002)(438002)(189003)(199004)(51234002)(44832011)(5660300001)(50226002)(36756003)(47776003)(1076002)(14444005)(4326008)(446003)(86362001)(486006)(2906002)(72206003)(336012)(11346002)(478600001)(126002)(2616005)(476003)(575784001)(87636003)(45080400002)(81166006)(81156014)(8676002)(106466001)(305945005)(356003)(26005)(69596002)(80596001)(50466002)(48376002)(8936002)(76176011)(42186006)(51416003)(316002)(54906003)(106002)(16586007)(110136005)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR07MB1466; 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; BY2NAM05FT021; 1:ANlQY9ZNPL9U6Mc2qs0TVO79tpTsuDQIaI2rl1+yzJmOlmSVQiOLQp9lOoSHqFVJQlH2Y/Uli0gr+oZGo+BgOK8WVZ7TTXGgLJBDwrNumjn3YBPmFMdxBjmZsKMC7O5Y X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 10a11bd7-d0ec-4dcd-7ec7-08d5e056b35d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060); SRVR:DM2PR07MB1466; X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB1466; 3:AN/mDw3LYkXHDvmnv018ca071oMPODaEA/fFSkJzWEuI6SnM18XOFIC373Wwkz+9kDkJ5xzD8xE4Z2OWvX5L+DaML1XyvvzJ2LxKvEWm3YGJs0tb4rhaHr7zDZ2oZAiafdQM5NzmUU6Y6Ksk+AQoXH9vo0fJJ/H7oPoi19NcUKxLxXTBvzXIRrnPRqp8OkHXzs6lGFwFdlf2ZvvyLw+b2lOcYEczVx2CMmxIo045doFn3pPTQqsPHQTt5QUbLoq94hZOQaSBiQxIyb7zBnI/Edlh+ZOEJ3yfPRtm2Lpv2o+vHVycN2QtAUsAVh36vVZGdOw00pBkXNUxuXAvgoqrSSxFAE9yj6W8qdxtVEz0LJY=; 25:eeilN5qz3LE9A3We0IidSAOu7y+Al56Aral1LxXzKehAFpCcj1iO3Ljfy5f2z679rTc17RUsfKvKaLqv08qlA34MY7AD9wKyrv2IO5XtT09mlj6rM+1acHR+ZIEgFkclU34WSWhBrVOgfmUvubcLGTeuObO5J5qJ1am7sJ9sfWLrnzGOyo4Jb0e0FdiM2QXAEdonzbWfI81mGtkA7uTsYPDD87lmv1kAocMldIBoc9KT7TUrtF7BG+SXE3TyQVsTn9zBzZBszCIjo58RoFuGyf2fnRWSxgNnxw4vt7m+wMizUpaJbL+Sup3H0Qyj944HFhjshMAdLUXZ9OjYgWno/A== X-MS-TrafficTypeDiagnostic: DM2PR07MB1466: X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB1466; 31:M1324q0XFNZDcgv1Hkwo8sc6LCdMzle3vywti/oQ6m1amlJTxdwU/0BKjF/DMdvakpJiOsPIDq/43Ft0ZldKjQcSufgLekLEArDahnoeny1txQ+Ur+Wm61ibym4AFCAC0srqb6YZZjRpGWhecYxyX1gWPcipPCOf5iUkfgS7x8CPk6ZiGQZWRWt44I+vrPIV94+zZClh62eL8ecMZV70vvnsbC9g9ZS4l86tqmSvaJQ=; 20:BAvOtuODYiX+hMhiiosX8btcHmaXXUrLrChAg6VUZ8sEyzL5V3DYymOZP5VpJCODEphiVdsWTM0IxuQjLPEpfyaZWkciHDCVVWpG+o8zas9F/Xi38OeBuiihXw9lvYoqic8dpT62wRfEGr1q798KzmUqHg3d2YgIUBmR1P9VJWyTyxzrx8mjzyRkulBnR+xD+ko7t+kLPJgBNZOsbTYFNzi+R+hvoaDbhSXa4xWpalh13Cxyp/oRVMwFKLAN+cmidbBRHadrAAcMTKQjU6ltbJoMomB4RuaSgTKBFcjJk415okqGBi/gfS34IcEkwAwpMXzipZPHinruRRPc++X1YFu/Jop/7dsL+u92c+ucMMzM2R0MnqwxiUQIToLP3njLE6PJG4XaCmmsP1nefwImTRdyTV9wGtTk7qSTziowv8QJLQsOlB7xgiaZLBB2yPGvEoNiTN6jA0nGsrBSG7qvF3UulGdeRMyU0/VE8xf0fzUVGeKUn72fvz9F4POkoWR6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231254)(944501410)(52105095)(10201501046)(93006095)(93004095)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DM2PR07MB1466; BCL:0; PCL:0; RULEID:; SRVR:DM2PR07MB1466; X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB1466; 4:JntAwjEhdHB5zi8tVH0qaopfqruX4R26i/F/URNdxnk1qQRai1oRG7lsDH7UQ8RE3WhH17cGDMELZUIY293/fyskX5z8ocMnN3D6x+7guYAnb4BDctNbqHt0g7QAs1wS0G26REUpbp9BLKa1t9g9xWF6xxu1FZ2GpeCXo0GRwIYTxI18DLbgSnzo6KWLQ/G2O/QaTd3zjm7XokNZKRBirxS9GTBDrLhsH3iPmBxH1NxBVSFXAUKooqa+jhB0nfXZvaYXU0Rcc44ZfhuXrlcbCl+HDqGlrBladW6lQO38GmGA/ieoxpiNM3Iik6t+mh+o X-Forefront-PRVS: 07215D0470 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR07MB1466; 23:imnsivJYqMecf8EnmD+wzq2wibL8RrQblyB97Zx+v?= =?us-ascii?Q?+xjQrSyxVK0wnNUqVw6I/IS1M9KbuMrOHEJWxztEOaxu/ze1x1K9F2FZTwoI?= =?us-ascii?Q?Q/oSf0BBICKMKuNhosyQcR5c/jBte3kZ5F6N8k9CPtZEDCjPt0VVESyeEfjJ?= =?us-ascii?Q?5/3VYvQSDEHGoD1+IdsoPj+qR962gye+uyWMSRyLJG47iqDkZA4+9zqqck7G?= =?us-ascii?Q?QwyV+KdrqRFLKw1fgQEk2+P52XuKjVXU7Om8vhtsupb/nvTBU8fiH0Ul9iaL?= =?us-ascii?Q?Ns9iP2swoD7xoCpIZuK/QGC/M/gzJFY5Js2NQShZypPN0S/f/aGSTWAYnoet?= =?us-ascii?Q?LFsks6juaaAsyIl8WBnHjC5d9ZNR+6rNWlleRTvTrGF8kKJFaqX35zN2MV/u?= =?us-ascii?Q?qy+cJTuKtEECgDbtqlhCepfu06WE9UdB56SHZfpapBYO49wPt7Pb4tTYKYQr?= =?us-ascii?Q?BEwQ+ddV07D0/q8zG5wm071ajs1darfgf2O4h5H6Ksv8UXk2fc97SyP4i9jZ?= =?us-ascii?Q?OQNZ9EIEFYXevvVQM1McpL+kGATMiXizzNwdq4Vk2NDyOjXiqbhSgElKRnmJ?= =?us-ascii?Q?uTyAIs1OdDUh5SyxKboiKhjuskdQhn5wKkkVtVcCJfiE0Jyj+jHrBJymY/s4?= =?us-ascii?Q?4R2twlImmVtAwvED2D78xJrniSlDW49UPi+qNiRmvZlWR+k22OWEns0b5bRQ?= =?us-ascii?Q?qBC66Dc+XtLmSgTt4NZmMiZwF1ORlrrPUL5PEK9rHOA2d2kPce7qHdNsuvDv?= =?us-ascii?Q?Nn3EY+r7QdIJmi0qOwfoOa/VAUkHaEKmib50L7WAr6/iXtOyDIPJyRUkAmqv?= =?us-ascii?Q?w1iHftuEP+AXk2nE24Idn69+ZvfOV2B2DYP58udX9Y+vwvLfSMkfk/RLTBYE?= =?us-ascii?Q?92ykwbSlBeaNiJl9Ydm0kJM5rqyX8rFX/A4+f5xTKcY4fOcqYLyjoX+wysae?= =?us-ascii?Q?jwMpK1mqQlXSd8xW+4m4jRvR51eUqFHyZSLPaxlLlVCGhUW+BiQwXBAa/qsZ?= =?us-ascii?Q?ApWCN6u/dHBledcournM1OxM1tiHwgbqucB0YE7JStWvuJaa4mlXz5ELFWxi?= =?us-ascii?Q?I9eIDs7E7alDld0XK8X5TlNIV1tQlyZq04k6+aAH4LvfYStxiC3hMdBg1C/w?= =?us-ascii?Q?QEbChj5NaczT+GrcJjj6uw7knGiMdoJi+T4qQg7ZyDBsIB2H+jVKluEHWjxQ?= =?us-ascii?Q?RuMajzXo9M1dbo=3D?= X-Microsoft-Antispam-Message-Info: RM0doWKD1GW48H3FqFWSJ1XzVZVfzl2GAx1cei52eY3QLObYJyxQC9/nYz8WRqXY2ZTvkXw5zQcxHYEFLeRSobG4/s9EMpMFoZm8uK8R4we0/6tFwT9HmH3DDOdheSK92GJEhhRPWZAooLgHh4m3mlZ1bhHaDYwylNUI8SpZg7reU+0cpKLtt8AkW/tv0lc07/ioOWvMR0U4evxLxHe3mFvzDvj7TOGsfq1gZsqH9TkXX2vCr92RleUT0LzzYsa7IceuF/kfoiu0ZPoTZemo0lKZNGBj3xq8Cq92VcbPArpMUwJVmZYDXCazHdllHKTLLAUUv19bMQkpVzagxYVvmus9KWjvwQDVziKjzwjroVs= X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB1466; 6:YplDtxSjZHhuoVTnbuQoLNxWZSkuKj1qAAMpnLH77QtJoTg2PpHwhXcs6zFUrg6uiiAtPefh4kaU/8PzUntc5j9ZIW1r1zj1m5NZcpWEPVCnNR0JcmFFSKpPQapcxB7716Qp1iq6QxXeGmIXOKFs47DL5JSRm0U0G+hjMqsBBWtyrge1mEua7VRI0InRcjntbu7L3mJn7b97ZIv58fOPIX+PglgqBjcMfuuM8gcZQ6wDu7MRWpNPrOyiCZEVlf6QuOYK1gE/mh1loCNKxF7JCDWEnqINMPCo7zHCpPITUNrJT8qHiv1OVkdrMG88cpcyvjESn9EDFL6swjpi8dEiteMuW/Rcp/HVe0sicW1vv4D3EJ521pKQ9bPs46LctU/+YRUIK9DiTkJ1omfR3PFfhyij1SiW4HFAuQBln8n4HK4e2SLgt6BsVmJkxNH5jgX5QWkwKCEWGg1EzHpUw0UWMw==; 5:0nIDJDSKCbK0H8eJyCZQ9Z0RKrxlKOfxP36FV+XlX68jOLKLH9fi6Y09VgY/2TNKC/wXojgAgBqnKrhVB9S+HtCJFTuG4tPpoO5X5H/w8yuSJLqaKSTETrYIZKXnG5VDsfpZtIOF2IEbMUFOhkLshlmG4a1A/qR/OwJM4QfBJ3Q=; 24:jnhIbZrGrhxEqRrT83P152bpTD+DZ40Q1DKuXxCTm2uW50/3b1zUICDRBhEHvhWH36ECt+MVr32PChpe7X51QxCufQWbN99Kk8kvew77qLo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB1466; 7:9k1Fk2qi6fohb8+21euEoc/tZB9VQrbHz2gWbyQmFY9DXxwLdvuLYYvtF1GCulwOSGAl4wWpe/V9WSEZDXJFCckrp3ttI7uHgyhp+xaNs48kZi7RaXfU/TmvzWZulQ1WwQ2LrtNVzOEArBT+hUGDEbetqrlemIAVD6rJ4xjvwRR4zqqPSi9UDxF0oehc4R9zBNykWOLdx3CYvEaQ3VdWBl2O5suSlteHO1mt2bvxcVajTNwSZrUjYDXql80Eeb1t X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2018 20:02:11.2913 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 10a11bd7-d0ec-4dcd-7ec7-08d5e056b35d 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: DM2PR07MB1466 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 This patch fixes crash for FCoE adapter. Once driver initialization is complete, firmware will start posting Asynchronous Event, However driver has not yet allocated workqueue to process and queue up work. This delay of allocating workqueue results into NULL pointer access. following stack trace is seen [ 24.577259] BUG: unable to handle kernel NULL pointer dereference at 0000000000000102 [ 24.623133] PGD 0 P4D 0 [ 24.636760] Oops: 0000 [#1] SMP NOPTI [ 24.656942] Modules linked in: i2c_algo_bit drm_kms_helper sr_mod(+) syscopyarea sysfillrect sysimgblt cdrom fb_sys_fops ata_generic ttm pata_acpi sd_mod ahci pata_atiixp sfc(+) qla2xxx(+) libahci drm qla4xxx(+) nvme_fc hpsa mdio libiscsi qlcnic(+) nvme_fabrics scsi_transport_sas serio_raw mtd crc32c_intel libata nvme_core i2c_core scsi_transport_iscsi tg3 scsi_transport_fc bnx2 iscsi_boot_sysfs dm_multipath dm_mirror dm_region_hash dm_log dm_mod [ 24.887449] CPU: 0 PID: 177 Comm: kworker/0:3 Not tainted 4.17.0-rc6 #1 [ 24.925119] Hardware name: HP ProLiant DL385 G7, BIOS A18 08/15/2012 [ 24.962106] Workqueue: events work_for_cpu_fn [ 24.987098] RIP: 0010:__queue_work+0x1f/0x3a0 [ 25.011672] RSP: 0018:ffff992642ceba10 EFLAGS: 00010082 [ 25.042116] RAX: 0000000000000082 RBX: 0000000000000082 RCX: 0000000000000000 [ 25.083293] RDX: ffff8cf9abc6d7d0 RSI: 0000000000000000 RDI: 0000000000002000 [ 25.123094] RBP: 0000000000000000 R08: 0000000000025a40 R09: ffff8cf9aade2880 [ 25.164087] R10: 0000000000000000 R11: ffff992642ceb6f0 R12: ffff8cf9abc6d7d0 [ 25.202280] R13: 0000000000002000 R14: ffff8cf9abc6d7b8 R15: 0000000000002000 [ 25.242050] FS: 0000000000000000(0000) f9b5c00000(0000) knlGS:0000000000000000 [ 25.977565] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 26.010457] CR2: 0000000000000102 CR3: 000000030760a000 CR4: 00000000000406f0 [ 26.051048] Call Trace: [ 26.063572] ? __switch_to_asm+0x34/0x70 [ 26.086079] queue_work_on+0x24/0x40 [ 26.107090] qla2x00_post_work+0x81/0xb0 [qla2xxx] [ 26.133356] qla2x00_async_event+0x1ad/0x1a20 [qla2xxx] [ 26.164075] ? lock_timer_base+0x67/0x80 [ 26.186420] ? try_to_del_timer_sync+0x4d/0x80 [ 26.212284] ? del_timer_sync+0x35/0x40 [ 26.234080] ? schedule_timeout+0x165/0x2f0 [ 26.259575] qla82xx_poll+0x13e/0x180 [qla2xxx] [ 26.285740] qla2x00_mailbox_command+0x74b/0xf50 [qla2xxx] [ 26.319040] qla82xx_set_driver_version+0x13b/0x1c0 [qla2xxx] [ 26.352108] ? qla2x00_init_rings+0x206/0x3f0 [qla2xxx] [ 26.381733] qla2x00_initialize_adapter+0x35c/0x7f0 [qla2xxx] [ 26.413240] qla2x00_probe_one+0x1479/0x2390 [qla2xxx] [ 26.442055] local_pci_probe+0x3f/0xa0 [ 26.463108] work_for_cpu_fn+0x10/0x20 [ 26.483295] process_one_work+0x152/0x350 [ 26.505730] worker_thread+0x1cf/0x3e0 [ 26.527090] kthread+0xf5/0x130 [ 26.545085] ? max_active_store+0x80/0x80 [ 26.568085] ? kthread_bind+0x10/0x10 [ 26.589533] ret_from_fork+0x22/0x40 [ 26.610192] Code: 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 57 41 89 ff 41 56 41 55 41 89 fd 41 54 49 89 d4 55 48 89 f5 53 48 83 ec 0 86 02 01 00 00 01 0f 85 80 02 00 00 49 c7 c6 c0 ec 01 00 41 [ 27.308540] RIP: __queue_work+0x1f/0x3a0 RSP: ffff992642ceba10 [ 27.341591] CR2: 0000000000000102 [ 27.360208] ---[ end trace 01b7b7ae2c005cf3 ]--- Cc: #4.17.0 Fixes: 9b3e0f4d4147 ("scsi: qla2xxx: Move work element processing out of DPC thread" Reported-by: Li Wang Tested-by: Li Wang Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_os.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index e881fce7477a..9f309e572be4 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -3180,6 +3180,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) "req->req_q_in=%p req->req_q_out=%p rsp->rsp_q_in=%p rsp->rsp_q_out=%p.\n", req->req_q_in, req->req_q_out, rsp->rsp_q_in, rsp->rsp_q_out); + ha->wq = alloc_workqueue("qla2xxx_wq", 0, 0); + if (ha->isp_ops->initialize_adapter(base_vha)) { ql_log(ql_log_fatal, base_vha, 0x00d6, "Failed to initialize adapter - Adapter flags %x.\n", @@ -3216,8 +3218,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) host->can_queue, base_vha->req, base_vha->mgmt_svr_loop_id, host->sg_tablesize); - ha->wq = alloc_workqueue("qla2xxx_wq", 0, 0); - if (ha->mqenable) { bool mq = false; bool startit = false;