From patchwork Tue Oct 17 00:22:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghava Aditya Renukunta X-Patchwork-Id: 10010345 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 BA490601D5 for ; Tue, 17 Oct 2017 00:22:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A942028434 for ; Tue, 17 Oct 2017 00:22:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BA41286AE; Tue, 17 Oct 2017 00:22:52 +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 28F1128434 for ; Tue, 17 Oct 2017 00:22:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756362AbdJQAWt (ORCPT ); Mon, 16 Oct 2017 20:22:49 -0400 Received: from mail-dm3nam03on0066.outbound.protection.outlook.com ([104.47.41.66]:64416 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755198AbdJQAWr (ORCPT ); Mon, 16 Oct 2017 20:22:47 -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=tLJ4b8aqTJv3x3yO+4uqVjjbVf4UjcM/NsO1CisHL10=; b=QcYfzSdfbT5ZxYBZNpNSaRw8WeQ+mqU6a7URRH68NBV/RLB2+I+N3Pcdg14DoHVdnK3PT+kbc7hUpXTuO9M4fZNPyuNr0/CUBxkJl8ucQe8eZ64vNDBnAdbbBg/MvdR6dJZ1e2WrE+wC3WhOO5vZtq+BJkAFDRr/ikE4FSEf7NM= Received: from SN4PR0201CA0046.namprd02.prod.outlook.com (2603:10b6:803:2e::32) by CO1PR02MB144.namprd02.prod.outlook.com (2a01:111:e400:101e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 17 Oct 2017 00:22:45 +0000 Received: from BL2FFO11FD032.protection.gbl (2a01:111:f400:7c09::197) by SN4PR0201CA0046.outlook.office365.com (2603:10b6:803:2e::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Tue, 17 Oct 2017 00:22:44 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=microsemi.com; Received-SPF: Pass (protection.outlook.com: domain of microsemi.com designates 208.19.100.21 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.21; helo=avsrvexchhts1.microsemi.net; Received: from avsrvexchhts1.microsemi.net (208.19.100.21) by BL2FFO11FD032.mail.protection.outlook.com (10.173.160.73) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.77.10 via Frontend Transport; Tue, 17 Oct 2017 00:22:44 +0000 Received: from rslab209.pmc-sierra.bc.ca (10.181.72.13) by avsrvexchhts1.microsemi.net (10.100.34.105) with Microsoft SMTP Server id 14.3.361.1; Mon, 16 Oct 2017 17:22:32 -0700 Subject: [PATCH] aacraid: Fix controller initialization failure From: Raghava Aditya Renukunta To: CC: , Date: Mon, 16 Oct 2017 17:22:31 -0700 Message-ID: <150819975151.22574.15488858870979477962.stgit@rslab209.pmc-sierra.bc.ca> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:208.19.100.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(6009001)(376002)(39860400002)(346002)(2980300002)(438002)(189002)(199003)(86362001)(50986999)(54356999)(2906002)(316002)(33646002)(230700001)(189998001)(54906003)(58126008)(81156014)(68736007)(106466001)(53936002)(55016002)(103116003)(53416004)(2351001)(9686003)(356003)(8936002)(4326008)(81166006)(305945005)(104016004)(8676002)(69596002)(107886003)(47776003)(72206003)(6916009)(7696004)(23676002)(77096006)(83506001)(50466002)(5660300001)(106002)(97736004)(478600001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO1PR02MB144; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD032; 1:nVJJYIua/cQraamd+g/qoEUni6SlIir5kxbjA6LQwxDRhvvwyBCQtRUZN54V6l2/79t9vC+c9GnK/RmY6voM7Inva9I0iXVpxXvbI/AkgHSPovhsBxwXlnyV+zIpD/t8 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4ca386c0-7d0e-4dc6-704d-08d514f53028 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CO1PR02MB144; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB144; 3:JOV4KtktF8AkjkmT4tOtMA6lzYJIMzothy9RWgnN6zn2pJ1VFItMI9MFH6M+33NxEzaNQfBT6xLIcfNS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dBBZZdXjYWg10YZKE+n0xEETdUoDnqmj9Gwc+iJGd0jsf0azPZtclp0atAGy8TGxt6p4ehUPP1dx8Xh/4xzK1mlscGWE0c/p8AhzDGCjqcJeEL8rqOr5tWHo39zqOfP8Gz+oY5xOVLz6Qa6Nrrp3QIIM98nVYl0mpd87gqzmDxJTYVf74tGAJ0t19YkPcnBV+WEYxO4vJblf8eTAfauuhqd/v//67gAKm2vfNc4fUoIIBaxAXpSAA5gB049gvXzizswA0kTjBpfEjOi7ExCqnM5dN2tdvKNvD5Hyw3xzYrtn2uuvVJ9Fnv2fVbBm5uaDUoFWAGm6IZPUNHxd5RzV3yY3mof7CfGAlG7cep4M4Ec8Log9lh75hhk9ynl8W7eFr6 X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(72170198267865); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93004095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO1PR02MB144; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO1PR02MB144; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB144; 4:5TvEZsLQ31fBttbPC0uelFBb/cEJ19P+WGA1T2+pE31h3lX+JEYN+q4g5XhtNKRVOEfBtJgUGbBo/KiJIiV+z5wqTCNw+Drxt8iemiCBW4XWAmQR/Wd634g4+lyUNkFZSQqucUwgTjInSUso+HYI/2zMD336F1goPrXRihzkER8yQEwC0TPUmkkIvaJTdVah9b+MJX8BOy1nILi7QFB2aeH41ac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SzlwWFp0RTc5SmRPVjVvcUhlK2F2WUYyWjZXRmpRUTVFalN6WUE9PQ==?= X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB144; 6:uA8pQ8pvKoUODP6Mj5dgXm8ImSHTzdGFqdI8jtncEjhUZG5M6YIOqrSpyTYg8ga2hJ744//bTKjPp90crI7zglBhdR62gOJja6WOaps/ZYOg3yNjdJN4RBOB1q2ckBh0iSoxcDyi149ujHdjjL7/4OQmoIloY+oNOw2EQMWR1Qy4RZroF9LBp/K6gPezGK92gyoAOaob1Cf/ybzMvnpY40YXok4eebAkvmFJsEPDJKbRoK++7eGGF4CTSqF6SKLiqcnxmy7Sj6h7S+dqOfSr/SwTaBQDMDWdX+8Y4snRtOSQDU+EI29TSaCRS8WhU9omYNaFMnRrzTX90dGQE2CkYA==; 5:SlF7naNQMmwfRr7/oRYBF0lvfQaGQyHQbkpHslme9i5uGTejsXR0YAVxI7NGz9orCtMsEDlNmeoh/axt3efNvODFKZbQtCG1Njqzo4MJPsCwnX1OybhZuR4LXKKW31voKWxVYUvVLvyIomoFCNwTFr1VACTgLJIEBBHJ3+7qB8s=; 24:O/qzT5Qg63yuIsFYhC4Yv3A2c2wU+62oj1FJSkkCY8mfQe4jpdorVgwZ+kXg2ns7m4WImBc1q45XcReZ5+qfLqzEcG3JuhsODeue03Iba1E=; 7:3hmTS0suUPJXva6U2JYKf0fmMY0osQlIW9wxC8fk/LhCRk1/iLSQWwkLoEtCxa+9EmHR9WjcKWIFm2sRO1VeIiOt9tv7qJyLTnHDp/ti6ufxhQ7Q/G6Sj4bVfxM5bCYFXTvdweDox1QGbeji7DwUxpOXwuGo0z5Bmo+DlxtQIiDvxT/zjjKhzTcttz2S/1MZYRSoDnJno+mZsNkHMbTPTJn9mhf9FQPsGFsOJLga1KI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2017 00:22:44.7016 (UTC) 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.21]; Helo=[avsrvexchhts1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR02MB144 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 is a fix to an issue where the driver sends its periodic WELLNESS command to the controller after the driver shut it down.This causes the controller to crash. The window where this can happen is small, but it can be hit at around 4 hours of constant resets. Cc: Fixes: fbd185986eba (aacraid: Fix AIF triggered IOP_RESET) Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Dave Carroll --- drivers/scsi/aacraid/comminit.c | 8 +++++--- drivers/scsi/aacraid/linit.c | 7 ++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c index 97d269f..1bc623a 100644 --- a/drivers/scsi/aacraid/comminit.c +++ b/drivers/scsi/aacraid/comminit.c @@ -302,9 +302,11 @@ int aac_send_shutdown(struct aac_dev * dev) return -ENOMEM; aac_fib_init(fibctx); - mutex_lock(&dev->ioctl_mutex); - dev->adapter_shutdown = 1; - mutex_unlock(&dev->ioctl_mutex); + if (!dev->adapter_shutdown) { + mutex_lock(&dev->ioctl_mutex); + dev->adapter_shutdown = 1; + mutex_unlock(&dev->ioctl_mutex); + } cmd = (struct aac_close *) fib_data(fibctx); cmd->command = cpu_to_le32(VM_CloseAll); diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 87cc4a9..710ace6 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -1547,8 +1547,9 @@ static void __aac_shutdown(struct aac_dev * aac) { int i; + mutex_lock(&aac->ioctl_mutex); aac->adapter_shutdown = 1; - aac_send_shutdown(aac); + mutex_unlock(&aac->ioctl_mutex); if (aac->aif_thread) { int i; @@ -1561,7 +1562,11 @@ static void __aac_shutdown(struct aac_dev * aac) } kthread_stop(aac->thread); } + + aac_send_shutdown(aac); + aac_adapter_disable_int(aac); + if (aac_is_src(aac)) { if (aac->max_msix > 1) { for (i = 0; i < aac->max_msix; i++) {