From patchwork Wed Dec 27 04:34:27 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: 10133393 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 60E54602BD for ; Wed, 27 Dec 2017 04:35:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A0412DA56 for ; Wed, 27 Dec 2017 04:35:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EB162DA5E; Wed, 27 Dec 2017 04:35:14 +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 221A52DA56 for ; Wed, 27 Dec 2017 04:35:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751813AbdL0EfM (ORCPT ); Tue, 26 Dec 2017 23:35:12 -0500 Received: from mail-by2nam01on0079.outbound.protection.outlook.com ([104.47.34.79]:10016 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751715AbdL0EfF (ORCPT ); Tue, 26 Dec 2017 23:35:05 -0500 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=0sN3xoISj/UsR5schTiyuhoRMZTPbMLDJpbtW/j8F9Y=; b=SKKNJgogDAzP7uDmhSBPSJEs2NyJj+OE5RpXzGijLjGROgvShv/plEV915IbLEg2+veARLSKTA1v9muRL34qcKETmc6xW7+UA1mJ/BO7tRTrczn6U1EDNYksFa0rOijNHgvaeiBbMr04bp7kZwunjPkC06H2HY4bCcGxpEgRtmg= Received: from CY4PR02CA0002.namprd02.prod.outlook.com (2603:10b6:903:18::12) by BN1PR02MB134.namprd02.prod.outlook.com (2a01:111:e400:20::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.14; Wed, 27 Dec 2017 04:35:02 +0000 Received: from BL2FFO11FD049.protection.gbl (2a01:111:f400:7c09::182) by CY4PR02CA0002.outlook.office365.com (2603:10b6:903:18::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.366.8 via Frontend Transport; Wed, 27 Dec 2017 04:35:01 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; wdc.com; dkim=none (message not signed) header.d=none;wdc.com; 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 BL2FFO11FD049.mail.protection.outlook.com (10.173.161.211) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.345.12 via Frontend Transport; Wed, 27 Dec 2017 04:34:42 +0000 Received: from localhost (10.181.72.13) by avsrvexchhts1.microsemi.net (10.100.34.105) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 26 Dec 2017 20:34:54 -0800 From: Raghava Aditya Renukunta To: , , CC: , , , "Guilherme G . Piccoli" , Bart Van Assche Subject: [PATCH v2 06/30] scsi: aacraid: Allow reset_host sysfs var to recover Panicked Fw Date: Tue, 26 Dec 2017 20:34:27 -0800 Message-ID: <20171227043451.27813-7-RaghavaAditya.Renukunta@microsemi.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20171227043451.27813-1-RaghavaAditya.Renukunta@microsemi.com> References: <20171227043451.27813-1-RaghavaAditya.Renukunta@microsemi.com> 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)(39380400002)(39860400002)(396003)(346002)(376002)(2980300002)(438002)(189003)(199004)(106002)(50226002)(104016004)(57986006)(5660300001)(97736004)(2906002)(81156014)(81166006)(53936002)(8676002)(68736007)(2950100002)(47776003)(4326008)(54906003)(110136005)(36756003)(86362001)(59450400001)(2201001)(1076002)(76506005)(16586007)(69596002)(48376002)(106466001)(76176011)(51416003)(6666003)(478600001)(316002)(8936002)(72206003)(77096006)(50466002)(305945005)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR02MB134; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD049; 1:/UIykecJZqyHNXVhE3/7lRnjQRZv0UZsvm8CczoCwEnStnq9gL48kKF2PFxVoRYlw63xXVK/iyIQ87A9B4Pf0SPfwmpD/yPS1+BPJe1bXz2kAc+DcgE1bTZI8wwi92Em X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7f0d38f8-d4e4-4538-4cbc-08d54ce32648 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(4608076)(2017052603307)(7153060); SRVR:BN1PR02MB134; X-Microsoft-Exchange-Diagnostics: 1; BN1PR02MB134; 3:s3/zoer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IeoJ7aMoDw0UcqkYYzPENNbw2GNtkJc3b8IAzGii97QJwObgTFVyxxEvzb6x/dyRTRwyqUOMibHMnsa0pDVrkUBsHR+D0qLho9rhYFTrB76eqWknM/m5P9VOZOaZc2faWr4fRUb4dpmWfbwBT30SNs1EYLA2r8AL1lwzdapVFyPDQ0LN9MDHvlRz2o3jradTALvfXPmwAZyjB2gv2oqTaS0dE2k9Cz5VcZ0PfQhfFlvXnmHy00KdfJT5gPrH+6YkQPjk0joe2+iwXNnLTAJcnWaEkQsTMIA4WsPKPhHZvYca8ZikEUxwVJRwoNiIKh11ZDgp4nhUzu4NTj3qqRVBObK+AWUQ8FDtIjKm+R+qChtlNkchTyNj1zCLhL0pecSfuTNU+hU7KVDEPibIfK+6zf7a5uft64hQkW2qFvyaOsCdfiS6e9yfTYFIJi2DqocqmNRWxHadN075BIGQpofr7Z42Smb9L3JPJL9r77JqkIASiU1hiU38AraUzKbyomQE1GWVO01J9+1Z1Bl9NFy7R5Q4STFZ/qB8wCrA7CAqzacec7amUZw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(72170198267865); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93004095)(3231023)(944501075)(6055026)(6041268)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:BN1PR02MB134; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN1PR02MB134; X-Microsoft-Exchange-Diagnostics: 1; BN1PR02MB134; 4:f+3B/yezPcgVTjXxjg4A2UZzgI/hgNbQ2hDRAZu4PZnLUCkMZfWkqy7XmKXaspoSi1tXB8wbwhh3uqyb7krse64Gyf8Bozqr6S99Gu/MkKQaJ+CcP5UdFKYPg3UMOb2O6wbk8Pcoa5ZoEXsGcYNMY+FAKbn4r9T8OHGZN5klk16R/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guEyjVwcaP87J4qipJ0I6HePV6fiUtW0FkS3HYhL8lxIako0SwvrM=; 24:i7RBv01d/Is3idWBAPrS0bjiY4LFF5KbbXhezE3F7momePjm+yD9Q0VEOJLRrxxobcD9UmWvABqW6rKcCvNOvcoAx0p35oB4Z81Z4+73ALs=; 7:6FKuvN6HulGESSxxaCPlEvV/g7tgN2QdDSYmrN32lCs1KyROs749ck2mZcVV9oNyZ06CDxk2MwUU5CEF7qLtt3YWlZ/sta/Ave+Ed3sM6g1LYd0/GKWwXi115NRO1lPV2RHZOUiypPGOMHzCIj049E9I31Tp0jgeZiCrjVZRRjrntgAfEb5PGrG8DpfoZMsS+znz3JcA37YFJ5Nsu4U51ETEgjaP8C0secp62RSgQ8S27nEqWk9ww4YRZ+zt6QFq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2017 04:34:42.3077 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7f0d38f8-d4e4-4538-4cbc-08d54ce32648 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: BN1PR02MB134 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 It is possible to restart the controller via the use of the reset_host sysfs variable. This does work for controllers that can no longer respond, since driver will attempt to send down a shutdown in this path. Check if the controller is able to receive commands before sending down a shutdown Signed-off-by: Raghava Aditya Renukunta --- Changes in V2: None drivers/scsi/aacraid/comminit.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c index 1bc623a..9eff246 100644 --- a/drivers/scsi/aacraid/comminit.c +++ b/drivers/scsi/aacraid/comminit.c @@ -295,12 +295,10 @@ int aac_send_shutdown(struct aac_dev * dev) { struct fib * fibctx; struct aac_close *cmd; - int status; + int status = 0; - fibctx = aac_fib_alloc(dev); - if (!fibctx) - return -ENOMEM; - aac_fib_init(fibctx); + if (aac_adapter_check_health(dev)) + return status; if (!dev->adapter_shutdown) { mutex_lock(&dev->ioctl_mutex); @@ -308,6 +306,11 @@ int aac_send_shutdown(struct aac_dev * dev) mutex_unlock(&dev->ioctl_mutex); } + fibctx = aac_fib_alloc(dev); + if (!fibctx) + return -ENOMEM; + aac_fib_init(fibctx); + cmd = (struct aac_close *) fib_data(fibctx); cmd->command = cpu_to_le32(VM_CloseAll); cmd->cid = cpu_to_le32(0xfffffffe);