From patchwork Wed Oct 18 06:09:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viswas G X-Patchwork-Id: 10013477 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 0EBEC60215 for ; Wed, 18 Oct 2017 06:09:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3F9B27B81 for ; Wed, 18 Oct 2017 06:09:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8EDE28138; Wed, 18 Oct 2017 06:09:39 +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 683FD27B81 for ; Wed, 18 Oct 2017 06:09:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933663AbdJRGJi (ORCPT ); Wed, 18 Oct 2017 02:09:38 -0400 Received: from mail-bn3nam01on0079.outbound.protection.outlook.com ([104.47.33.79]:9216 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933199AbdJRGJe (ORCPT ); Wed, 18 Oct 2017 02:09:34 -0400 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=9SAsM4IuYY8GontW1dqkuIx14SE8mM9yGqefKGQMRG4=; b=jwqAhK8gVha6o6PlKftb+jyJedEOqDIfVSQ1yKrvlOKkzyVpwrzvz7E9+myOwzgZ4uCJboa1isUN3IhaRU5Vu2lp6WujiHDqYzungSeBYKBcQ15NKVBzPPEZ2U+5DBN/QjoM3Jyi6CuWeorW+E8E1aFP6y1sKm8ZcGuvDXJuQ84= Received: from BN6PR02CA0081.namprd02.prod.outlook.com (2603:10b6:405:60::22) 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.77.7; Wed, 18 Oct 2017 06:09:31 +0000 Received: from BN1BFFO11FD017.protection.gbl (2a01:111:f400:7c10::1:144) by BN6PR02CA0081.outlook.office365.com (2603:10b6:405:60::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Wed, 18 Oct 2017 06:09:31 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; oracle.com; dkim=none (message not signed) header.d=none;oracle.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 BN1BFFO11FD017.mail.protection.outlook.com (10.58.144.80) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.77.10 via Frontend Transport; Wed, 18 Oct 2017 06:09:31 +0000 Received: from localhost (10.187.72.81) by avsrvexchhts1.microsemi.net (10.100.34.105) with Microsoft SMTP Server id 14.3.361.1; Tue, 17 Oct 2017 23:09:25 -0700 From: Viswas G To: CC: , , , , , Subject: [PATCH V4 4/9] pm80xx : tag allocation for phy control request. Date: Wed, 18 Oct 2017 11:39:10 +0530 Message-ID: <20171018060915.8549-5-Viswas.G@microsemi.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20171018060915.8549-1-Viswas.G@microsemi.com> References: <20171018060915.8549-1-Viswas.G@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)(6009001)(39860400002)(376002)(346002)(2980300002)(438002)(189002)(199003)(97736004)(81156014)(16586007)(104016004)(8936002)(8676002)(6666003)(36756003)(50226002)(81166006)(5660300001)(50466002)(356003)(316002)(68736007)(47776003)(48376002)(54906003)(4326008)(53936002)(5003940100001)(86362001)(305945005)(478600001)(106002)(50986999)(106466001)(76506005)(57986006)(76176999)(2950100002)(77096006)(189998001)(6916009)(2906002)(69596002)(1076002)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0201MB0737; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD017; 1:bDtOxR3s2Y0RFvLAg4BCJUUIUrfauqx76083n35lCcVbZePqdbhBjHWN1MYEZc3FSXxleW5nYwdARU0n9Ff9XDdy/5J8l1i5ctIwDL3LWZ79KLaSC2Cyv1+QnX7tHaA9 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f1496f24-43f2-47f8-9afa-08d515eecc29 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BN1PR0201MB0737; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0737; 3:CHssKkf8EttEUmsAbNPx3zfhC1DwdB30/xPCKizpv3rZPp+n5uyvvMFZNT21+ewoEJODxd7XxP4OyHiJhkhMwmL5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sNWyn2fBSNjZwYh9AwUUahCGThw5Bk5sXZpcs2+k1RVq3R1rvc7PYUf45uzyzjy3z3xwHocWf477iM1Acgtzs/m2WS8bLr4dTZZZ05UkWbO/Ehxei8VCwA4YXpd/wPmIPvEAwU4+jO016RyApZhvXWzDS9glkrBtyKkroZnwxv/hK09nGiDWp/90kBE2vhxzCjvj/NpuS/d6ykzgBE2gC9IHWj4elePc35R6O5PTMfACKeV3t+L4ZpPPJCcX8Sfxb206V+PbZPxV2pLBVHrahICMpJG+w4QMINje9YmdvVKHW51YAQLBKVEc89t/Lw1qtJ2+gI1/44E9NSyR1A74peDfap9GqVYFBNXizUG7w9c4gVzES0FbywWsjnWp0QPGAimEyJ X-Exchange-Antispam-Report-Test: UriScan:(72170198267865); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(93004095)(3002001)(6055026)(6041248)(20161123560025)(20161123562025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN1PR0201MB0737; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN1PR0201MB0737; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0737; 4:8dVKPTe54YQCHzVaFCjLH8L8SOS0KA6aXFscWYhyfNsewOSo6/Ej44nrQlE9TfVGh4Ps0OzAP4HOjLTSTjeVbso1N2o5Kk13ZrWwrnaaB9Fu4cOvQObFIphT7VPHjhVzWEEdN+/HKnMVst1fFipejX9RfkktlWIH/u63Ib3fDtoYmmR9H93mG1Bm31vyx3FKLJPuNkacbNnHjiLuRbFwD9ArFmoNNCL9h8AfM0Tu+EpTLlfOpywm7aX4LlPQf6kwdp71kB4bi90NDSNhrfgUsaRYqLI5d/tAWr1G0bx8fBk= X-Forefront-PRVS: 0464DBBBC4 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0201MB0737; 23:Vi+TXGvZTbZRhw9xl+j//zD5LEYvKobE9z0wZRE?= =?us-ascii?Q?DvhSfdYrSVb5UzfjTGh2nh0TG1BHEqhmMHUwPdxBWyZfHWtHknDTuK/qRhZo?= =?us-ascii?Q?xfTMxP1RGTxhQhMcWapCXahwd5gkLnFSiBepOWjzGjKMZWPI4BogyDbSU/TS?= =?us-ascii?Q?M3Zl0oXdyTjtEQ9nG9WgDvJKU6qP27rShjWfjMIJHLJW+64j8sK1lCxUk4dD?= =?us-ascii?Q?atIBN8vgrGigBQJLKF0/F5ib3LXe4VrIEbZa4iSXgJbAOPQNmrb6Dic2R/Ad?= =?us-ascii?Q?6Z5V4Cuo2Lw6a0XiPfhloulVrWW1kjsBvpxS9Q32geSDYC95EYqFZlC1ru/5?= =?us-ascii?Q?iZzzqg4KkRIuohtEOCTG+1jBzHkipaaP7x5ao9/4aNHOecTm3dPhezJEaSf6?= =?us-ascii?Q?UNg2mDaLvWxAYTiIDkp88LLFXHDb5uWIM9zpJtSfslBBF6lvywedMQy/KuuE?= =?us-ascii?Q?PRl2w+Hj2vUsuiGIh3seM0n/IZqRBGug9hCVBwB9qd+TXAnhXhRonuu12lyH?= =?us-ascii?Q?c2ysa/PZfP0aMgMcQN7Nopr1xy9K9NV4P2PXybmOYoC3LEEqY1Oid2KSlNid?= =?us-ascii?Q?wVPOJOxnud5hahpdhSiFokDHVv1vItSbgYNZHbg5JCOscJvjkOujNH6ZU3TY?= =?us-ascii?Q?rf3VPF4WcNZQ3QGeaR7FlhCTfWgs4xheO2iL/+Fw18YhYE5w+/SBNOzUkj98?= =?us-ascii?Q?BihLvxqyITK/j5T4muur9ghSy2D6tj/Qq0IF48ydXPHSdEunS4OUg933P3p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4=; 7:NGLpa+4heJqlaDHWl9Gye32qgj9Usr0AI0jpHhQCcVGFqP1fnKVlrqXDuTIZlqjiFQmqtU/0HufgRzecgIcPaot0EISu30ZxUIbXoyknoVbf5AGZTle35jKqQhr888p1QvgH8Zrxq6mywBi6IkMWgAmN/P3FwNZyaiRPe0naqMfYP7uWq6RxNEDYR1eDDGX8XBXBsQQV1jDrzSYwvKRjwyj6vAjSiPlS3Wzxti2Av/0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2017 06:09:31.1039 (UTC) 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 tag is taken from the tag pool instead of using the hardcoded tag value(1). v4: - Removed the unused variable ret in pm80xx_chip_phy_ctl_req. Signed-off-by: Deepak Ukey Signed-off-by: Viswas G Acked-by: Jack Wang --- drivers/scsi/pm8001/pm8001_hwi.c | 3 +++ drivers/scsi/pm8001/pm80xx_hwi.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c index 10546faac58c..bc4a6f649ec9 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.c +++ b/drivers/scsi/pm8001/pm8001_hwi.c @@ -3198,11 +3198,13 @@ pm8001_mpi_get_nvmd_resp(struct pm8001_hba_info *pm8001_ha, void *piomb) int pm8001_mpi_local_phy_ctl(struct pm8001_hba_info *pm8001_ha, void *piomb) { + u32 tag; struct local_phy_ctl_resp *pPayload = (struct local_phy_ctl_resp *)(piomb + 4); u32 status = le32_to_cpu(pPayload->status); u32 phy_id = le32_to_cpu(pPayload->phyop_phyid) & ID_BITS; u32 phy_op = le32_to_cpu(pPayload->phyop_phyid) & OP_BITS; + tag = le32_to_cpu(pPayload->tag); if (status != 0) { PM8001_MSG_DBG(pm8001_ha, pm8001_printk("%x phy execute %x phy op failed!\n", @@ -3211,6 +3213,7 @@ int pm8001_mpi_local_phy_ctl(struct pm8001_hba_info *pm8001_ha, void *piomb) PM8001_MSG_DBG(pm8001_ha, pm8001_printk("%x phy execute %x phy op success!\n", phy_id, phy_op)); + pm8001_tag_free(pm8001_ha, tag); return 0; } diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index 2b26445d1b97..097096bf4bb0 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -4500,17 +4500,20 @@ static int pm80xx_chip_reg_dev_req(struct pm8001_hba_info *pm8001_ha, static int pm80xx_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha, u32 phyId, u32 phy_op) { + u32 tag; + int rc; struct local_phy_ctl_req payload; struct inbound_queue_table *circularQ; - int ret; u32 opc = OPC_INB_LOCAL_PHY_CONTROL; memset(&payload, 0, sizeof(payload)); + rc = pm8001_tag_alloc(pm8001_ha, &tag); + if (rc) + return rc; circularQ = &pm8001_ha->inbnd_q_tbl[0]; - payload.tag = cpu_to_le32(1); + payload.tag = cpu_to_le32(tag); payload.phyop_phyid = cpu_to_le32(((phy_op & 0xFF) << 8) | (phyId & 0xFF)); - ret = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0); - return ret; + return pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0); } static u32 pm80xx_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha)