From patchwork Tue Feb 17 23:36:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viswas G X-Patchwork-Id: 9950967 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 04D816038F for ; Wed, 13 Sep 2017 10:42:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAFCB28F7A for ; Wed, 13 Sep 2017 10:42:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFE6928FBC; Wed, 13 Sep 2017 10:42:16 +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=-3.5 required=2.0 tests=BAYES_00, DATE_IN_PAST_96_XX, 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 760AD28F7A for ; Wed, 13 Sep 2017 10:42:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751647AbdIMKmP (ORCPT ); Wed, 13 Sep 2017 06:42:15 -0400 Received: from mail-co1nam03hn0220.outbound.protection.outlook.com ([104.47.40.220]:7620 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751905AbdIMKmL (ORCPT ); Wed, 13 Sep 2017 06:42:11 -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=bXMYtF9A/Lq1qEEoSY3XtXad/AXKEpWtfwnJxJJyMuI=; b=UXHY1/c9snHKVcjnHOkHDchGnnhqC4mdJtP4Ovb0CGzfXFTMsJ4W72ir2yBVmlgLGORSQANktQx8mo7GATnjSUR+L6TLvxk70dkeKNFK/9N6Wb5locoayfS9QekCCAT70XKKbxLSz2PWo0MCIpcRl9q5z43/fi47UtcH+okGpjM= Received: from CY4PR02CA0004.namprd02.prod.outlook.com (10.169.188.14) by CY1PR0201MB1451.namprd02.prod.outlook.com (10.163.139.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Wed, 13 Sep 2017 10:42:09 +0000 Received: from BN1AFFO11FD021.protection.gbl (2a01:111:f400:7c10::139) by CY4PR02CA0004.outlook.office365.com (2603:10b6:903:18::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.8 via Frontend Transport; Wed, 13 Sep 2017 10:42:09 +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 BN1AFFO11FD021.mail.protection.outlook.com (10.58.52.81) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.13.11 via Frontend Transport; Wed, 13 Sep 2017 10:42:08 +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; Wed, 13 Sep 2017 03:42:07 -0700 From: Viswas G To: CC: , , , , , Subject: [PATCH V2 4/9] pm80xx : tag allocation for phy control request. Date: Wed, 18 Feb 2015 05:06:45 +0530 Message-ID: <20150217233650.9091-5-Viswas.G@microsemi.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20150217233650.9091-1-Viswas.G@microsemi.com> References: <20150217233650.9091-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:SPM; SFS:(10009020)(6009001)(376002)(346002)(366002)(39860400002)(2980300002)(438002)(189002)(199003)(69596002)(478600001)(2906002)(5003940100001)(110136004)(305945005)(356003)(104016004)(86362001)(48376002)(6916009)(5660300001)(1076002)(97736004)(50466002)(2950100002)(6666003)(316002)(76506005)(57986006)(50986999)(54906002)(76176999)(189998001)(68736007)(106466001)(2351001)(8936002)(77096006)(50226002)(4326008)(36756003)(53936002)(47776003)(81156014)(8676002)(81166006)(5530500006); DIR:OUT; SFP:1501; SCL:5; SRVR:CY1PR0201MB1451; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD021; 1:0KMrqek/cZZTWoADNTPlLwRdrrJrWtKPGDcEVuZMOZ4/dY3sLXhaxXMOl7l8+UHUCug3iITyyS1f4WxVA3qar0JD0DqJhjdk2FrLn1Sj92GvtqxPR1MSpdqz5FfCx1Yg X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1179ab94-6129-4c84-4474-08d4fa9415b8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(8251501002)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY1PR0201MB1451; X-Microsoft-Exchange-Diagnostics: 1; CY1P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PlgqTdYdsE/5/QwzVSXyll6OR7kWTceTgAZHyhC/6W/IkqnPcjXttpxliifP7IF49IQiqKmaS+GAsPkvjTiy1AsXlMBQF4IYeTtUeBy9jCIs9mTseZ8IG7PuLcI1x60T1M3Tphs0yn2EmPxTtBASEagwyvp/qgZWva6bMxLfqybCRmOBve4xDK1qyiL6USJOeS77Yb/RCLCSo7PIklkd/cTZRwvEp4NSArIQ12vZcB4FH4zvETNpXyhKn/1jt5vAYsEEv0G03LrWRnlGiZxUB3FHRk3AQEEn/nGsvVxejCDFbzfQTvpQa18puQl7p5paMBeS5TR5szjbaZ4i+LlK66XYUZTMqKFPTNX8hVGchqDOpxYR0UAPctOPUfWLdwhGgvWK2n4PQr+xBrTMDd+sfVInjj0Tk4s8wz6KZJPcuKfB+iX8CrlppUq7TtTPI2hu8QfLZyCQE/rXKCga2VcU+cNTM7GBobdQaISODLW 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)(3002001)(93006095)(93004095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123558100)(20161123560025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR0201MB1451; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR0201MB1451; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1451; 4:v3AUr0pdz03bQ/OayAq89eaemHO1lqecT9AYGAyyIkEuSSRqeWA2N4PEHz/k3kG80TsLCmfzU6jvEUlGLt9cPo4CBMpVet+2WSZ33/5R8JmJKiErkjOCpekWDNxBe5FzTvmTbZfiaEWRscWOiThduX7deBYx9A1NFLS79lURrLpi2TBXufuZ0L4r4n91vwUndjc12Ko8sYeeu6/S8afdB3df6hEYXPncW5Hn5KqxAo3i61OS+qLIRYQfq3X7fnVnrm4w7HBBxMejAs8Sj5XEYk+NwxbqfzKdqgMONLVnbfc= X-Forefront-PRVS: 042957ACD7 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0201MB1451; 23:Us4+9p5og/SXvbOvRJb3aBHKUijhCkVPUoPfwwW?= =?us-ascii?Q?/zVljXJtk6mwTPg5P4i1H1Rk0u6lLlNsIghnE0dAB3DIJV5NwibY6k57QtOI?= =?us-ascii?Q?nVY7VtvlvgzTi20Yh7qwVbq5M0SxPbKJxuWQWWzw3rXDJzjSTeDrWYAQHYPl?= =?us-ascii?Q?o8ajz6866+pGryyWLkrDRN/o0V/wCvga2yxU5V/boJw5neXhB9cJFW6gR34z?= =?us-ascii?Q?ruFS0uCV2Z3f0oR0Sq1IOZWD/k4n6LlpiTT9EBa5DKHqO/wB/KCOwSUaRGkM?= =?us-ascii?Q?k1Y992gqnpdMtX6L5FpDeGyAoxz/7XbdNwXcrUyb+1K86b9lq56yn/hAR7M3?= =?us-ascii?Q?wjfd+/jsGv4zheSmOwqxDTrzI/UwFU45uBNLeMvxZ740tVHJVp6I2Iye2uUy?= =?us-ascii?Q?R4XQ6vPaOtNF8T+mb2pTucku5xmVC4JlrX5EQpThzS3EEQ8dOh3l/SinvP3U?= =?us-ascii?Q?yzFNuiXQtD7uw/eV/5/4TCOZlEM+6wltt1vwh5iPzt/Ovq2e7OlipHdG28bw?= =?us-ascii?Q?YWD8Gh2SqgxWU/Ab2syJHGOUdel9eJHxf6sXHWBtF6ySkhpc507r7S4G/Ob0?= =?us-ascii?Q?nAAH0J+9RcLYIl+/znOYufAX0nwwRwuAp3KF7PhilAFxcoILaakMn4LZyf7E?= =?us-ascii?Q?vUBdaRXeNAvox0Ww5AYkgMh/vDDqCMkPWJu2HF07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3P5lpYIZp/b0+At7LDPv4XevRj1MGF+/qLqkh45aZLSwgtn3MYSzZzjgCxT4Ysj2pdnUsvG8znSiEcdBg==; 24:BlvN0hxD7ixCnaP30h7bhmzc6L6ZFxnWPDAp91peLKl1H/zbDQKfRX7UVHEylqKKa+ZuI/aLIK14eNAcaOjZLQ==; 7:E4g7FajICFDJZ8uHDMabC4Du/NIwSfGj4wQhq1CVJ9graOpSrk08EvzYHyeaNpUBRnR/5A/kD3HZKNeMUW6ss7gT5tVqAUZ21IRI4zXw48w4EHjVq7pZW+5Yytx5Mv0eC5QUN3gv+P8R+qj3gF5l+MRXM/vgksYU1GQ+rsr4jZ+B9qonp7K+klD5iaIs+6FNWPsXYUawzGv63i4NynCj1UN/y/EBov0gMj/S+hJXSag= SpamDiagnosticOutput: 1:22 X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2017 10:42:08.8840 (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: CY1PR0201MB1451 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). 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 | 10 +++++++--- 2 files changed, 10 insertions(+), 3 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..baab8a19c78e 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -4500,17 +4500,21 @@ 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)