From patchwork Wed Oct 11 20:36:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10000625 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 ACACB6037F for ; Wed, 11 Oct 2017 20:37:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0A1528B66 for ; Wed, 11 Oct 2017 20:37:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 955F428B6A; Wed, 11 Oct 2017 20:37:04 +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 233A728B66 for ; Wed, 11 Oct 2017 20:37:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752580AbdJKUhD (ORCPT ); Wed, 11 Oct 2017 16:37:03 -0400 Received: from mail-bl2nam02on0062.outbound.protection.outlook.com ([104.47.38.62]:65389 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752525AbdJKUhB (ORCPT ); Wed, 11 Oct 2017 16:37:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=mDeox82zXJiQpZ9hfEbmC2otFncq1mCtlKVGmwZsklM=; b=WVCg8GWFn505j3Y32t35fE/Fkj4TAIpyCCBlSlZLkNCoG9WdUDwzx+th0i4rYJV7o66rNWkfN+71Tk6XT6oiY/EFBcvUlKT7iuikm4ZlddeSA6ydEafT8n1Yy3TXrTeaQ6E5K8iqIis0jhuZ0E368gJjcMO6JzuZInlPNJ6D7m4= Received: from CY1PR07CA0020.namprd07.prod.outlook.com (2a01:111:e400:c60a::30) by SN4PR0701MB3823.namprd07.prod.outlook.com (2603:10b6:803:4f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Wed, 11 Oct 2017 20:36:59 +0000 Received: from BY2FFO11FD044.protection.gbl (2a01:111:f400:7c0c::160) by CY1PR07CA0020.outlook.office365.com (2a01:111:e400:c60a::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Wed, 11 Oct 2017 20:36:59 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BY2FFO11FD044.mail.protection.outlook.com (10.1.14.229) 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, 11 Oct 2017 20:36:58 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 11 Oct 2017 13:36:51 -0700 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id v9BKapgs023672; Wed, 11 Oct 2017 13:36:51 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id v9BKap4o023671; Wed, 11 Oct 2017 13:36:51 -0700 From: "Madhani, Himanshu" To: , CC: , Subject: [PATCH 2/5] qla2xxx: Add ATIO-Q processing for INTx mode Date: Wed, 11 Oct 2017 13:36:47 -0700 Message-ID: <20171011203650.23629-3-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171011203650.23629-1-himanshu.madhani@cavium.com> References: <20171011203650.23629-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(2980300002)(428002)(199003)(189002)(2906002)(42186006)(356003)(478600001)(69596002)(36756003)(5660300001)(72206003)(4326008)(54906003)(50466002)(48376002)(5003940100001)(110136005)(16586007)(87636003)(305945005)(50226002)(81166006)(316002)(33646002)(47776003)(8676002)(189998001)(81156014)(6666003)(101416001)(2950100002)(8936002)(80596001)(1076002)(106466001)(50986999)(86362001)(105586002)(76176999); DIR:OUT; SFP:1101; SCL:1; SRVR:SN4PR0701MB3823; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD044; 1:s/rwQcNzhFN/lGMhLFWpv3TpseYDZlq/kYcYtafYmFXNvK2KK1rTGrlbM4+49ceFksFqX4Ip7zyJ8i+svTVY90R0h+/uXmLMhDSGQJ1Dscfsxn4nFjzVb6CcxKjzWP77 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 538ffeb7-cd9d-4605-5ea9-08d510e7d1f5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:SN4PR0701MB3823; X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3823; 3:0rAQzal4wLe5dQ6c/prGKLt/TWsxuh3ZAmBojrty8pnZ5PpCsPEg8toKSfZjhiZMTX+MtvoFOr+gMLiQDLZQBB2xbIBhrdvAELeNtk/wPGWmm4NYYdWK3EB8ApM5ZWgt+oZq4bAlEgiAGT+pkhWmVssFPosCkEFyd36khargaDnuuql2KAG8nTtC0iUsoPaylmcEB13hOSSs33OmhQN9onigdswy5tyZkxEEfrJTwSX9nEafbWZUPOuYS/8m/XbVv8AIUu7SwxGHropYk5/z8nrT4IsRuWHZaFGeDzq7bxFhcq5VGV3gg6esYAs9C07LXHR4E6AE1Dwgqg+bJYYw1s2U0YyzOQKtiG91lX8VNXI=; 25:Eh/VhRGwklQ+Fa5/fvkTd+EI7sbxKwweO3qdF1PxVxhiq9/zba8OIJ7frWMJmI3bLjRrUcVFHxV9tXUpMGyZI2egISada4R0yjcwHtlF7TYgWH+nwRQWV20UEMqDspfEO2KzYIks+bJFvCMFe5Si+1b6u0bxjMLMWEo3jNycpuLB4Yrv7r2tb7qLb7I45ynbOJMGm6Ndy03e1b+wFmP792LurqCkJyGzJun3WOc6yrDNdObb6yPGrpZb8hSSDdH4H7lWdHNhgXOlg2oiXQlFLc7i+1yKfdKVSjeJEQaoEJWy4JGLkiJsy0SCbqE0hdWtQGF6tBjL1ccyeu6pbItZFQ== X-MS-TrafficTypeDiagnostic: SN4PR0701MB3823: X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3823; 31:D1LO2T4iBjad41fVkq2XE1V5uz+BIvlM2ZCItYUpnNgkW9cTrgWm48qNGyokOqgdMJeCc7z5mx280vU4/awRHORnKV8bBmW4r6yXIWJxkryzEw3TbwElTFMosyLAIXbBTQanaPjoyycONjibDEgRbLyzSdPEatTQS58oBJHVOQ1QE6VeO+fsZWDy1B371iFTN80JgMjKGD/PWvsmkeYbNqWxG/p7Fnnk5Bff5lLQmpY=; 20:+oMcsfGvP9cqohwkORU5HlSCkmEGaH4oqCLwjK0nYB2Ebra4+ydqF+cAqRXhZqx8fVsmJjS1GXhT09c0tSg7J/Gb7XXQq1wVkvI7awiguW+Rl7wu76L0kjQZt9r9v+1PgPgjKWkUVN80i06pz8Cj8ukFyT2gC11jQYMdW3Xkx+xFADNqcTh8qStN+InlEi+QF+1a6xWsbc6t7sQ2QfpntvcdeFoXdg7edZjwpN+64ymD24VQIbnXzCVpGkVk9KINitcDjmP9Fp0BGPEB/ZxHl4dEbRMyIXRnTHBQKKOr2WcElXCRp8smtQxny/yTOa2SQS2w9J1h+sA7TaeMRsWXwQngPphMEiOhWsHcqXGlXq/hPucU0ryS8bkBy6MvTMhAXLY8uqgp+EpkWEF6FZwiybjGQYpb7o8TY2rrdoCcuFti6Kl4gEmKyfQ2mlCl/TGqgAKlKy866IcmRKlX+NSeheJQa3JPe/Faey57sek6si+9tUq6rbT/yzGOAF+6A2qN X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN4PR0701MB3823; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN4PR0701MB3823; X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3823; 4:iEIjq8H9U/qBnX60iD/ftTcd7ZVP6cgsW6ge0w8k7Ed+uNqHVGeUiN8idbGDlieOh7aJ7ESiTC9iM/PeSb1eZ4zMM2Wa6XIzS7aT2kiKeoENZGLj6oVJnbnKVQZNOnPwj9ju5JozdRsPs/mwKHYK//vveQqQJyz88YWOJma+g6rbolQCHg66lfKfCLHPb3BvXG8vAHCaGs0YgGre4X0WTI0i8uIq80BGbEcpRfN547MkbALm1h9PMP2lUMtzNI0Q X-Forefront-PRVS: 0457F11EAF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN4PR0701MB3823; 23:trN2HruXOYiA6qJXjcFLkk3NEjPIZdYiNcCoEdY?= =?us-ascii?Q?dxJRjYkvRcFXNXn+5UGMghsVvktKmkT/IEt4p1Q08ccLHS3HPgCRgsvGb2sE?= =?us-ascii?Q?g3A75tQmbP6r1pwz+tK+SGE8wf5Iv2XOUm43ySvIojjOvIAPPPXu+EMze6hA?= =?us-ascii?Q?uOofThlR2AFnYl8KkQrGxwAH35vBnHnjWMZkbESVvittx4AGtDFO3tCHOsgX?= =?us-ascii?Q?kn/6AodJihEfVnDAuIaEvoTJHhlZvHs8xfdQzAVLHaZE8LpKNCpabixCCOkj?= =?us-ascii?Q?DYC6O+dzs0k0Z6RwGVBY2Dm8iponUHb4uQFUyAqnvrUvlR9bwd/6Z1bkV8yt?= =?us-ascii?Q?suGZc9UBseh0cKUNLiHr20XFronr/0E8RTmQywiQwMJohkUMYufsIUANlO4W?= =?us-ascii?Q?pa8ysHjXLlfesWl1DBRPKpWeutPMjdNFlXESf1OhnF0Sc14jAcDQhAbelT9i?= =?us-ascii?Q?RzuMU337+teWsthg03QLq0Fes8DptPfdZMFFZKCsI8MlImzyMUsKRxu7ginI?= =?us-ascii?Q?dw1d2xujqA1aDc93dcrksdEW+7yGsIqlTGNhd6Dr+hzqZ0HmbnB1dd9ccHuS?= =?us-ascii?Q?tVOdvHdFVAFuITV7QAzf8eam63JGjNsQZtJV5W4Cq8qmvnEXVyCfjw9qgkNv?= =?us-ascii?Q?F1t2nV6b5olwQpiKZEQ3eCIUbuAxNQ7o0PVegXqDH2qg6s0rxPOLZBdnV5zR?= =?us-ascii?Q?I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6tBwmrCRBf4=; 7:6YodswpSnkfZhDlXEVlvcd/eCgpY34+r54BqcTKCUvjbj43ISeArYSt0DVFxy9eMzWMRgrXde3MJ5cEoQPYDw6TlgOuII0wGVJnQyRJf7xioof2Re3DC/cu9Vg83LFxsDYZuRxF5eJMC2nn6UKNpT4h3r43NAmzbdcVYcW0NrHteFpjuVCvX9TyaHSOGhU9LhEZCOhgKc/Fh39hUhyU4klVBb1UkmX5VsJLbeh5DGAo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2017 20:36:58.6460 (UTC) X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0701MB3823 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 From: Himanshu Madhani Signed-off-by: Himanshu Madhani Reviewed-by: Johannes Thumshirn --- drivers/scsi/qla2xxx/qla_def.h | 1 + drivers/scsi/qla2xxx/qla_isr.c | 8 ++++++-- drivers/scsi/qla2xxx/qla_target.c | 12 +++++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 486c075998f6..66d239cbbd66 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -922,6 +922,7 @@ struct mbx_cmd_32 { #define INTR_RSP_QUE_UPDATE_83XX 0x14 #define INTR_ATIO_QUE_UPDATE 0x1C #define INTR_ATIO_RSP_QUE_UPDATE 0x1D +#define INTR_ATIO_QUE_UPDATE_27XX 0x1E /* ISP mailbox loopback echo diagnostic error code */ #define MBS_LB_RESET 0x17 diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index ef7afd5eefe3..ab97fb06c239 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -3129,6 +3129,7 @@ qla24xx_intr_handler(int irq, void *dev_id) case INTR_RSP_QUE_UPDATE_83XX: qla24xx_process_response_queue(vha, rsp); break; + case INTR_ATIO_QUE_UPDATE_27XX: case INTR_ATIO_QUE_UPDATE:{ unsigned long flags2; spin_lock_irqsave(&ha->tgt.atio_lock, flags2); @@ -3259,6 +3260,7 @@ qla24xx_msix_default(int irq, void *dev_id) case INTR_RSP_QUE_UPDATE_83XX: qla24xx_process_response_queue(vha, rsp); break; + case INTR_ATIO_QUE_UPDATE_27XX: case INTR_ATIO_QUE_UPDATE:{ unsigned long flags2; spin_lock_irqsave(&ha->tgt.atio_lock, flags2); @@ -3347,7 +3349,8 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) .pre_vectors = QLA_BASE_VECTORS, }; - if (QLA_TGT_MODE_ENABLED() && IS_ATIO_MSIX_CAPABLE(ha)) { + if (QLA_TGT_MODE_ENABLED() && (ql2xenablemsix != 0) && + IS_ATIO_MSIX_CAPABLE(ha)) { desc.pre_vectors++; min_vecs++; } @@ -3432,7 +3435,8 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) * If target mode is enable, also request the vector for the ATIO * queue. */ - if (QLA_TGT_MODE_ENABLED() && IS_ATIO_MSIX_CAPABLE(ha)) { + if (QLA_TGT_MODE_ENABLED() && (ql2xenablemsix != 0) && + IS_ATIO_MSIX_CAPABLE(ha)) { qentry = &ha->msix_entries[QLA_ATIO_VECTOR]; rsp->msix = qentry; qentry->handle = rsp; diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index f05cfc83c9c8..12976a25f082 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -6546,6 +6546,7 @@ void qlt_24xx_config_rings(struct scsi_qla_host *vha) { struct qla_hw_data *ha = vha->hw; + struct init_cb_24xx *icb; if (!QLA_TGT_MODE_ENABLED()) return; @@ -6553,14 +6554,19 @@ qlt_24xx_config_rings(struct scsi_qla_host *vha) WRT_REG_DWORD(ISP_ATIO_Q_OUT(vha), 0); RD_REG_DWORD(ISP_ATIO_Q_OUT(vha)); - if (IS_ATIO_MSIX_CAPABLE(ha)) { + icb = (struct init_cb_24xx *)ha->init_cb; + + if ((ql2xenablemsix != 0) && IS_ATIO_MSIX_CAPABLE(ha)) { struct qla_msix_entry *msix = &ha->msix_entries[2]; - struct init_cb_24xx *icb = (struct init_cb_24xx *)ha->init_cb; icb->msix_atio = cpu_to_le16(msix->entry); ql_dbg(ql_dbg_init, vha, 0xf072, "Registering ICB vector 0x%x for atio que.\n", msix->entry); + } else if (ql2xenablemsix == 0) { + icb->firmware_options_2 |= cpu_to_le32(BIT_26); + ql_dbg(ql_dbg_init, vha, 0xf07f, + "Registering INTx vector for ATIO.\n"); } } @@ -6805,7 +6811,7 @@ qlt_probe_one_stage1(struct scsi_qla_host *base_vha, struct qla_hw_data *ha) if (!QLA_TGT_MODE_ENABLED()) return; - if (IS_QLA83XX(ha) || IS_QLA27XX(ha)) { + if ((ql2xenablemsix == 0) || IS_QLA83XX(ha) || IS_QLA27XX(ha)) { ISP_ATIO_Q_IN(base_vha) = &ha->mqiobase->isp25mq.atio_q_in; ISP_ATIO_Q_OUT(base_vha) = &ha->mqiobase->isp25mq.atio_q_out; } else {