From patchwork Thu Dec 21 17:34:10 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: 10128127 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 CB9B760318 for ; Thu, 21 Dec 2017 17:35:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7A642847A for ; Thu, 21 Dec 2017 17:35:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9D5429D37; Thu, 21 Dec 2017 17:35:31 +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 0B9F32847A for ; Thu, 21 Dec 2017 17:35:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755114AbdLURf2 (ORCPT ); Thu, 21 Dec 2017 12:35:28 -0500 Received: from mail-sn1nam02on0070.outbound.protection.outlook.com ([104.47.36.70]:57584 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754375AbdLURet (ORCPT ); Thu, 21 Dec 2017 12:34:49 -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=0o0J5vxSbHsTIdOMufN6K7V2Vk3t5pAJS/kdtB2TBLw=; b=Ssss72O8tv7qrSvkUKYzNK9600rqTTDMfwYhaxuFQwoK/TFuycbAGAI5mo+SKiGA8fE9cSpBAg0N4K0tHzWU77SREjdXrhhNpvbtqgvx+gpCCuu/QrekSOrwQ/8WCYwL2Gv41yxQvDuzTHly0Ua1uGYSa23melpxBPRRhodQfsY= Received: from MWHPR0201CA0061.namprd02.prod.outlook.com (10.167.160.38) by BY2PR0201MB1832.namprd02.prod.outlook.com (10.163.75.22) 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:46 +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:46 +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:31 +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:26 -0800 From: Raghava Aditya Renukunta To: , , CC: , , , "Guilherme G . Piccoli" Subject: [PATCH 19/29] scsi: aacraid: Process hba and container hot plug events in single function Date: Thu, 21 Dec 2017 09:34:10 -0800 Message-ID: <20171221173420.8213-20-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)(376002)(346002)(396003)(39860400002)(39380400002)(2980300002)(438002)(189003)(199004)(50226002)(8676002)(86362001)(305945005)(48376002)(50466002)(81156014)(81166006)(97736004)(2950100002)(77096006)(6666003)(356003)(4326008)(8936002)(53936002)(76176011)(76506005)(68736007)(51416003)(57986006)(316002)(69596002)(54906003)(16586007)(110136005)(5660300001)(106002)(47776003)(2201001)(59450400001)(1076002)(2906002)(106466001)(72206003)(478600001)(104016004)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0201MB1832; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD012; 1:TVeZSSHXcwaXTRgKpNPc/Ru1fgIqJmX6c5MUueCksm860Oy7I4qTg1cA1kfMNjnMdtugz/GI2/GoWPKpUZDT6+hv/vK17OxL+1uJp1EkHUj4teLwkDgwjE+hDm+e5a15 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 573965dd-a5fe-4ea8-eeb1-08d548991895 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4608076)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307)(7153060); SRVR:BY2PR0201MB1832; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1832; 3:6qs+P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B3j2PXWz0wJsqPUNlKWGLRprJA5q93Dfg01D3rGqpiQlc4KBBdF5AlRmLzShs3i1lIl5mKC091R8WxA9U61I86dG08XTibgmWMWueQ4XyaEYVrIMLm8U2GwNbTr8uxmFt4RTR+NcMMExzTabaP7KfpdPZIQ3iTc/TJIjfEmBhA7gKwv5Z/NsP6mr/Vrjvu6S/sAqxmhZHsbfjh0S/4K0ONshN4cQa4gra1fas3gcpsaZFph+UU3N5ESxXw2m01s4u199Txx+4VuQomK3pjBY90ihsU19axeJEHvJu6jtXruWmsQO3Zx8bwhX2AkKiH+ZKQLgAM7PrTBIHOIC6Ixh7kJmDwgSv3BV9/8QmQLpJxVMqSdvyW2JBC/9I+CB+f9IsLuka4ccF+h/9r6pKMcAZoKG4xk7eQX9BJp/M1QEDD7iI9yZGVHbMok9WEDN346rlbFGMob4TXz1vBbh+mOcI90MJ3tD6yBStGSAdhN179mOXKp2yfrRZ+QrWjBXMYzY1a0+eotYVuCYjVHhL43FHmDvOwVcsKeLo= 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)(93006095)(93004095)(10201501046)(3231023)(6055026)(6041268)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:BY2PR0201MB1832; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BY2PR0201MB1832; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1832; 4:2U0TzJThZbB9UGQc9oNnjY+ZDdlWWEop8J2XvhEuEoSe3qyHJ6nRBc4rseCi+6x6JEYEXam+mLzwE1nIVpSOE46h5c85BO2BBybM6LGxSt6iPZXdD2fINpKVeR8zXxiUgWz0Qm7rJ5cD/4dSEw5D9qMF6uys7kt2r+qTLJWh2+AO8Id5rPrfwEqmeDWFJDYTm8rGEwM0EHcC8oOgkf7FGEwtxxnY2/tFAMdsexvAS32zl2IfXDS9CTLNdfdm8xjojpp0hh6Tcd7oGIceF4r6sCfiiKeW47n/Y2QqqwyPmsIohNltL+IU5OIcA/pMjOfp X-Forefront-PRVS: 0528942FD8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0201MB1832; 23:eyafqrjT0LIGNRbawbnb+5Q7VmB3uHRMIHlWHq+?= =?us-ascii?Q?5Ge2pG8E+lo3zNy6fAsBllCCPam66vsHuWYNVw+qA29rNN2ymUrEcd8trFOR?= =?us-ascii?Q?UUA4yyjRWYMAFNlr7TuHKiLmfIDJ4CugPIblrqS2as1v8GJCz4+HzQ09S1TA?= =?us-ascii?Q?KwEKBDZYj/PWCxj3YYZ2r3xoEVuMzHriH7YdhwZDGe34bU3DwkhYsllxtyth?= =?us-ascii?Q?vGsj33IZiJK+pLaFf3QwrWSMj31kmzALTvve+29k6B/oib/gBN8gBv1p6KwO?= =?us-ascii?Q?FxsxyMNlE5VIpf1lNK6LHkoXlbB0WBn5rL/Rfz/hTnUTjAMJuw5rM71DjX18?= =?us-ascii?Q?0h88IwLbW9NKcQ+84d9xctJLWWM6KL1FO32kgAVABz/shg4eV6LIBqls3TnX?= =?us-ascii?Q?gYvpfnDNmkTe4BfW50P1WDc6WCjbCObLlH4LmWzanQDFVV/kEqJ5Lg+dqut+?= =?us-ascii?Q?a1j+j85x18YI8jM5cXP/eSx1Wn+jEqLwLb8qkVjMWzjxRZtSkW5fJLFqg12x?= =?us-ascii?Q?/e9ETmJBi6S7lm9PV1TrVAIQZ19x+rh3wenWfdA/iLIL50bCed4yLlqd+iFD?= =?us-ascii?Q?ANrcf/n/5gOyNDmjd0OFXOejlTtCxeWIE8TcTpje19C+hhJ+MSZPKDP7mNT/?= =?us-ascii?Q?5JtX+NQkOOSe+rQkFsDqaOqagCKkoZvKhv0VC4f7aTAqSAPniZt4/P70JAyA?= =?us-ascii?Q?zNNRE6z0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lwm87dCnsYotqbv10CnorwT42A=; 24:1SX7F2q6/EDOfrBvIaLMMc32lpcI4pfw17UrbqfAqQ7O4XYih6Cq1clO1Met/sUH6HyHl3OQ9nPoxZJYprDiGdWd2K8RG7oI2WjeuC/4EYI=; 7:JKCCCu8CozX6m1Lx1a4+9mhSpluUlMdaC8EldautaSkzhlLbsoo7IacaFIA7BB37BLacchLXzbZ8WNrcq6WnRDiJaLfo2COU/U/tcJ5vgBpc3MeuikoprkzE1v4OsxbcM7U6uB8zZl6F+oWBMh4B+JRDD0GHAHANgkyVANH1/g67ZavuqDJ8YkmmZhIicPPxeBXutwWn2RYTWqRQpWV+h/3QJ/NmktOMUd1H8ZP8SCnhsJmGrcZi6D3F/4/zaLvO SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2017 17:34:31.9036 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 573965dd-a5fe-4ea8-eeb1-08d548991895 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: BY2PR0201MB1832 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 The hotplug handler code is duplicated for hba handling and container handling. Merged function to handle hba and container hot plug events into the resolve luns functions. Added a bunch of helper functions to check the validity of a given target and to check if bus, target is container device. Signed-off-by: Raghava Aditya Renukunta --- drivers/scsi/aacraid/aachba.c | 9 ++++--- drivers/scsi/aacraid/aacraid.h | 3 ++- drivers/scsi/aacraid/commsup.c | 59 ++++++++++++++++-------------------------- 3 files changed, 30 insertions(+), 41 deletions(-) diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 7f6036c..74f1dd2 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -1993,6 +1993,8 @@ static void aac_set_safw_attr_all_targets(struct aac_dev *dev, int rescan) lun_count = aac_get_safw_phys_lun_count(dev); + dev->scan_counter++; + for (i = 0; i < lun_count; ++i) { bus = aac_get_safw_phys_bus(dev, i); @@ -2018,13 +2020,12 @@ static void aac_set_safw_attr_all_targets(struct aac_dev *dev, int rescan) } else devtype = AAC_DEVTYPE_ARC_RAW; + dev->hba_map[bus][target].scan_counter = dev->scan_counter; + aac_set_safw_target_qd(dev, bus, target); update_devtype: - if (rescan == AAC_INIT) - dev->hba_map[bus][target].devtype = devtype; - else - dev->hba_map[bus][target].new_devtype = devtype; + dev->hba_map[bus][target].devtype = devtype; } } diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index b1a6045..17c6cdd 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -1340,11 +1340,11 @@ struct fib { struct aac_hba_map_info { __le32 rmw_nexus; /* nexus for native HBA devices */ u8 devtype; /* device type */ - u8 new_devtype; u8 reset_state; /* 0 - no reset, 1..x - */ /* after xth TM LUN reset */ u16 qd_limit; u8 expose; /*checks if to expose or not*/ + u32 scan_counter; struct aac_ciss_identify_pd *safw_identify_resp; }; @@ -1669,6 +1669,7 @@ struct aac_dev u32 vector_cap; /* MSI-X vector capab.*/ int msi_enabled; /* MSI/MSI-X enabled */ atomic_t msix_counter; + u32 scan_counter; struct msix_entry msixentry[AAC_MAX_MSIX]; struct aac_msix_ctx aac_msix[AAC_MAX_MSIX]; /* context */ struct aac_hba_map_info hba_map[AAC_MAX_BUSES][AAC_MAX_TARGETS]; diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 9625eb0..ed79159 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -1869,13 +1869,29 @@ int aac_check_health(struct aac_dev * aac) return BlinkLED; } +static inline int is_safw_raid_volume(struct aac_dev *aac, int bus, int target) +{ + return bus == CONTAINER_CHANNEL && target < aac->maximum_num_containers; +} + +static inline int aac_is_safw_scan_count_equal(struct aac_dev *dev, + int bus, int target) +{ + return dev->hba_map[bus][target].scan_counter == dev->scan_counter; +} + +static int aac_is_safw_target_valid(struct aac_dev *dev, int bus, int target) +{ + if (is_safw_raid_volume(dev, bus, target)) + return dev->fsa_dev[target].valid; + else + return aac_is_safw_scan_count_equal(dev, bus, target); +} static void aac_resolve_luns(struct aac_dev *dev) { int bus, target, channel; struct scsi_device *sdev; - u8 devtype; - u8 new_devtype; for (bus = 0; bus < AAC_MAX_BUSES; bus++) { for (target = 0; target < AAC_MAX_TARGETS; target++) { @@ -1885,24 +1901,19 @@ static void aac_resolve_luns(struct aac_dev *dev) else channel = aac_phys_to_logical(bus); - devtype = dev->hba_map[bus][target].devtype; - new_devtype = dev->hba_map[bus][target].new_devtype; - sdev = scsi_device_lookup(dev->scsi_host_ptr, channel, target, 0); - if (!sdev && new_devtype) + if (!sdev && aac_is_safw_target_valid(dev, bus, target)) scsi_add_device(dev->scsi_host_ptr, channel, target, 0); - else if (sdev && new_devtype != devtype) + else if (sdev && aac_is_safw_target_valid(dev, + bus, target)) scsi_remove_device(sdev); - else if (sdev && new_devtype == devtype) - scsi_rescan_device(&sdev->sdev_gendev); if (sdev) scsi_device_put(sdev); - dev->hba_map[bus][target].devtype = new_devtype; } } } @@ -1917,9 +1928,8 @@ static void aac_resolve_luns(struct aac_dev *dev) */ static void aac_handle_sa_aif(struct aac_dev *dev, struct fib *fibptr) { - int i, bus, target, container, rcode = 0; + int i; u32 events = 0; - struct scsi_device *sdev; if (fibptr->hbacmd_size & SA_AIF_HOTPLUG) events = SA_AIF_HOTPLUG; @@ -1941,32 +1951,9 @@ static void aac_handle_sa_aif(struct aac_dev *dev, struct fib *fibptr) case SA_AIF_LDEV_CHANGE: case SA_AIF_BPCFG_CHANGE: - for (bus = 0; bus < AAC_MAX_BUSES; bus++) - for (target = 0; target < AAC_MAX_TARGETS; target++) - dev->hba_map[bus][target].new_devtype = 0; - - rcode = aac_setup_safw_adapter(dev, AAC_RESCAN); + aac_setup_safw_adapter(dev, AAC_RESCAN); aac_resolve_luns(dev); - - for (container = 0; container < - dev->maximum_num_containers; ++container) { - sdev = scsi_device_lookup(dev->scsi_host_ptr, - CONTAINER_CHANNEL, - container, 0); - if (dev->fsa_dev[container].valid && !sdev) { - scsi_add_device(dev->scsi_host_ptr, - CONTAINER_CHANNEL, - container, 0); - } else if (!dev->fsa_dev[container].valid && - sdev) { - scsi_remove_device(sdev); - scsi_device_put(sdev); - } else if (sdev) { - scsi_rescan_device(&sdev->sdev_gendev); - scsi_device_put(sdev); - } - } break; case SA_AIF_BPSTAT_CHANGE: