From patchwork Tue Apr 3 21:50:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Carroll X-Patchwork-Id: 10321803 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 162FB60390 for ; Tue, 3 Apr 2018 21:51:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06AB3287E2 for ; Tue, 3 Apr 2018 21:51:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDC3628CFF; Tue, 3 Apr 2018 21:51:27 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 087B0287E2 for ; Tue, 3 Apr 2018 21:51:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753610AbeDCVv0 (ORCPT ); Tue, 3 Apr 2018 17:51:26 -0400 Received: from mail-cys01nam02on0070.outbound.protection.outlook.com ([104.47.37.70]:42131 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753121AbeDCVvZ (ORCPT ); Tue, 3 Apr 2018 17:51:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mscc365.onmicrosoft.com; s=selector1-microsemi-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=L0Zob7s5u7aCI+TQQv0wg9DpZFwmoPFhzGQzI6Bjppg=; b=CFdXcaWSZNQjfbHFlfsG8PsWXIyKu4apQcV57X1N4EbM1tNwr0O1rZnyKjY64isv+5gO5jTm27jx0eS5j8t8ITbJ3DNpabF2Z9oakxR3mjinoBFrLUVSZe4kBpSp5CzmjrqTOkDxz0MbnwYWTEsG26bSLKISjTaDfr8XMIoOjQw= Received: from BL0PR02CA0031.namprd02.prod.outlook.com (2603:10b6:207:3c::44) by MWHPR02MB3214.namprd02.prod.outlook.com (2603:10b6:301:61::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Tue, 3 Apr 2018 21:51:18 +0000 Received: from BN1BFFO11FD014.protection.gbl (2a01:111:f400:7c10::1:138) by BL0PR02CA0031.outlook.office365.com (2603:10b6:207:3c::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.631.10 via Frontend Transport; Tue, 3 Apr 2018 21:51:17 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.23) smtp.mailfrom=microsemi.com; oracle.com; dkim=none (message not signed) header.d=none;oracle.com; dmarc=bestguesspass action=none header.from=microsemi.com; Received-SPF: Pass (protection.outlook.com: domain of microsemi.com designates 208.19.100.23 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.23; helo=AVMBX3.microsemi.net; Received: from AVMBX3.microsemi.net (208.19.100.23) by BN1BFFO11FD014.mail.protection.outlook.com (10.58.144.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.631.7 via Frontend Transport; Tue, 3 Apr 2018 21:51:17 +0000 Received: from AVMBX1.microsemi.net (10.100.34.31) by AVMBX3.microsemi.net (10.100.34.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Tue, 3 Apr 2018 14:51:15 -0700 Received: from AVMBX1.microsemi.net (10.100.34.31) by AVMBX1.microsemi.net (10.100.34.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Tue, 3 Apr 2018 14:51:14 -0700 Received: from localhost.localdomain (10.225.65.2) by avmbx1.microsemi.net (10.100.34.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Tue, 3 Apr 2018 14:51:14 -0700 From: Dave Carroll To: "Martin K . Petersen" , James Bottomley CC: Dave Carroll , linux-scsi , , Scott Benesh Subject: [PATCH] aacraid: Insure command thread is not recursively stopped Date: Tue, 3 Apr 2018 15:50:42 -0600 Message-ID: <20180403215042.12824-1-david.carroll@microsemi.com> X-Mailer: git-send-email 2.8.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:208.19.100.23; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(376002)(346002)(396003)(2980300002)(438002)(199004)(189003)(107886003)(106002)(54906003)(86362001)(68736007)(336012)(1857600001)(47776003)(478600001)(476003)(51416003)(110136005)(53936002)(16586007)(316002)(106466001)(59450400001)(2616005)(49486002)(126002)(97736004)(2906002)(1076002)(8936002)(4326008)(305945005)(5660300001)(26005)(48376002)(77096007)(50466002)(50226002)(81156014)(6666003)(69596002)(81166006)(356003)(186003)(8676002)(36756003)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR02MB3214; H:AVMBX3.microsemi.net; FPR:; SPF:Pass; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD014; 1:9qspXrZgIJhm7iE5akvPORFV7XH3tOR7fklKmvhwtI52SD8YdRTMkTir9Tt5VzM7AITESLe4T9iXYgwaGXuGbfKCHYAw1zOgFOsCi1NE9X8tssQJy102tgdLM8t6MGfa X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1a1bfe9b-fc96-49e3-0e5e-08d599ad073b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:MWHPR02MB3214; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3214; 3:nSy8k0OAxwzRXVPeRTJcl4m7Kkhf16Gs4h7FVxBUzC3joCvV7WR4b6o4U/XtaTf212KTmRw+TIfpoAHnR2ZaHuvh4Q+CkwuwwKJfd7u+Not1B6APzqwuu0dr0le+C35XgLFxzaDdtcGwG6pYlCCtWpvoeBDlSjv8WGQvkbnaY1DWUiPbUN+saQ8iXfK5jz7joGPv2yVXgZ8c23+xg514R0eg0RIBcquOuAI2wgTGiGLwgJIvNk/UYX3Tzqp4P/QpvD+mwZKWfFro1+eeUVgTY4a4S1Vg8Q9YSYRD3boUpDC1MzcN4cZRb17RwPhUyGlbDZkqERNYdzM06DQSclctc4mDjb6h8yyi2vQaQRxw+TM=; 25:OlxMvMg+a78HH/RBetAztqkIyGTgDK8vneuUuukUuMv42SAMJDzccE0c7xaFQeDL7vGOGTMLioKeGLozdLBXrupvBAEH2eTNBU+6GCTlbi9REQf/6cZtIW697mFG4h0p8P6o81NF907qDNIMALaloggZ/fhi87BBUFJpVR99BZAbIlDU556x242tOUhvcjHPobSJj/lrnzKdlo7NvFux1qfvtnZRL4zLpQs6M/86RnLejKoosPrmxMBlwOPnzp6hiMAU98wjlP8XMT4jvG2zaTyoFZuQjENH1kwkC2sDjR/bcrdPZpNh2FeqOF7HukKuAtTC+qqIJuMpMog23prA7g== X-MS-TrafficTypeDiagnostic: MWHPR02MB3214: X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3214; 31:2NOIX5aVKTUC2XftIyivonemYrSvnjsJ1nJAP+vOi7L1L4XAdiXgTiUHG3t1ekaDLhsARxelEHdgfBUTXnU/PcUrlPun/1O0nkB52I5Tf6YKtr1t/1pU8Xg8fS8CqYQiHXegQXTT4M9IQi1L/Qd5JWfbzZraBR//KAndw3RpqzR+eIzcSC6Ar0HHs07cSzGmjf8kjpC0qBpr1zEDXAgumzXc1h4SbFganuzk0JWcx/Y=; 20:eIhashUu3GmlnVGaj7EpesmiufaeaM5NglUBUufFByzclhWoar6sjBOcq8WO6zaIJGt2vFdvvkrh4uwEAtFMY8QU0Xyzqkb8Vf8bAs5J2QdWD9xA2Ck2lYJHrtmhb4s04YWzvx+atMEts91X/RI3y5cuAO/tWUwd1jdw4Er1i6gPoS1HQ0WCYT/KbLnUGyEER3wLoFUMNogHi5zrj8S6A96Va/REd4wWi2Fk0uEK22ZKaUME01PoNAHY2G4o5FSN3cdXooB7EIIMWy0V7LzakkHFV7aSPrpORQMUS22REX5+hqjb8disr9urHhP73ufpNkSMRADtzNh3OfJFU2obHfMnaGIsveQ8S/khQ6OEAzW4ngkriM9Ve8NSCyZcsb961n+kdPLTtg4iSJnfQMsKwUCpRL+IEz/m+5kZspq+xFrGk5o8zkCKdaz6ddSGGOgn2uIlsK6xZhKEoDy6ehW85qsSDjPozfAJeQYd8JkhBtVVCn66vteqHtahiRI+Kv0sk6+6G2ELnZuDuK2sGn/pCjEeB/zNKe4ZVx/3CWQCDcwylo3AQTVcH1VFV5uU3ppK7uH7/ln6KhdB/n4bA4v920+tv/UQk1xVO9IqAb1dpYc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(72170198267865); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93004095)(3002001)(10201501046)(3231221)(944501327)(52105095)(6055026)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:MWHPR02MB3214; BCL:0; PCL:0; RULEID:; SRVR:MWHPR02MB3214; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3214; 4:yWHqGWFhkDelIbba7sVSoyype/jRZ+iM+hFunaCr41hD7Ljx3OFlCIh1CVAVtCg63valyX44C5xz2Ip68B6AP36ZlKCmBrncQ7v2n/dqWqk30/kdMX+UudRQc4mbwcYdX7t24CFW/z90Lp9JgToU2QskU9uPjpaZXzpAKR6fLi0zC05htMZQcbkNOYmKhfAaOFsBhPWE6DzZhYlGV57G6o6Wu5OUhQIJ/1rCgcRMMkayHFyKxhcZl/NcCOMQze1jP566h2cnfAeeC1WCVziIKYMYKRPSwhhyw8XSJzsnAtdmxQUUyfentRJwzWtoq5Be X-Forefront-PRVS: 0631F0BC3D X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR02MB3214; 23:tKU+Ygoeq4mJmJchLjvdzEGggtXWkVhiApqN3+1zk?= =?us-ascii?Q?+KhddvDc2XcWs7DnHNCKufXJwlimWJmnwS85TBPsq2CdIQ7bk26veseBskjo?= =?us-ascii?Q?NVaNtDjPns3vp0TuzNJRQ0oqRYXQF6LJr9vMWW4nVphKRQMnXvhRroOfXEby?= =?us-ascii?Q?4ZLgjAl8hRkJEjfm5Bx3wjxckAwpEaTS1Ns4CIr2g9S+KhTO0bj4Uj4Vr4LB?= =?us-ascii?Q?UN4SHPetCXFGh4E4o7ExeJFko+ihKedb5r0fKLCJnj+Jwtk0bjkGNZBvHU6W?= =?us-ascii?Q?ue5wTkP5XM7OyZceIL76tqMTLWqWnuCLwft/svNRnAqbWQisczEbgICBVKD2?= =?us-ascii?Q?Wgbsr5gcZZMvJ92XY4k3wnjKU5PurjpZ/DUTHeDLDZdKJUPlI4RKMRhnOp4i?= =?us-ascii?Q?7lNiU0/VA3G0mEMIHJUbuYreEPL42XUFRyh+jHVQZjbOlAEUtKZWlb7rxwAQ?= =?us-ascii?Q?yTVkRb3ph+6cR3WSOE50HXKzbVn95COGg73eHzq1WLPY6KSfBDA+xYNoN3eF?= =?us-ascii?Q?m8TBXu36x3ocJSblBLB3tw8u6VWUREqCWxAkb9erdeM9SO3RKS8QU8sC8KIg?= =?us-ascii?Q?GSILRLrCQr01I7gLqiGInsg6LLdv1wzeWHOfqjnuyo5FjFuhEeW8hKiF17d1?= =?us-ascii?Q?L5MWjH43Vb2CEd8n1ahGUL2hi0oCmybztxNXXF6zaOI3WJ7PcUlOkxdwnNB1?= =?us-ascii?Q?rbbF9UXIM7GWuATdLWmwcoFdBRf1oOrBEYXoJqAT+2opRVqT6kgSu1+1SlYc?= =?us-ascii?Q?aTWfN5R6Ok0ObAuavi0OinudxPeoqkwkCure1Xgi/8+useKwzPHDhIu2zpQc?= =?us-ascii?Q?RvK4VyPGHeeR3DSz6F/n68HUcI2VCXXA2ZIGA630vgwt6mENpaMfaLvZ9Qul?= =?us-ascii?Q?18hU1hKMs3ZseDGeLdkVtYzf0Otcpi5QJibed99iTbuDwjLL7xBl2/BqY+iS?= =?us-ascii?Q?y1iVJUekrXNPb924swVbxzfgsG0nCb+pcTi1QDpu5Qw5SS3dw+GjE7RgTI/3?= =?us-ascii?Q?UqOFayHtVHE67/xpl7KBMDqk67Rk4oljyMzofr+r7ouOwiXNTen3PNEVCmsM?= =?us-ascii?Q?VjR1AyKEX447rHRPR+Yi/5tbWtiSOBUEHDfjmtYNVULl3w4W9D+YyIG/0zj6?= =?us-ascii?Q?Kk9F13yZ/UHTGlXAKgJB2JneoL4NyJq?= X-Microsoft-Antispam-Message-Info: aYZekXY85GPDtVqYVdwhSEdicre0pfg0dw1p4fDwJtraYn3sdx0UyMjs2JWe3M+69qkyGtF9fv6kqn2HaPfJxeAa0954z7r/KVphieXe/KK9u/PcvMHvWCtGgSDgiae6bpu3hX42PHoUUw2pqwDNDKA8mLvwShBmR+58BqOFlhaij/m1Y5/4yQTIU7MZqpNX X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3214; 6:AeFdMzKZ3dxLlqDgV30tcFEfZS3Xkd/XlOixzPTQUvdCLS/ofBRLDRt6KKMzF7yOmXqM923K0xQhcm6C3KbY2Apd8CJO9gSspt+OWVMNFNYtDgK/4j6tJxZcDyJt8b1ku4WiWnwuS41ra6pQBch8eUhbv8hpyg2lxWCowjfSM88Kxt+eQUAAMiNvdLgjEhnMNxHinp4W12FvtE0So7ND45bLX8FHaTf4PVGSFfJj6Fg8o7gfeola+eUkttNnWiBlYgSkoH6F3i8THkzhOaUUeI2CbAN+gtEFNtvpUgdG0q9sHLZsdswBoES2KKjcqIMmzw6yyTtZjJ5IlI6VbsZZdvx/dNQfBw+X+zMTotqC8AnlmKKf9rQDJSm9KGi1gkI0pTWAmFY0QMmd9Uy2d/kT+oZjd7+G/ayzAKHicYrpVQ2tUng+FKL2tZJgOooOdZ3hCkPvWFhHqb4dxELCaNiN7A==; 5:tvFRzfDTBUHDWeP1zow6QdgeRmyu0y2lpHRBtJn8mo07XBOCRJM4i738shJ8BLamDZnRK6fkoWn/G0cRPh5GWya/cBqMyDs6q8JKG+6YqtSUULKfAfkc+XPZCuQvnBj2lnomtanwIT0Dz3yqcORQ1fpAgl0rKrCUsw8cA+egcQU=; 24:4CpLtAvedZ+JOHNIyOZI89EqNpyu2N7Wn7c1lKx2V5lfsrIBmy4meMXx4QRyySv1gG18lG8KO3w6yvxaN+7RkD22epA7NT1lWexTkyqTD+M= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3214; 7:46RWBjwjI7JAbl4U5XNek4WWNIT3dUuEaPeG6qBUpXWGdpDu9YOWKuJb37CnH8wNUG9L1UkHpII8kep+HBe3k64ihPFqzfr4eqiJHjQpM2AtBDYlu9p30xCbFx6CiWsVM59x/X6O3EhRbPe8y+7o7afdAcxBkZYDkHN5PYN8asGxdyBWzXjEKRq8aTpjh1/HZYHNmeJw6aFdZu9YXbcfdnige+kpfMiLWxMnh9Y6rsjHE2kT0kSfGfSfSrpsty/i X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2018 21:51:17.1091 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1a1bfe9b-fc96-49e3-0e5e-08d599ad073b X-MS-Exchange-CrossTenant-Id: f267a5c8-86d8-4cc9-af71-1fd2c67c8fad X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f267a5c8-86d8-4cc9-af71-1fd2c67c8fad; Ip=[208.19.100.23]; Helo=[AVMBX3.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB3214 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 a recursive IOP_RESET is invoked, usually due to the eh_thread handling errors after the first reset, be sure we flag that the command thread has been stopped to avoid an Oops of the form; [ 336.620256] CPU: 28 PID: 1193 Comm: scsi_eh_0 Kdump: loaded Not tainted 4.14.0-49.el7a.ppc64le #1 [ 336.620297] task: c000003fd630b800 task.stack: c000003fd61a4000 [ 336.620326] NIP: c000000000176794 LR: c00000000013038c CTR: c00000000024bc10 [ 336.620361] REGS: c000003fd61a7720 TRAP: 0300 Not tainted (4.14.0-49.el7a.ppc64le) [ 336.620395] MSR: 9000000000009033 CR: 22084022 XER: 20040000 [ 336.620435] CFAR: c000000000130388 DAR: 0000000000000000 DSISR: 40000000 SOFTE: 1 [ 336.620435] GPR00: c00000000013038c c000003fd61a79a0 c0000000014c7e00 0000000000000000 [ 336.620435] GPR04: 000000000000000c 000000000000000c 9000000000009033 0000000000000477 [ 336.620435] GPR08: 0000000000000477 0000000000000000 0000000000000000 c008000010f7d940 [ 336.620435] GPR12: c00000000024bc10 c000000007a33400 c0000000001708a8 c000003fe3b881d8 [ 336.620435] GPR16: c000003fe3b88060 c000003fd61a7d10 fffffffffffff000 000000000000001e [ 336.620435] GPR20: 0000000000000001 c000000000ebf1a0 0000000000000001 c000003fe3b88000 [ 336.620435] GPR24: 0000000000000003 0000000000000002 c000003fe3b88840 c000003fe3b887e8 [ 336.620435] GPR28: c000003fe3b88000 c000003fc8181788 0000000000000000 c000003fc8181700 [ 336.620750] NIP [c000000000176794] exit_creds+0x34/0x160 [ 336.620775] LR [c00000000013038c] __put_task_struct+0x8c/0x1f0 [ 336.620804] Call Trace: [ 336.620817] [c000003fd61a79a0] [c000003fe3b88000] 0xc000003fe3b88000 (unreliable) [ 336.620853] [c000003fd61a79d0] [c00000000013038c] __put_task_struct+0x8c/0x1f0 [ 336.620889] [c000003fd61a7a00] [c000000000171418] kthread_stop+0x1e8/0x1f0 [ 336.620922] [c000003fd61a7a40] [c008000010f7448c] aac_reset_adapter+0x14c/0x8d0 [aacraid] [ 336.620959] [c000003fd61a7b00] [c008000010f60174] aac_eh_host_reset+0x84/0x100 [aacraid] [ 336.621010] [c000003fd61a7b30] [c000000000864f24] scsi_try_host_reset+0x74/0x180 [ 336.621046] [c000003fd61a7bb0] [c000000000867ac0] scsi_eh_ready_devs+0xc00/0x14d0 [ 336.625165] [c000003fd61a7ca0] [c0000000008699e0] scsi_error_handler+0x550/0x730 [ 336.632101] [c000003fd61a7dc0] [c000000000170a08] kthread+0x168/0x1b0 [ 336.639031] [c000003fd61a7e30] [c00000000000b528] ret_from_kernel_thread+0x5c/0xb4 [ 336.645971] Instruction dump: [ 336.648743] 384216a0 7c0802a6 fbe1fff8 f8010010 f821ffd1 7c7f1b78 60000000 60000000 [ 336.657056] 39400000 e87f0838 f95f0838 7c0004ac <7d401828> 314affff 7d40192d 40c2fff4 [ 336.663997] -[ end trace 4640cf8d4945ad95 ]- So flag when the thread is stopped by setting the thread pointer to NULL. Signed-off-by: Dave Carroll Reviewed-by: Raghava Aditya Renukunta --- drivers/scsi/aacraid/commsup.c | 4 +++- drivers/scsi/aacraid/linit.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 84858d5..0156c96 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -1502,9 +1502,10 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type) host = aac->scsi_host_ptr; scsi_block_requests(host); aac_adapter_disable_int(aac); - if (aac->thread->pid != current->pid) { + if (aac->thread && aac->thread->pid != current->pid) { spin_unlock_irq(host->host_lock); kthread_stop(aac->thread); + aac->thread = NULL; jafo = 1; } @@ -1591,6 +1592,7 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type) aac->name); if (IS_ERR(aac->thread)) { retval = PTR_ERR(aac->thread); + aac->thread = NULL; goto out; } } diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 2664ea0..f24fb94 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -1562,6 +1562,7 @@ static void __aac_shutdown(struct aac_dev * aac) up(&fib->event_wait); } kthread_stop(aac->thread); + aac->thread = NULL; } aac_send_shutdown(aac);