From patchwork Wed Dec 27 04:34:40 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: 10133411 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 DB0C76037D for ; Wed, 27 Dec 2017 04:35:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C39AC2D864 for ; Wed, 27 Dec 2017 04:35:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B89F92DA5E; Wed, 27 Dec 2017 04:35:29 +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 1B26D2D864 for ; Wed, 27 Dec 2017 04:35:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751799AbdL0Ef1 (ORCPT ); Tue, 26 Dec 2017 23:35:27 -0500 Received: from mail-cys01nam02on0045.outbound.protection.outlook.com ([104.47.37.45]:57152 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751832AbdL0EfQ (ORCPT ); Tue, 26 Dec 2017 23:35:16 -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=3oGZZDtjlZ3Ak5aXeshkqfn2UdQaEhiIrVwDprTjzko=; b=R7Z6ZW9HIL7H/uXIDPM9lDJZDKnONjq4sJ3HfhZLX3eUgy2eUldOg7PjVktVX9UZ9+RYgft4qfhc6DjmyId8oehdn+E5RIBCRM8YYDpBUhqRUh+AXxzyaN1re/Pc0WqGW8AUMhz7+MLBRvrvS19sf+2RMryq7V/jlLfkzl5PnRU= Received: from MWHPR0201CA0047.namprd02.prod.outlook.com (2603:10b6:301:73::24) by BN1PR0201MB0737.namprd02.prod.outlook.com (2a01:111:e400:56::24) 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:14 +0000 Received: from BL2FFO11FD050.protection.gbl (2a01:111:f400:7c09::115) by MWHPR0201CA0047.outlook.office365.com (2603:10b6:301:73::24) 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:14 +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 BL2FFO11FD050.mail.protection.outlook.com (10.173.161.212) 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:55 +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:58 -0800 From: Raghava Aditya Renukunta To: , , CC: , , , "Guilherme G . Piccoli" , Bart Van Assche Subject: [PATCH v2 19/30] scsi: aacraid: Process hba and container hot plug events in single function Date: Tue, 26 Dec 2017 20:34:40 -0800 Message-ID: <20171227043451.27813-20-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)(346002)(39380400002)(396003)(376002)(39860400002)(2980300002)(438002)(199004)(189003)(4326008)(81156014)(305945005)(5660300001)(48376002)(50466002)(8676002)(36756003)(1076002)(106002)(2950100002)(53936002)(76176011)(6666003)(2201001)(69596002)(59450400001)(97736004)(86362001)(72206003)(51416003)(16586007)(54906003)(478600001)(50226002)(104016004)(106466001)(2906002)(8936002)(81166006)(110136005)(316002)(77096006)(57986006)(68736007)(47776003)(356003)(76506005); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0201MB0737; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD050; 1:/AGyxmmHDyGiASkIBIy0FKq8XSI+LUrRFJhLnsEGAldn2+ZNvzsGSaG2qPB5gRwTk3M3Y7pzYcq5Eo1OOb7zsrXSnJgR0Owo8PG57JaGGFimMZUj94DhmGiFnrB2O+Ae X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 28dbff2a-f624-4e52-71a4-08d54ce32de4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(4608076)(2017052603307)(7153060); SRVR:BN1PR0201MB0737; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0737; 3:z1iA7n/lreIwdsPKDdwP++fFIup3AYe3E5BH04ysJGIY1rRu21OMmJ4CiYl1yOfDXe6TdPLJRORwZJrHtRSPIXMZ6DDLvp0GAeqE+lGhZ4lxftGmH4AghxP7/ab1//V1IjE/irHl+rRTJVuWm7HzOxXQjgKjkdHejM1CC4TaddH/j9axv73IMMKOKa9IVFzgIxlBEvQsPBuTQx83PfWL1uY5y8XrsbtCWuoBOK3YKHPaIOOqwd35gNPJOgsopDS2v7qZpEor98nuUHdfwJqevh884Wv+3mfm46q8vI4zE9/EsX6Wbd8WcE+vLyDXb7z2wsbx1uI8pz+fs+2gicvOi+frlBT1VTsKl88MJz8/gWY=; 25:wZhH7mRNb1RFJ99abm1agQ/3iaolKinqFZDsiy7Fso7BTzTi4cDR6M31Qe+bZm+ESNidBpxjp9hOieNZjEenvnZAK74HapJiLpybz05RoOKa2UmcmRtEZ0TN1iQbP1LQIYd7NF6kpwNR92k9VibEKSCdjyCo9Ug8ZUtloc+sysXYbxfTFIWKIJnFJwaewfexG/znbEKo9RAKFU/im20RIbMxPxMc4rQL6W5eat8rR6H8NxP2ROfo0+gqMZFxvpbNvJZ1dOuwnh+V7hPqHn5sVZckHVNM5K6a1McHJhGoujMnb3wRyjOyoiZLV01W6ZZlT3c5Hbf9RBP2+eaWwjSoc1EM+1I6tpgMONLomvNo7oE= X-MS-TrafficTypeDiagnostic: BN1PR0201MB0737: X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0737; 31:KqOa5vWHotEB1hAg/SlgwZ3Is7cp0QuEtV1JGviwxRIKrKd5sJtUDTfpEXCEeoxxpmUbwhh9RlPAPGllVLspa1W4JsFQhowA8JuzezaJrvtMcEth4kXhaLd0URaqJ2txRjPevmdX3GoSkr8kbxUIcQQI1yITXU0BC9wwODzqDAuexgTjxE5xogv0jky6hCwebncAfyVhazyOwmi42libtjiGBpZEUiowr90cUsENqr8=; 20:9u8QIkUomTFxtozFZbcxQ5eiM2UXrNldEQCIWLK8UvA5KcWgpVEsVwpVq1eA7TA+PJAHriQKPvshLRvXqN0bu28yTsOWUxN5PdythcqXBfsFBE9pTY7qb1MITwzrdr+SJORVwn1J9F9T9I/tlUVYE3ZKQJ/sMu8o4+j+nsMrxEs4oXRRchd+uishW3TXBVl3WtWvJl/wr8jZKvWbe/knaZhXw3okwZesbpC4wp349+rWHKPFLjctcax7lhLBvkRE2KhJ7LSyuyYqBmjnFe/EyZ3fEqk3sFXANQg3W5tWbhYkm/XKYqPBgglFBFYxGzflHBCJR36xrikpuUlh2OzMS+oK3h4CVH5ecq8nB5zofhTEBoK/d+92nIiogJwwOJ6TptmZIl7GFfJT3doEHrEwcDMaoMC2UfkehWKzkxC/K8bQX+/kGii3LUh5jCn7HtYnlBH3NVvl3DoKLJNZ+x9h9OetcyQ64DtHrgf9HkyP8Q3HvJXCx8aSVmxmVdx2N3mdYLi6vlCuyjPa0CNm0gnDtdl6IqjakgwjsAw6Sgrl13nPys7QwNc4Sa6RQBeqEzEIz6P0AlhtZUV1LLczFwavIwilsiFv5dyXCy4Ka4El07A= 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)(3002001)(10201501046)(93006095)(93004095)(3231023)(944501075)(6055026)(6041268)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:BN1PR0201MB0737; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN1PR0201MB0737; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0737; 4:LHa4snyDaEj2tf6ULGGSTYGv8y1ozhEuRqIacEeHggAo8ivBdiG12bvrpSRTx/L1BikysX3Uril+r/9Y+mQ+/LLPv/KgyWYebU41Osh0lpWbPSW8oIS+g0AszacAzwVriysajo6d8QZtJxJ0po+IXsf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k+25uyM7cjlqYy+0qy6sMfZFqPunF50eFWfpi7Xj5UQ30cX4JkyJXKfhAJ1VQ5I=; 24:k5iZCagrfAVu6LCPaDYS1XtKYBDPumovTb53+jyAs+e+9ICUCNJXkEPSHBba8olCs/zlajv+Zr1bHAiZ2zgl5MMwqGpzDfNIHKFfQrQDcvE=; 7:osEFydQmypg1yNlN0/6LT8QZyR26tkTBBuC+FfPBwU3Np9PYD0sHpSUrDFfSgE++Rkd+AWr1YUWX5LwfYTsj02c8IRI3vwhypSx59nc4783xb7Kl5kgqOP6NAEgg/W7r+cf9wAc+ZYESNAc75dJv8YrxQOAV4jgvtTKPrFh1d0+hdZ0FAnTI/tYmcUPI5YtKd6wvfg42EdWcFt4XcjuSnm/lVDxBl/1AWkGqBzfjOOPd/jZQGqNd4kaucoc608bj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2017 04:34:55.0750 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 28dbff2a-f624-4e52-71a4-08d54ce32de4 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: BN1PR0201MB0737 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 --- Changes in V2: None 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 c30f7da..4ad9d3f 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -1982,6 +1982,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); @@ -2007,13 +2009,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: