From patchwork Thu Dec 21 17:34:17 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: 10128139 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 0CCFE60318 for ; Thu, 21 Dec 2017 17:35:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF61529CE3 for ; Thu, 21 Dec 2017 17:35:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E404629D3C; Thu, 21 Dec 2017 17:35:45 +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 7751429CE3 for ; Thu, 21 Dec 2017 17:35:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755156AbdLURfn (ORCPT ); Thu, 21 Dec 2017 12:35:43 -0500 Received: from mail-by2nam03on0049.outbound.protection.outlook.com ([104.47.42.49]:27386 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753761AbdLURey (ORCPT ); Thu, 21 Dec 2017 12:34:54 -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=lbH0Ir3hMHFEs2XdWEi/PHu6y63RIH2HAIAXx9kxTt0=; b=i0OA0np0t7++7zYVpEwWil7heWkn02IwAXnBOEejQiEVS/LlDZsqbi8yDnGriIw+sh+1i6CqCaCAtk/xOT4KmaPEe1Taox/o0YlnPtDMV+IQAt/PyTXiU5XkuPxQNtqc7RSg5uGqryxU5YH3u8qY4sU8IfaTGeBnqUmar74kQtI= Received: from MWHPR0201CA0061.namprd02.prod.outlook.com (10.167.160.38) by CY1PR0201MB1835.namprd02.prod.outlook.com (10.163.55.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.14; Thu, 21 Dec 2017 17:34:52 +0000 Received: from BN1BFFO11FD012.protection.gbl (2a01:111:f400:7c10::1:183) by MWHPR0201CA0061.outlook.office365.com (2603:10b6:301:73::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.345.14 via Frontend Transport; Thu, 21 Dec 2017 17:34:52 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; linux.vnet.ibm.com; dkim=none (message not signed) header.d=none; linux.vnet.ibm.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 BN1BFFO11FD012.mail.protection.outlook.com (10.58.144.75) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.302.6 via Frontend Transport; Thu, 21 Dec 2017 17:34:38 +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; Thu, 21 Dec 2017 09:34:28 -0800 From: Raghava Aditya Renukunta To: , , CC: , , , "Guilherme G . Piccoli" Subject: [PATCH 26/29] scsi: aacraid: Fix hang while scanning in eh recovery Date: Thu, 21 Dec 2017 09:34:17 -0800 Message-ID: <20171221173420.8213-27-RaghavaAditya.Renukunta@microsemi.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20171221173420.8213-1-RaghavaAditya.Renukunta@microsemi.com> References: <20171221173420.8213-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)(346002)(376002)(39860400002)(396003)(39380400002)(2980300002)(438002)(199004)(189003)(2906002)(6666003)(68736007)(81156014)(8676002)(36756003)(106466001)(305945005)(76176011)(356003)(59450400001)(57986006)(76506005)(104016004)(69596002)(77096006)(2950100002)(97736004)(51416003)(5660300001)(478600001)(72206003)(50466002)(48376002)(4326008)(47776003)(1076002)(54906003)(106002)(81166006)(110136005)(16586007)(50226002)(86362001)(2201001)(53936002)(316002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB1835; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD012; 1:TxjD5QegNphV9SGlvYtSPxXe9qdXK5rzIHzaFHhmw2FFpG+YeWo0Ku1/sRV5iLLnWmcIWjY8aCXFlR2klt/Ks9x5tTbP94NwzoU+q6gp47CzlBsdpYF88rUHhV39QIbw X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 804be1d8-6cf0-4026-0b39-08d548991c3b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(4608076)(2017052603307)(7153060); SRVR:CY1PR0201MB1835; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1835; 3:9K87cy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FTPEMfh9wV5MHTU8HwTzKiV+51LsXwCC7lyEzXM83TsWfdTZiCY1aQEFSI3DkZFir932ZgwQfdZMr+eQ6lw/l9jLVFZfX2yqj+dsQ1Z0hSX7tDfcBl/NipV8dSqVdmowwIsPPPwlKIifULyDuQgBcer7RLqLsiw1upSsOJFy3aC1mrHZvVykZf+rbNIBzGizrPOA/7hPvphci39UwwetBhwmVDv3//KFFUJQ6qm8oMwV3JnhxIYsS3joLXs/efgjBkAyE3AP8oH8ez4nGhCZOcQ+POPMWLmoyCVNGjkHv+0i1ssTs1ud/BcwA36JHqIChRL+F0JV9fRsr0tYl5vX3zUdxZ56RQjbKyF7Csh8XHJZsrPC1tIB6+y2TGdDNaLkBY0dmJA+AKqDfgdIAmB9CmXZBoQkC7Pi5suxU+Jx5BX50zlKhd09j3WkZe+zQvmdi1ohH1zLyNKkIWfEDXmjsQIRR+lTYnbtNZoe+HlsltTOKajaCfLr2WIZOlOodLPDg8e0o4tCG9keg2BzaXNDXZCoWHCC8oiPikLdwtwXs1fLnP0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(72170198267865); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93004095)(10201501046)(3002001)(3231023)(6055026)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:CY1PR0201MB1835; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY1PR0201MB1835; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1835; 4:Rby/RbQ+o2SGCFt7ucrINoYsEaQJmnssJTpAbDB7TH91UXMnNNMUx+pr0acv+rbyIxWlmrI7CvpMzZp+YO2FzmLBefd4kmsdTMwhPJeb3mPbs/gdVcdKhl29bawbSA6WSSwo/EYc0gfJSquN7q/7HiHQSkhwRsJYwxjUn4tVXLvaYg0Fm1HhbxRVYT6L8V8vYadIm9nsEKPwfkg277wF2CGOsu3dL+lAcrp0HtCRdHfELCf44xRf3Yk+KSd3vb8KmRnSXVKCXmuJfoe/Lo//+TWSLOZUXRPpkaHTYTWI0ykcM0VKW47XIqQRjfkzX2Sp X-Forefront-PRVS: 0528942FD8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0201MB1835; 23:jlB5TxgCMrFeF7+xWu6Q1r1VeWWgd1wZg5DmY8H?= =?us-ascii?Q?KQwMHDKZEDJB3goOkUlunbZ5GgDcbWGO3unxGVssOEKYJaaTXiGcI53RCeOB?= =?us-ascii?Q?1lWJT0NgFE7BeNS1lix3aVVCjuJVLTICMFFi8L137kEaYtdJ/nglHM32SHBu?= =?us-ascii?Q?AaGmMKq0k7jAHOaYBN1izFwFST0qMJp9O9MwSfDkkydWfmHXzMvV19eaiL5S?= =?us-ascii?Q?8V2XunbhCZkwaqafKP39Mfp5IJMqwR/ORcomE+y9gjSNfbKzECpuwBwhQNdG?= =?us-ascii?Q?F4+U2Fh7Hpdj9cecUv0J22XKG96o6KvztkQzZQLJz6exJwTMXPoWWZGsbBwb?= =?us-ascii?Q?FXKbsv8vZaLbeW+ZGDax5AKMAWfHC7qcB33BNn+rAibZuii6A5UL6Y1d10JD?= =?us-ascii?Q?ltNU7IYbksp/HiUipNd/Ff840qB+Dn+shGKYbXJa3ELgDtICOwG9iIN8x834?= =?us-ascii?Q?WrA/hJQPQoYsB9pVLLRczPjCHjArMTGsffJeyaq8Ka0ZILHRuvzHcoi9Wjwr?= =?us-ascii?Q?pDcH5A4/4syyMkuy54p7cYp3aWl5flFmkkORuGEGoX9BRerM9V4W8duZL28O?= =?us-ascii?Q?NVeZk53blAR9Hw0eKkWO40JvP7ZjWYdKyoBD4BeQudimA1cLQymP+QNbjonn?= =?us-ascii?Q?qRFoJ5yuAIZa/36bJzGhUKt2WjPpWxH3zTGw7/2ziWFDeKDwV1Q5+za5Ik6v?= =?us-ascii?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xWN4lesG95guJ0g0YBDEao=; 24:wZza1D0+1OklNrDy5u6AyZPwWukgO6g43+C4+rpMGTQ6FQi90ilQZZTR0+UlpmW3sA+cuVDlNULcqR0h1W4LT95fRJmbmgeuX4cJ49gv23k=; 7:pktgWLaHEBKLvEMw2FeY0q9ypY2PAroulnV5MCembZhQnYBF1fqEMQ5f76pp8GGotbwqOmhuXNjCE5Gj8UGflnr5AuIvdy8mRisORo83ga+8A8fniQQMAwViplcXc2cFBO0BA+xRC+ityQbvv+KwY6F9+sguDdj+jgNCz9hX5eypzBxd3mtf8aVNaDmIrgCLE6yJoCWO28A6yVmYQCLKtNEoysRd9+MJ/YYu/HggDCcrlI6CKtGR1R0aA2Cs+QJ9 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2017 17:34:38.0188 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 804be1d8-6cf0-4026-0b39-08d548991c3b 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: CY1PR0201MB1835 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 Add back the ability to scan for hotplug changes while eh was in progress. Schedule a rescan for a later time in the eh recovery code and wait for eh to complete in the rescan worker. Signed-off-by: Raghava Aditya Renukunta --- drivers/scsi/aacraid/aacraid.h | 4 ++++ drivers/scsi/aacraid/commsup.c | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index 70e03ed..9b678f7 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -41,6 +41,7 @@ #include #include +#include /*------------------------------------------------------------------------------ * D E F I N E S @@ -2655,6 +2656,9 @@ static inline void aac_safw_rescan_worker(struct work_struct *work) struct aac_dev *dev = container_of(to_delayed_work(work), struct aac_dev, safw_rescan_worker); + wait_event(dev->scsi_host_ptr->host_wait, + !scsi_host_in_recovery(dev->scsi_host_ptr)); + aac_scan_host(dev, AAC_RESCAN); } diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 48b5234..adebf2e 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -1671,6 +1671,15 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type) aac->in_reset = 0; scsi_unblock_requests(host); + /* + * Issue bus rescan to catch any configuration that might have + * occurred + */ + if (!retval) { + dev_info(&aac->pdev->dev, "Scheduling bus rescan\n"); + aac_schedule_safw_scan_worker(aac); + } + if (jafo) { spin_lock_irq(host->host_lock); }