From patchwork Wed Dec 27 04:34:38 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: 10133409 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 2854B6037D for ; Wed, 27 Dec 2017 04:35:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 111DB2D864 for ; Wed, 27 Dec 2017 04:35:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 060102DA5E; Wed, 27 Dec 2017 04:35:28 +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 8E55B2D864 for ; Wed, 27 Dec 2017 04:35:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751861AbdL0EfZ (ORCPT ); Tue, 26 Dec 2017 23:35:25 -0500 Received: from mail-dm3nam03on0046.outbound.protection.outlook.com ([104.47.41.46]:7296 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751642AbdL0EfQ (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=IEYqV/u8hdhrFpalDgTRFG4vbW1qmcIhVsd6NKG/9ts=; b=VExUMgH9bA9pbxzVeIaDKmGH0ufMfWmX/F/OZDEh6HW1bEtfNZ7JlWc9MgqT/hjTm5mKIqnrg85yIQr36fEu9lcuQXK366uopARHZbgfvz1Cic4X9nkMnXs3wp4UzSrX6bM35/jc/FEj46B05uoZcEopEo70QexHHg8MPuf3IsQ= Received: from MWHPR0201CA0048.namprd02.prod.outlook.com (10.167.160.25) by SN1PR0201MB1839.namprd02.prod.outlook.com (10.162.228.151) 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:13 +0000 Received: from BL2FFO11FD050.protection.gbl (2a01:111:f400:7c09::151) by MWHPR0201CA0048.outlook.office365.com (2603:10b6:301:73::25) 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:12 +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:53 +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 17/30] scsi: aacraid: Add helper function to set queue depth Date: Tue, 26 Dec 2017 20:34:38 -0800 Message-ID: <20171227043451.27813-18-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)(39380400002)(376002)(346002)(39860400002)(396003)(2980300002)(438002)(189003)(199004)(97736004)(53936002)(47776003)(356003)(86362001)(6666003)(69596002)(2950100002)(316002)(77096006)(1076002)(51416003)(54906003)(76176011)(8676002)(106002)(5660300001)(106466001)(2906002)(8936002)(305945005)(110136005)(59450400001)(81156014)(81166006)(68736007)(76506005)(104016004)(50226002)(57986006)(4326008)(2201001)(50466002)(16586007)(72206003)(48376002)(478600001)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0201MB1839; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD050; 1:WHuwcdEnOJlI7GCn9B2EMCXivCoMkGjBP7ZSz+QVX6kCj1Rt4picBi/+hS2ydHf5yDrzaQO+TWRslFqqS6xKKMlsphR1vRQHeNl+QNCUpTRYYgEOIs/G1a4bWs3XWO/1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3f1fe30a-2903-4998-9e42-08d54ce32cde X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(4608076)(2017052603307)(7153060); SRVR:SN1PR0201MB1839; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0201MB1839; 3:wMjlGk4b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Pt25J196CbjnlAxoq87bPggCYXHhb13zAt10Q7l8YgML47duCd3vpWszDMok+J1apT4Ifa/8JZ8XEeVlQS1S3gfduWoj4sNNJLaa/JtpFZiVVJeGt6TAqNacYC64bmnFFcB3ktJQF0GrT+diPJ6kdpQKkunuEg5HwoVBReZUlKblsgE5OuEQr9nkhrVgwX2RcnYK5Fd7YKOLM3d5G8n9ab17FJtdp5e9Wx6yqqVF5a6bKnW4kbRjWP1o4rZP/zkCWt/lLh7g5XQHph8lHhqpYrMqEp65s1qaVKgiEO9gNvbq4svdMMfORBGa8jr9d3ZLm9rGDqQak0tsIqihUPI8QBp/BhgybIc9EindWxQgxBGnlPTQRMrrfLoQgKiN8A0/XSFDKmE2Cm3ELKCNqf+y8FITb2OKF1PAK4J3xPJmNrlAqMWseEMoobltVL9sD4ft7/7OnIuWHi7isWMa+gxUJZlKLBOOBfbUxFADumzmhlx9RunTgMal8NXmpqnC06KgULHxPQwOyNX2CoukU5Mdo0E+4rWo6PKj6KKHO2Dsx4NR4kZFndbfEIeZwibFtP3bTHrSBg= 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)(3231023)(944501075)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041268)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:SN1PR0201MB1839; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN1PR0201MB1839; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0201MB1839; 4:I0QybM/9Qdg5vEzXbScS3Lihvhu+w2ypT1mYDoNF89KdUQ+s2GwjBDKe0rCvyq4CgNj7MoRzqVjaEAUdtQ2N8UvnJk5Oxn1valmwxAlGc9t39PKaQFxR0LpX0FNJh+oo5WM/ld7An7wqx9s3VW7h1TVoF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grJX1jZ1UtVG9IcRTPjCdpcH+j2zAPF3NU8xDNhWUU5sgD0YOcV7tfAk2dSZ76L4=; 24:BbRUXWwwUvfHScIEctxBgyCZnnWmg4oAKC/PHo7fLQ9lhrRh3LaTkOuIR4nIW1NcnyYdCaP6ykVBRO63jpKT61uN3v7hKBuYDRIypy4EiT0=; 7:qrTLkjyQ/QScTdRD0Lh8T7f9C2NyKneGuKFAQKrFtlZeDvifdmisWtyrJ3ZXvdvbA1RKIfyuDwTIhFMuUKwat8AOILIXcuGZrvTPPxVT5e3r7Ankad7tUsUkZOze727Tvpfhwnwh6LSQA+ixXvcaqRmsBTA8ujaoK08uyftOjjeGx7V7pcsTKudcS+DLHEEkexXwSsABLfuYKtYqK4U50tAbJeWdCTEpvKqa0Al253Hky4p6lJ3iA+GtFIPK1SZA SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2017 04:34:53.3591 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3f1fe30a-2903-4998-9e42-08d54ce32cde 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: SN1PR0201MB1839 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 set queue depth from information retrieved from the bmic phy structure. Signed-off-by: Raghava Aditya Renukunta --- Changes in V2: None drivers/scsi/aacraid/aachba.c | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index baa3de5..67ca5af 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -1755,6 +1755,28 @@ static int aac_send_safw_bmic_cmd(struct aac_dev *dev, return rcode; } +static void aac_set_safw_target_qd(struct aac_dev *dev, int bus, int target) +{ + + struct aac_ciss_identify_pd *identify_resp; + + if (dev->hba_map[bus][target].devtype != AAC_DEVTYPE_NATIVE_RAW) + return; + + identify_resp = dev->hba_map[bus][target].safw_identify_resp; + if (identify_resp == NULL) { + dev->hba_map[bus][target].qd_limit = 32; + return; + } + + if (identify_resp->current_queue_depth_limit <= 0 || + identify_resp->current_queue_depth_limit > 255) + dev->hba_map[bus][target].qd_limit = 32; + else + dev->hba_map[bus][target].qd_limit = + identify_resp->current_queue_depth_limit; +} + static int aac_issue_safw_bmic_identify(struct aac_dev *dev, struct aac_ciss_identify_pd **identify_resp, u32 bus, u32 target) { @@ -1781,13 +1803,6 @@ static int aac_issue_safw_bmic_identify(struct aac_dev *dev, if (unlikely(rcode < 0)) goto mem_free_all; - if (identify_reply->current_queue_depth_limit <= 0 || - identify_reply->current_queue_depth_limit > 32) - dev->hba_map[bus][target].qd_limit = 32; - else - dev->hba_map[bus][target].qd_limit = - identify_reply->current_queue_depth_limit; - *identify_resp = identify_reply; out: @@ -1936,17 +1951,14 @@ static int aac_get_safw_attr_all_targets(struct aac_dev *dev, int rescan) rcode = aac_issue_safw_bmic_identify(dev, &identify_resp, bus, target); - if (unlikely(rcode < 0)) { - dev->hba_map[bus][target].qd_limit = 32; + if (unlikely(rcode < 0)) goto free_identify_resp; - } dev->hba_map[bus][target].safw_identify_resp = identify_resp; } out: return rcode; - free_identify_resp: aac_free_safw_all_identify_resp(dev, i); goto out; @@ -1995,8 +2007,7 @@ static void aac_set_safw_attr_all_targets(struct aac_dev *dev, int rescan) } else devtype = AAC_DEVTYPE_ARC_RAW; - if (devtype != AAC_DEVTYPE_NATIVE_RAW) - goto update_devtype; + aac_set_safw_target_qd(dev, bus, target); update_devtype: if (rescan == AAC_INIT)