From patchwork Thu Dec 21 17:34:08 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: 10128123 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 4EF4A60318 for ; Thu, 21 Dec 2017 17:35:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D58029CE3 for ; Thu, 21 Dec 2017 17:35:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31BBE29D38; Thu, 21 Dec 2017 17:35:26 +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 C128029CE3 for ; Thu, 21 Dec 2017 17:35:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755105AbdLURfW (ORCPT ); Thu, 21 Dec 2017 12:35:22 -0500 Received: from mail-bl2nam02on0044.outbound.protection.outlook.com ([104.47.38.44]:58272 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753819AbdLUReq (ORCPT ); Thu, 21 Dec 2017 12:34:46 -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=Ul+/SX4Ta15N/wwHnLMokkhn3G98yvs+2trb74UjDZk=; b=cf4CEG8kmr+o2DLMiZ4MnxxJJazNhpEPMCAeBaOUyouL6mQpRK8gNojIqaaMk3CvUUXoJNtkqm8a7+SCV90V25iD1ZvRxUkCaNAXWVeqBPdGuCWWGjrC8TcIMtOJH4E2iqvlgwa9ZtzUrMS+R45cF5QXSjSOoFNqlS9BwMHb+8M= Received: from MWHPR02CA0045.namprd02.prod.outlook.com (10.164.133.34) 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; Thu, 21 Dec 2017 17:34:44 +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:44 +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:29 +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:25 -0800 From: Raghava Aditya Renukunta To: , , CC: , , , "Guilherme G . Piccoli" Subject: [PATCH 17/29] scsi: aacraid: Add helper function to set queue depth Date: Thu, 21 Dec 2017 09:34:08 -0800 Message-ID: <20171221173420.8213-18-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)(346002)(376002)(396003)(39380400002)(39860400002)(2980300002)(438002)(199004)(189003)(305945005)(356003)(104016004)(77096006)(97736004)(4326008)(81156014)(6666003)(48376002)(50466002)(2950100002)(81166006)(8676002)(8936002)(50226002)(5660300001)(68736007)(69596002)(2906002)(106466001)(36756003)(54906003)(86362001)(2201001)(72206003)(478600001)(110136005)(106002)(59450400001)(47776003)(316002)(53936002)(51416003)(76176011)(1076002)(57986006)(76506005)(16586007); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0201MB1839; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD036; 1:ywkKeBMxIHBAZfzPZBo8nJ4HJAFoiaBgzHwtocZ3ZrRCa/ndromkU8QJILwtC0X3IRMSDcbI98jJZZCATbKIqeb6mEc6x8kKQWIUqaKgNfIUN5Wiyt+RqiR5ex+PhK6J X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4080fb40-d0a8-4657-f7f8-08d548991763 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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EOWeXEo9cWVHQLdiHOjQjHDtDBy2w/L6Om6d9KXUL5uo1USFfYlOEG+T3/eFKw9XdYdeY6BY6iIMMyWWaPo04RzUDzenD8UYnlMurImyFUDoeNyQtI7UOg3XD6m8dZWtMr8O+267Mpg77KdOk0NMspUN8pPl8Ml98aHyWJgpBLVuWN2sZ+DdsBf4/U5KuzDjonlV9sD2WgNDCTpSStiM1oDCaIom/lpBplTjQOJAlKoZ/YSOXqDS7RlCqlh2eJdV8+0P6sXTJRaNiDdx/S4cXQfOZausbCTi1Rx+5Ow8eXHTQi6rhUjMXWgVmL9SUP6X8Hedrz//V5GlTRNoSClWyctpvnM9dUCagtRladjhTBU4TDkISE/d7olF1A/GwQrl8Xplbxq955x9unJDcYDdcBjj7f82WPcdque1Tm4KxmmLzH9c0DdHwf3au2VW5zDeBm2vh/meF+Jec+Dasp/CLowtIXiFZQol6aqQxW47uEQ75yeslFiTNIPG4IZHQHtm04gr1yiTGZd7ZbUcuInXRYJoPz8IXzA9GqC0jUjk8= 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)(10201501046)(3231023)(93006095)(93004095)(3002001)(6055026)(6041268)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:SN1PR0201MB1839; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN1PR0201MB1839; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0201MB1839; 4:p4zTE2j3B57PIXGovce0YgC+trlDDKMtNM8LEZsgiZD3mk4lfszSi7o00Qeye4FXQ5Tf39iMDD2qI9zAqrkgz1a6Bn+E5nMQaWVoeRM1jCx3cZKUP5Q9jmyJXA258I9WSfzGRXyKP1oiVeyo7dYWbtQXfWWs/Ira4heg2LF5WcJpuM9W2SHLoWP+exd988zp2Fh7TEtkBdX0Zw17YjwwgdAtRX5mswqxCc/S3eIgWKqb3BJbqiWXjQ2USkMpwXEtqJ+mUoE0YXkULgoRnYpo/tOZQefnlqWDBI1I8YTAeEwDrGhZtHWZdCcuWgCcLYjf X-Forefront-PRVS: 0528942FD8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0201MB1839; 23:rn9MW4gvg+FiWJd0ER4EOQSAy0Uhwwz+SQluvgV?= =?us-ascii?Q?BkmhUcyJjImZG/4tlrnHE/5UN0x+OCYI8VJoDvzvQcksdSPftQMfPaXwANfQ?= =?us-ascii?Q?9BtAvAf5uXAcm5pbCnVESl1S9Zb0RUWDpcaDgO+diUYo1e1ds9VMvdDl6V6w?= =?us-ascii?Q?JMISjsWo/wLt2z+75VS1hdskcfqeVIhFbQlxD/L/Sb7TkhXtofiF3n5aQgV6?= =?us-ascii?Q?rR5Q2ybttGV223+2+gpeYoT8tZWD0Qu2+IkEIlzGVww3vlD+aXYAUCNdDPPs?= =?us-ascii?Q?DS/0jTtL3vLENDVR6oSmOuXPI1pblTUrknviwqOCzbhvWbOBqtk5xhGDFSCy?= =?us-ascii?Q?rcdfVImbRpAGxSlrD2mFYmxsAqLGyZSalPcEQMbdVh6+ojaMcNJZX4Z0EW7B?= =?us-ascii?Q?CZxNcYlVdW2t6IfYJaoW0st405legUn3iqzibBW+4ZgW9JIIRAqy5fqHb2X2?= =?us-ascii?Q?fNhUTWPk+xzo9FOnT/WVkRzMnW+WcX/0NkRgYsE6u/tCjQ56ZiB3WOcriU7O?= =?us-ascii?Q?PtvL2C/BLC6qs7qfii0ZjPTic/VPTMKXzWt7izfgi28GMToTofn0czF8yE1j?= =?us-ascii?Q?AmQ+ri7xdy3YFiIjh2odWimCSxyQgSjNBjTc3Tfe41eDdLWiE0r6iltNdzoo?= =?us-ascii?Q?Ak/bEPhIJGootb+Ce52liiQx5P2cHeYRhyuDoTUiMIAqJQzb4opC6cduyrGw?= =?us-ascii?Q?5gi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wFEkKDOLnUMsk8TwBTZDkj7o2w+zIxCI1/Mc=; 24:bSUCZd5zTagXgY03+2wwkxc59uPgauQMcpc0gJFewqggL6VAWBKaGCAwaZ8JP4wPpAeUDorDyprkqtDg1Uis0IwAvIwfoEIKNTTwKj0kWbc=; 7:SL6OPjUk+7q0lXxYHLJzl42lOeAO7s8CiR3UsQIxbruoVgZwYJnMpdPmhsYh/QfdtQWTvMfbtPLJ4LhG5a0K05f/SU/i8wBxoBuFFI3rcn3bWHhOB42sJjnuDk0iVw84fPO+iZm77ywQnDJq7Gml+fxfQvkU/5b3Dypm1EAzYkRLMLiZvyZ3+5pwHqLJW96xQqcWMYc9S/Bw7Q3qGfyQ46o2VDZs64pRoA/ljp1r8dsuDWs3OZinWz5trRVHX3oA SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2017 17:34:29.8984 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4080fb40-d0a8-4657-f7f8-08d548991763 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 --- 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 a29c8fb..01cb825 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -1756,6 +1756,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) { @@ -1782,13 +1804,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: @@ -1947,17 +1962,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; @@ -2006,8 +2018,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)