From patchwork Tue Sep 19 17:09:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viswas G X-Patchwork-Id: 9959697 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 A9DF960208 for ; Tue, 19 Sep 2017 17:10:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94B0B28E85 for ; Tue, 19 Sep 2017 17:10:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 931EE28EC7; Tue, 19 Sep 2017 17:10:59 +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 D20CB28E85 for ; Tue, 19 Sep 2017 17:10:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751465AbdISRKm (ORCPT ); Tue, 19 Sep 2017 13:10:42 -0400 Received: from mail-dm3nam03on0077.outbound.protection.outlook.com ([104.47.41.77]:35872 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751016AbdISRKh (ORCPT ); Tue, 19 Sep 2017 13:10:37 -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=1IgQPXat0wjLv5cNPWknV+oFHkYoaVhuU+v6G1dZ8F0=; b=NkJdsFG6wSR7FDW9r6EJdM3dYBrXMCvNgz3QbYjNNFJnQ/cT16Niiz+LvnD+CWRkHUTLCUHNN+dGd8mzNQWKVVOH3i87kpq50mR5xX9RSEiaaxcfmCK3N7ApiqHwm8xFrszCLcXAQUhCdHnlXqW2v7r2wsi++9WcswJ1kPvXXIQ= Received: from CY4PR02CA0011.namprd02.prod.outlook.com (10.169.188.21) by BN6PR02MB2196.namprd02.prod.outlook.com (10.168.253.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Tue, 19 Sep 2017 17:10:35 +0000 Received: from BN1AFFO11FD046.protection.gbl (2a01:111:f400:7c10::194) by CY4PR02CA0011.outlook.office365.com (2603:10b6:903:18::21) 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; Tue, 19 Sep 2017 17:10:35 +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 BN1AFFO11FD046.mail.protection.outlook.com (10.58.53.61) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.35.14 via Frontend Transport; Tue, 19 Sep 2017 17:10:34 +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, 19 Sep 2017 10:10:13 -0700 From: Viswas G To: CC: , , , , , Subject: [PATCH V3 4/9] pm80xx : tag allocation for phy control request. Date: Tue, 19 Sep 2017 22:39:59 +0530 Message-ID: <20170919171004.10331-5-Viswas.G@microsemi.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170919171004.10331-1-Viswas.G@microsemi.com> References: <20170919171004.10331-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)(48376002)(50466002)(6916009)(2950100002)(6666003)(68736007)(8936002)(53936002)(50986999)(76176999)(189998001)(5660300001)(54906002)(1076002)(77096006)(356003)(16586007)(36756003)(104016004)(8676002)(81166006)(50226002)(81156014)(69596002)(478600001)(86362001)(316002)(47776003)(305945005)(2906002)(5003940100001)(4326008)(106466001)(97736004)(76506005)(57986006)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR02MB2196; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD046; 1:xoYImT04HAsAVw0Tpdw+rU6HQkgr3QAUUH24CKm6J+ENWAWaQya2/JqaH7t3ePxUT+VY2nEL7pMxsxAjGI5Zq96se2HFSke4EuV9Useoov/NLOzmK6sKz34/If0SaAIa X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cfdb16f7-e645-4f21-5e7d-08d4ff815797 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:BN6PR02MB2196; X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB2196; 3:Rg5BMnqQ1Jw3RtjWeoZ/ELqW8uWSx6eaiuDyQrObIAAsWWz4y6LgyN1kukvpWHXqvO4QSxrlUXDDfSdJvGyhznKtGos7u/bIXX54RDYGi/j4sG7JddE3ONxD4ab3vQtKKwKGVE7slPnUMeu06LR4oLm3UAP0hYgMPX16iwMC/5slzA4WkS7XvhEIhRX3Uhy1B8de4upFbZQQXX61teaFRpeJCSWH79UcsAkA/q0tVd7Que1TBXB3uSKv5j/yZZFniSzAqL/RG3GqNHhq8wg9waS76cFDaIsL9kDtOIb3vgS4KNYb9ysxIxxzpPyD2we3v6BtFxUdfd7NhNT6DNp6YTrZhMugZfAeG7GQm4by8zM=; 25:47xpUgH68fwegLrylj42qTidNWXeCxCJ0tkAwXS5qcoZHlCHAb1AQGplkJ339bRpoOx492KsxQnaMkGTDmtEL6xzltNQ5ZHDreMD985ExXATgDear90oqSRxZAhTVa5pnZukVd4vRAN0IQQQFXQA+MGRkCOpEQaqlUSj8enk3QXn3/ESo4EhF52wsej5g1rg0eZ7OTDQbqnxKGw6QhXtcMCR0Tzegnog+aZV+bjZJp1ehI5LcG7uAI5zfjJVHUAVAbYAZVpvTulg8SsOslpakq0VrbgW3dDxE4QCf33vSdpjL7HWw+U0GSrC0ejpCcWQUr6FgyGUj9rI52fe2yboBA== X-MS-TrafficTypeDiagnostic: BN6PR02MB2196: X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB2196; 31:Ls0paihXVYOW4B6xna/ezjUnigXQY5DYYCOCbOEGexzKOEzz/mRpu8naDsAzCqB1q0gryHWoOAZZeIcAsXAm7fETVHg7FKvKgJJTbCJS06A5yaVK4WzsZB3BAcFkdfI0lfm3l9nXvxC83tNXZaNTMiLHhjXCwxISezkLt+xvKURFIqVbc6i8oEYc/NAocAHCbljsw+azzimbKvLDe6+u9YBxQKnw8fi+1+UlMVMvS5k=; 20:mrdctrSgFrRhGuk6MXgCalD10VOOod+BL1GeFcJftGSqdekZ7li3a4w+yxWqyUOaJR5TTyCGppJojUyDgADLblpLAgpe78zhcZpG9kYoSSepO8kYtnlOZO+juRxH5YLSupVoQCCKZwxDLu6dKn+TaZ+kMW1iON3BJLrl+Wcl6eVW4KRv1GNRZPKSLPe9GRz75wTe0D8ZkdDErSvolbGZ3IimyWfSUa+kXYqKqoHFePOXB1avbE/g2a8CQY9l4om+2JLAVAdXy+58RWseJTYbYZQdcGqAqVuM4UAXcTQvjXMmDJuhJvy/SHnFb4sA7uQXAuIm/gV96nFCf+dqTKxf3g8V5iYpp1fUikdKm2niqmfcfjeOb1wvVYPULVmZiPN9JB0LtA/vKbYXNRG7yIMMx2s4oVgHiYJXUeK8xVkQWPCl5YfqV9nnLQEflA8cULkKXXRJ+QLrNRwdIAe5jI3P4tDtIV/oNcFgPxBQkgnLqe7Bn4wV2SlSstOdeNDFrpcO 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)(93006095)(93004095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR02MB2196; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR02MB2196; X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB2196; 4:S7cZzkhF49Tr7XRmatMpSwdJP6wH3PnwfIsui8HSaPhVgB7Ql+oANBfqUuKEOPeDP8MNdq7BSczp3HebWDqRelxoPgXpGu4cTw4T4ILNXyxeXYOTvT+CiMlCuTsIvBvy6c/8N3QyXjzcV/AUsizH6X8AqcEanJfjI55XvIRUzU0ed4gAWsUuUwpQggqFYoKV8OWui4A+GiFCCLtkm0zduVSNmPnqzI3IszrZLH0S1eC3MUd3rUAAgKOGUG0D1pjpsBb4YFa6eII12CgAf0+2QwybYy8iKjUwSPd+96njrsw= X-Forefront-PRVS: 04359FAD81 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR02MB2196; 23:GtNmE+QpCVTcCkLhgaYOLMgTI6O9s6WRc06LViw7N?= =?us-ascii?Q?0WW0mOcoMCYrE8AbOyHx8PucTEfvNDNz1RrKT90KjkQx/vqmGpclUm6T1VUS?= =?us-ascii?Q?VISmldLR4fagQba89t6criwalDaXMEWIrcwXVUAI6KcnGo9Zl37us0N4wXWP?= =?us-ascii?Q?oK5zAEgoqFh1tKte02fM1jBe/aoDFEncSeUD1FRNV5IMl7CxQbkpVCqv6F+V?= =?us-ascii?Q?hTDXue/zO8p3ZKIhB6aVjUZXe70ZoLmeZsqUb+/kt6Il8+Ptyvlc+5Tg1fIU?= =?us-ascii?Q?xznKXtR3dKzMZOLDv5dJqhp1XgtwiTQKpLphzqJmLYljKfxa0aR4q9gSHdYD?= =?us-ascii?Q?D5iwCdIlpUBsm2sbgp5A0wpSxWUHKpzjjIUzapHCC+oua4KxKFrZHTpYIy6c?= =?us-ascii?Q?mQU0gEgg/r/joG68XAJj7gagZ6HZJPwOLelN50y5mUhrxJSPzK6Q6UVjzRWH?= =?us-ascii?Q?QFh1PH5lw4wBUyhlPbFYD4eMcbkvI0hezoYKju/PJ2xUrrKmopuGUivs5e7D?= =?us-ascii?Q?wsq98V+HkEwGpJOPD0tRRpjaS4QWk+BqcVM4ERja4MUeiIyMMcscYc1kZPVW?= =?us-ascii?Q?w74/ettSc6ZutgZEBL6E4U5Tl8wGRFX4NvjI/K4yeQI4Vx8F2vOJCl+natsA?= =?us-ascii?Q?mfu+ab9DbPuBOhjkVvw/iri+/CjgnSvJNwPjswFamSYqmSrqWk9IikW3anNh?= =?us-ascii?Q?h3cqTbVIJWhXlUzIz/P36CGH91o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sjjppik=; 7:KZd+YB3zRO8o/zWmYe8Fe3RSbKpNgRURQja+If6EuWOYp9eXq5evCnwyf6n7Y5LN93xqM3kR+AxHew2rjWB2MsMk82J2HOayceED1GlcDRGlgOs1qV7r7V66ScYu62iGCrOX3HkMKoUQN57PnSl9G0TaG1+2A7e/j/oHT1Onbq3TMACvGGo3BI3XYPAqcLpl4IDurfoeZmw6rEEDHBA7RIiBgSj4m02T0oBPGLjM94U= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2017 17:10:34.7740 (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: BN6PR02MB2196 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)