From patchwork Wed Dec 27 04:34:33 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: 10133405 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 C4A616037D for ; Wed, 27 Dec 2017 04:35:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD6952D864 for ; Wed, 27 Dec 2017 04:35:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A24CC2DA5E; Wed, 27 Dec 2017 04:35:24 +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 3402E2D864 for ; Wed, 27 Dec 2017 04:35:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751855AbdL0EfW (ORCPT ); Tue, 26 Dec 2017 23:35:22 -0500 Received: from mail-sn1nam01on0058.outbound.protection.outlook.com ([104.47.32.58]:39984 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751815AbdL0EfN (ORCPT ); Tue, 26 Dec 2017 23:35:13 -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=ncSQUTxt/Zc21rwaLyexAFR+wqZqurNKuIwLRGTa+I4=; b=Hpo9bGbqdexB0TbvOlBz4Lee1XKU+IeL2fIgYJ7GjH3KZP3bvjr8RAW26FG85qZ91pRyHluCWK8D7uvt/zxTTrpZkjoIbsn4rnug+3kKUm/AS9sWLYzuuVp6wT1don0OeVX7M635IDDAD0o4SLlcXhMEI6+M4SXXvq1eE4ilKKc= Received: from CY4PR02CA0006.namprd02.prod.outlook.com (2603:10b6:903:18::16) by BN1PR0201MB0739.namprd02.prod.outlook.com (2a01:111:e400:56::26) 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:09 +0000 Received: from BL2FFO11FD049.protection.gbl (2a01:111:f400:7c09::140) by CY4PR02CA0006.outlook.office365.com (2603:10b6:903:18::16) 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:09 +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:49 +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:56 -0800 From: Raghava Aditya Renukunta To: , , CC: , , , "Guilherme G . Piccoli" , Bart Van Assche Subject: [PATCH v2 12/30] scsi: aacraid: Add target setup helper function Date: Tue, 26 Dec 2017 20:34:33 -0800 Message-ID: <20171227043451.27813-13-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)(376002)(39850400004)(39380400002)(396003)(2980300002)(438002)(199004)(189003)(6666003)(316002)(478600001)(106466001)(69596002)(53936002)(48376002)(104016004)(50466002)(4326008)(2906002)(86362001)(575784001)(47776003)(97736004)(2201001)(77096006)(5660300001)(68736007)(106002)(2950100002)(305945005)(81156014)(356003)(36756003)(8676002)(57986006)(81166006)(1076002)(8936002)(76176011)(16586007)(72206003)(110136005)(76506005)(51416003)(50226002)(54906003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0201MB0739; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD049; 1:vuCEEifFi0FVndmv8qj66bjE7Xd/8QSmWFvawt4xj/7aggUd8+r+zZt5iov21hqjmzeS80BOvXtvvtx1FmI4Z4khCyiWXfSzVUSnDbo1FV9n3sDtxkBJhltQU5LW1mVi X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5d8c3186-d929-451c-5920-08d54ce32adb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(4608076)(2017052603307)(7153060); SRVR:BN1PR0201MB0739; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0739; 3:TPVH/gGZMpWwuyf+jKIzMx6q2FbM3pQQRX2P+1q7Z3o0Z++it53dI5iLyRrrvUicqf53w5Q28T9tGGzVeEx0jvd9w00vp0oXzROz8ilpdi1TumYiWqUgohdh88aMx/UnGKuqSY4qMcrqcAFNBxJbaH+6Thdg2XANePcLbEQ/6tP52/idggPzgSVG4oFJO5AdnuXHNYmCljQRU48+eUCMH6q3TYJD4JJDSSwzFJYchva0IEXLhQjgFWo0UQCL59EdrL26AgD5NIq9KCJLEzwDKut6lYShzYvu1e5rOV099An/jUCd6FGjIYiM+UQ038nta+ZKa0x3VOilJixcOr5OdYCPL28tBreVl8GfN4IojKI=; 25:IuuuzpA5GcUHrdjlZ7SngVvKtrhtAh33ckL/KkCpxBWXW2pRDdNQtYfDJWDBsu2UZz88BX1EOka0MFBPk6CgSnaE61xHQQJTrqhARfg6Q0b97uegqydbFKg2tFubto7H5wU6WeG7pTymICWvzLkyTU/bif+UCeLGkMTqrP1HzOUjwAnkprIHqhqMEly/yXJBHKXhaNHethnk1LbiI1uHGJFIq1YFTdi5/lihUpmVCgFIgc9yNxlV85twSVAiDh/bgYbi0rsYT9SkbG8gKiKaIaik4mNGEDvCencgB+0d/2Mp6jWKRvp7plFEr2oiToMftDIUBbvSYigar4G/GZWNfg== X-MS-TrafficTypeDiagnostic: BN1PR0201MB0739: X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0739; 31:Zm2quhFKhLbAiB2jeXsKoZmFuTSUDxb6XCRNzpmx9ajp6Adk6E7FEuU/4TWvJxAna52unlTOnSdfKGILBKopfrqrEhEOnWfckbalLej3OrvcJwyjQ9qq2eXssxkkiTzCpYeLsiw7dVxwEVse23eVAlKrEvVDX7FkATOs9j/FX3dvucb3DDgLtGXNCxmjf03NSyxAxA47b7s82tC5qjmsTCUEYF34qbhCY3mQFIpsJNI=; 20:4LNqzYgiByanD8rg3JQD1x4zEKVUbSa5XOd1i3csIhqy9+vBgJ6l1V6aSCdxoIH394I2f6o5Nkd3acM5Zx7cwCnBKnLt507BxlLQ+6ZpHKcfsxp2kG02wM42kdMsOJF0bpTbceypgA3IWq39bTS/92/85z8N1NFtukBAcq2M3pPrA+fvy5zk36YLLlm91y9X8AOe7z6m5eiq74lHLlMugxaC0sWj0DSEAd2UjlKqZZkKsodOxK95XAtXXonmpHBgZtZuG0bLmWN+zOGCTtv1KdywpryJnn63m0H1k4cecKoPdgGgkvymL9J7Cq3SmnjAqP3STs00u6fybSb5dCb3XbppoEQfzJQplsABoFWtzZdJfWNPNsmHntfsHSJgVJss5BFUntR8ms4uT4MabECiuh5bXgt8W0cgQX2C59lggM+aT/1pnDqatyPQmkX6r+vt3ZX7hkxYcblu8rxr+/yqM+o4t/NJQccR2pvrFuWr+fgu/waj5UyYKjWIgPKThWyILpiHuuzdUf6rJmAH7uasFJJZbjQUESw1tdVZXOo8YL/NJcfz19PWIeVL1+WLIULzOPp+1JvRTQs3y4Qws8tW3+pe5j8twHcxML6VVgetawg= 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)(3231023)(944501075)(93006095)(93004095)(6055026)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011); SRVR:BN1PR0201MB0739; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN1PR0201MB0739; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0739; 4:uhqm9j8MKPK/XdrC9sIaL0iN/GHSsGJNUf2Ii+2bscGo3X8FJC4vCXajkiAm0vdIhFl8w7oMPyAS/qx8Eg3vVbWBbsSNhscaUin3Pa8YAhW7IYD6v3JkmsZFVFfpO5fNWvTDiDsV5H7XSuYkZxB/SXmHpjni6sXO1zF24bV2uN9qbtYffxto5PNK7JJtiJjfz8cQrpIjgqoWtCvo0439kLCKB/uqwVqrfqUWe38N3CK1df7NHyDX5wUF/Jx8W/34PI6tOi0TsFWgOvLw4HJWMojHhuD6RtV7bXkcTUpMtMnVT/rlqkQPh/eBDGAtZLFJ X-Forefront-PRVS: 0534947130 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0201MB0739; 23:TzjjUhlBcZsyVSbIEJmecbtrzskSO5V8JAJTIF0?= =?us-ascii?Q?ntpzmU9g6fYDEqyhFa8cI0jmBDVcqSX1ZA0nc8lReJV3vmmgzdb0Ho+1Y+Jw?= =?us-ascii?Q?tZEvQLAuWxAofg0p9TKaRXpv3EAIKolcC5HMy71T5iy9L6pxwSpEGBm4IVbE?= =?us-ascii?Q?7L1ZdBEyCtVecZeCeELGdFpovdz3tYbHB3zCYaeBb+UYL6CgdbOY6WSsXFAS?= =?us-ascii?Q?uT4VKbZoYs6WSGMpCKKpuxUqEEYdv5/F08M8tU8r2uxQH8IlyuMzTpXQppaD?= =?us-ascii?Q?qB8OEjdLHXNI8b/tHGImilb5jwLv5DHruj6+dDVrwwEWysFb/e+Jzgv3LzIc?= =?us-ascii?Q?FopUG6l82J16W3rVLUmE1KP126MsgUbhwwA8IV+wZw7pZU1eP48Lp0d87++w?= =?us-ascii?Q?a0tEZu1L26JOOQFc5384jMqbhzhf0GA49pAZoLFgAQzEYPGV6Kv9P32Wxpg2?= =?us-ascii?Q?+FxV0+s8yAPmOIQqVfNNnCCloztu13VJZkIs4YM14B4n/+cbgDfaiwbVnc76?= =?us-ascii?Q?PghQjhBCkGFq/o463aihr4Di8qniFNV58wZXrDk0eEZp0xcqk4DdgC5gG838?= =?us-ascii?Q?Ns9PFLfPtpDK0SojK9IPAvr28/laY6YW/QNm4/xFOlB2cpf/TJSYUAt6+hBm?= =?us-ascii?Q?UXjgyxej/i59gEHyQhypv77vs55Z2pypX4ZQ12qUvBnoSKnjkLbWArUGpaY9?= =?us-ascii?Q?0Sz9Y602632N+6swHvcAG1rp5KmrcUZmdTBMCY3em/xe95hweacj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Lx35gMsFRxbBRxZX81+yFxcDSCYYXhkqU1CX6F2eGjwwai/Sfdq8EoI7l9AU=; 7:3FPlLhVrH37Qfr1zfCSGE4++dWLZ8Du0ukLnGf4/KN4FgqXd2yGPfAnjE6dfGrurbPMqQJCtmNDhXP7HjTTIe1EuKLaWAZ7ipVaO5nYw0fsKiwZ6M/5kpQYy14zep9VKrlyWKTcJOR0ueSUbjeIQfgTf1lbDZpSzVacgZuWCaZnJClkhtfTSLtv6tPQAbrJwuhBJ9D55JPika0+DjfiMOcIYBBeePp7XNDVW3KEB6LXeJ3v3X210zNKEr2funj7B SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2017 04:34:49.9822 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5d8c3186-d929-451c-5920-08d54ce32adb 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: BN1PR0201MB0739 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 helper function to setup targets devices and create the base for the upcoming patches Signed-off-by: Raghava Aditya Renukunta --- Changes in V2: None drivers/scsi/aacraid/aachba.c | 18 +++++++++++++----- drivers/scsi/aacraid/aacraid.h | 2 +- drivers/scsi/aacraid/commsup.c | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 801aff0..5a95883 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -1860,7 +1860,7 @@ static void aac_set_safw_attr_all_targets(struct aac_dev *dev, * Execute a CISS REPORT PHYS LUNS and process the results into * the current hba_map. */ -int aac_get_safw_ciss_luns(struct aac_dev *dev, int rescan) +static int aac_get_safw_ciss_luns(struct aac_dev *dev, int rescan) { int rcode = -ENOMEM; int datasize; @@ -1898,6 +1898,16 @@ int aac_get_safw_ciss_luns(struct aac_dev *dev, int rescan) return rcode; } +static int aac_setup_safw_targets(struct aac_dev *dev, int rescan) +{ + return aac_get_safw_ciss_luns(dev, rescan); +} + +int aac_setup_safw_adapter(struct aac_dev *dev, int rescan) +{ + return aac_setup_safw_targets(dev, rescan); +} + int aac_get_adapter_info(struct aac_dev* dev) { struct fib* fibptr; @@ -2001,10 +2011,8 @@ int aac_get_adapter_info(struct aac_dev* dev) } if (!dev->sync_mode && dev->sa_firmware && - dev->supplement_adapter_info.virt_device_bus != 0xffff) { - /* Thor SA Firmware -> CISS_REPORT_PHYSICAL_LUNS */ - rcode = aac_get_safw_ciss_luns(dev, AAC_INIT); - } + dev->supplement_adapter_info.virt_device_bus != 0xffff) + rcode = aac_setup_safw_adapter(dev, AAC_INIT); if (!dev->in_reset) { char buffer[16]; diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index d81d0aa..5690767 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -2639,7 +2639,7 @@ static inline int aac_adapter_check_health(struct aac_dev *dev) int aac_acquire_irq(struct aac_dev *dev); void aac_free_irq(struct aac_dev *dev); -int aac_get_safw_ciss_luns(struct aac_dev *dev, int rescan); +int aac_setup_safw_adapter(struct aac_dev *dev, int rescan); const char *aac_driverinfo(struct Scsi_Host *); void aac_fib_vector_assign(struct aac_dev *dev); struct fib *aac_fib_alloc(struct aac_dev *dev); diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 82ddc74..f3077b3 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -1945,7 +1945,7 @@ static void aac_handle_sa_aif(struct aac_dev *dev, struct fib *fibptr) for (target = 0; target < AAC_MAX_TARGETS; target++) dev->hba_map[bus][target].new_devtype = 0; - rcode = aac_get_safw_ciss_luns(dev, AAC_RESCAN); + rcode = aac_setup_safw_adapter(dev, AAC_RESCAN); aac_resolve_luns(dev);