From patchwork Thu Dec 21 17:34:15 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: 10128147 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 B9CC56056F for ; Thu, 21 Dec 2017 17:35:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A84B929CE3 for ; Thu, 21 Dec 2017 17:35:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BF0829D38; Thu, 21 Dec 2017 17:35: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 1C8C129D37 for ; Thu, 21 Dec 2017 17:35:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754599AbdLURfv (ORCPT ); Thu, 21 Dec 2017 12:35:51 -0500 Received: from mail-co1nam03on0062.outbound.protection.outlook.com ([104.47.40.62]:7592 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754695AbdLURfD (ORCPT ); Thu, 21 Dec 2017 12:35:03 -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=FZT8vg65kgz3K/RBNxv0dztZDqJTKfwUDrmBT/7PYks=; b=B0QeNbe27mOYgSf1SDwr5IO0CU+u12a0tyQIWgQ6X3cJe9SQ8jR5RZFb23dE+Z93BNeMCc8sQVXHQOPwYwMF3M2sTzTdNY77E7gvfo5i0LFvq5kcTUM1W5c8MHKDhAY1mwKCUTkQjVkRxATqO0S8oYJwT15Jz8sYpME0DJn7kfA= Received: from MWHPR02CA0045.namprd02.prod.outlook.com (10.164.133.34) by BLUPR0201MB1828.namprd02.prod.outlook.com (10.162.239.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Thu, 21 Dec 2017 17:34:50 +0000 Received: from BN1BFFO11FD036.protection.gbl (2a01:111:f400:7c10::1:195) by MWHPR02CA0045.outlook.office365.com (2603:10b6:301:60::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.323.15 via Frontend Transport; Thu, 21 Dec 2017 17:34:50 +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 BN1BFFO11FD036.mail.protection.outlook.com (10.58.144.99) 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:35 +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 24/29] scsi: aacraid: Use hotplug handling function in place of scsi_scan_host Date: Thu, 21 Dec 2017 09:34:15 -0800 Message-ID: <20171221173420.8213-25-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)(396003)(376002)(39860400002)(39380400002)(346002)(2980300002)(438002)(189003)(199004)(76176011)(48376002)(16586007)(50466002)(2950100002)(8936002)(59450400001)(50226002)(51416003)(356003)(2201001)(77096006)(54906003)(81166006)(305945005)(110136005)(1076002)(106002)(316002)(47776003)(69596002)(86362001)(81156014)(8676002)(97736004)(6666003)(478600001)(76506005)(57986006)(104016004)(72206003)(68736007)(36756003)(53936002)(106466001)(4326008)(5660300001)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0201MB1828; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD036; 1:2o4PWqiosKlC4sSeQ00H6TLHvcL7tavhprn8Eh5dZG0JKlo42h9A/xeWZmllivUvJvKeI4Or//dKI72CM3olcKy4fmjzHoUyFveN+VnwbmFMY9wx3u5q8LSxeedzEIit X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d3f34ab4-3889-4924-f368-08d548991acf X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4608076)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307)(7153060); SRVR:BLUPR0201MB1828; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0201MB1828; 3:h+hZD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WqMsMYZF3tL5LB1sixnaSy/HuuGQT4ZCN9NSFY2jUjTZ0R6K3h5FNhovHDDMpu437Od5LUWBDkLHjVFJeBp6b8lCFNxp80P77k8PWQNqdgKvEV5hP9CUyXe4nKIYhiCEGqK2DmOxxlsYvfnkmi4vgYUySw4BG4OGaWM3gw4KwJMD5OyrDc4rILIbV/RSY774tvY+AVHTqPNmtglHqQOZ282EzmpLUCiYWJ6aKT0v8M5qdnQ3U7OYc1lEU98dzIJXt80r7c8WBnaA4asbzrskeB8O6k3H+PSkoMTvmVD3HDL/eaHwB+yDvCpX6r9su6o+Ra6KzduFqZ/gLDdRhQuFP3ogi2uifLIxo4rwRuGVMSXer8UnqGol8dHaiCStqxeW0unqKjol1iXB8Uwj+PfgrdNufRVbFyh0+8wOM+u+sc/v+W4R4jBLuceaIFR6bmxxNUQqxc+WeGM6ap/ehtR1LVQHbx8PtFvBwzG6KSIIPfPhiVCf5lFpMdsYNAf/vdWL7ORNXaTNYHWayId7s7Q10soO+iC9dz6/zmKO5pp++sgltohtkj2S0= 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)(3002001)(10201501046)(3231023)(944501029)(93006095)(93004095)(6055026)(6041268)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:BLUPR0201MB1828; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BLUPR0201MB1828; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0201MB1828; 4:Vf3Vox7WL0Ay4rNPu6Aek7/haLm4zNk49e/hP+sSCguLapoDTTv/lCx+kha3F0ZMo9nuEOD/8e7TAep5uCxHFqpomnL607FENFjBzrhVe0ckZ0Yq5jJwbH4c0yvnRUPekMsgpjTPH4BQMQWuMo4ec+SravfCBlOegPA0480zgNO30W6nKSGui0sA7OFT9KIqVqauGRG8ncG79ZBGwQlUGGnlLfYGOCSQZZNxUpNtBCp1eQ9mb/hUizPn4/YQGG+RheL/dL4Q/nFtTOqDwGD9WQXvaJ7zDngA6ZgoyQ3jqvvPdLvKjwpf/o7ftN7UrBZI X-Forefront-PRVS: 0528942FD8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0201MB1828; 23:cDpHsZ39OLlAx3Q5swgW+ZZKxunvTE/UipiBSJh?= =?us-ascii?Q?RdVyIUBHMcg4Du667v4NzIXUo+mIx7MpWonUETk33wcg4xiCBzxKyM/jo4Jk?= =?us-ascii?Q?LR7PNms5p++m3s77kKDk8W49oG1ZPjWc0IB1olI26km7HSp/bMzq2aHTSNTi?= =?us-ascii?Q?+pxDQkb3nnmIdTlxp7F+QiY5Zec8XuNnId6QPKeQzQMM6pyHSt0NjSvr4cY0?= =?us-ascii?Q?vKRDihFEGyabrN9MjTuBdkA280f34Hz/88FPO+CMUPYHFZFvsvXNNDrKb0+j?= =?us-ascii?Q?kirw25/UzO4UOQzf2d9nIqOXjJBbC/ctfHAecD34LHYLlqWYfCYK02yTfc29?= =?us-ascii?Q?2xj+BfhY2W4vAbH5oZoFvbY9EDRGo6/MEJNPXBhDhF1v62uo+EyKj6MOILCx?= =?us-ascii?Q?I7apPd+dll01+SxRK9UVectNXXpYWLTODEfRd26YwhX3L3VXM6no3qUmkxh0?= =?us-ascii?Q?Gese8bHyk7TmmnaYtS8dn5letS+vuv7woHFxLnNgzilxGh7LvWyjpDOUkSri?= =?us-ascii?Q?hhMZzTx88oQlfhPwPdD7o5TnUHp1XQ40X/CtgSYe+W7ZJn2ehBV05NpJBQ5P?= =?us-ascii?Q?LBW0EnhigkoTVR2pB/nZgr6N2kISBCrv6kZMX9m1/TycZYhtIr87CTIK0aBg?= =?us-ascii?Q?1Sn8/mCkyxgboGsa9grk8LRiOdm3EYSE8SAvmJrNrnYInVtGfigmWKKoeW1B?= =?us-ascii?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R0Y/bPBygkXd95EUZ6tov2anwHn2dxA99yN9tXxQXbtU=; 24:m7n4qKQjKy5Ry5lGw9UC3ovkzOw/rkOppiDr0kWERFeuygjsEF1vpAD4pysL1YmC1a/VGGzsBJ22nGiIBCDKOPrx2iNn5efwEcqSsnnCftc=; 7:K8JIVerhjmouQK8zgxH+fQpqFTTmbkAIpSp+0QKiOY3KcSxBhWg2S4oXHFUcSHa5ivsyhrNZFK68R6T9BGnweJzn22nOJLjbVk3ZAZr4QyfeqHNOHm2sCeOHDwzBajJGvk2BO4fgWbwzfHBIsoh0i1uhc+B1CZp0gQIfFHxVhpONUj2VTDa87a5P7E1iOLNRZc9rS86m+BmJudPhhcF0hHFQ2+ER53Ent9dy3NAuH0NClsUlFvmxGCnHvqRm4GB4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2017 17:34:35.6549 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d3f34ab4-3889-4924-f368-08d548991acf 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: BLUPR0201MB1828 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 Driver uses scsi_scan_host to add new devices in the driver init path, which adds all the fw exposed devices. The drivers resorts to queue command checks to block out commands to _hidden_ devices. Use the hotplug handler code to add new devices during driver init and other areas, this is only for safw. For ARC scsi_scan_host will still apply. Signed-off-by: Raghava Aditya Renukunta --- drivers/scsi/aacraid/aachba.c | 4 ---- drivers/scsi/aacraid/aacraid.h | 1 + drivers/scsi/aacraid/commsup.c | 18 +++++++++++++++--- drivers/scsi/aacraid/linit.c | 5 +++-- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 74f1dd2..eef7322 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -2161,10 +2161,6 @@ int aac_get_adapter_info(struct aac_dev* dev) dev->maximum_num_channels = le32_to_cpu(bus_info->BusCount); } - if (!dev->sync_mode && dev->sa_firmware && - dev->supplement_adapter_info.virt_device_bus != 0xffff) - rcode = aac_setup_safw_adapter(dev, AAC_INIT); - if (!dev->in_reset) { char buffer[16]; tmp = le32_to_cpu(dev->adapter_info.kernelrev); diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index c70c998..ba84d99 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -2719,6 +2719,7 @@ static inline int aac_supports_2T(struct aac_dev *dev) return (dev->adapter_info.options & AAC_OPT_NEW_COMM_64); } +int aac_scan_host(struct aac_dev *dev, int rescan); char * get_container_type(unsigned type); extern int numacb; extern char aac_driver_version[]; diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 698c049..46ee7ba 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -1968,6 +1968,19 @@ static int aac_update_safw_host_devices(struct aac_dev *dev, int rescan) return rcode; } +int aac_scan_host(struct aac_dev *dev, int rescan) +{ + int rcode = 0; + + mutex_lock(&dev->scan_mutex); + if (dev->sa_firmware) + rcode = aac_update_safw_host_devices(dev, rescan); + else + scsi_scan_host(dev->scsi_host_ptr); + mutex_unlock(&dev->scan_mutex); + return rcode; +} + /** * aac_handle_sa_aif Handle a message from the firmware * @dev: Which adapter this fib is from @@ -2001,9 +2014,8 @@ static void aac_handle_sa_aif(struct aac_dev *dev, struct fib *fibptr) case SA_AIF_LDEV_CHANGE: case SA_AIF_BPCFG_CHANGE: - mutex_lock(&dev->scan_mutex); - aac_update_safw_host_devices(dev, AAC_RESCAN); - mutex_unlock(&dev->scan_mutex); + aac_scan_host(dev, AAC_RESCAN); + break; case SA_AIF_BPSTAT_CHANGE: diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 2c862cd..7ea7b2c 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -1787,7 +1787,8 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) error = scsi_add_host(shost, &pdev->dev); if (error) goto out_deinit; - scsi_scan_host(shost); + + aac_scan_host(aac, AAC_INIT); pci_enable_pcie_error_reporting(pdev); pci_save_state(pdev); @@ -2071,7 +2072,7 @@ static void aac_pci_resume(struct pci_dev *pdev) if (sdev->sdev_state == SDEV_OFFLINE) sdev->sdev_state = SDEV_RUNNING; scsi_unblock_requests(aac->scsi_host_ptr); - scsi_scan_host(aac->scsi_host_ptr); + aac_scan_host(aac, AAC_RESCAN); pci_save_state(pdev); dev_err(&pdev->dev, "aacraid: PCI error - resume\n");