From patchwork Fri Oct 13 16:34:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10005289 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 E733F60230 for ; Fri, 13 Oct 2017 16:34:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC77C27F89 for ; Fri, 13 Oct 2017 16:34:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C15FA2851E; Fri, 13 Oct 2017 16:34:19 +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 4D75027F89 for ; Fri, 13 Oct 2017 16:34:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752096AbdJMQeS (ORCPT ); Fri, 13 Oct 2017 12:34:18 -0400 Received: from mail-dm3nam03on0041.outbound.protection.outlook.com ([104.47.41.41]:13872 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751441AbdJMQeP (ORCPT ); Fri, 13 Oct 2017 12:34:15 -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=CbGd1C5jiDoN/bK1piU56kfcR/QYs/Sz/7ipi+Fmmt0Nf6rOLHHP2hBwIlLKn51I/s97XuPXe6raUPHv0XAS7NEWyHV2zt84PEPuQXW859ZgQOP1IAhMJQsI95a8URzVAGpeQxmtoKPcaJ92Jh26tSacQxN7qMqHw4H6bQ+tI5k= Received: from SN1PR0701CA0020.namprd07.prod.outlook.com (10.162.96.30) by BY2PR0701MB1941.namprd07.prod.outlook.com (10.163.155.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Fri, 13 Oct 2017 16:34:13 +0000 Received: from BY2FFO11FD036.protection.gbl (2a01:111:f400:7c0c::116) by SN1PR0701CA0020.outlook.office365.com (2a01:111:e400:5173::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.7 via Frontend Transport; Fri, 13 Oct 2017 16:34:13 +0000 Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BY2FFO11FD036.mail.protection.outlook.com (10.1.14.221) 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; Fri, 13 Oct 2017 16:34:13 +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; Fri, 13 Oct 2017 09:34:08 -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 v9DGY8Ru008081; Fri, 13 Oct 2017 09:34:08 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id v9DGY8cY008080; Fri, 13 Oct 2017 09:34:08 -0700 From: "Madhani, Madhani" To: , CC: , Subject: [PATCH v2 2/5] qla2xxx: Add ATIO-Q processing for INTx mode Date: Fri, 13 Oct 2017 09:34:04 -0700 Message-ID: <20171013163407.8038-3-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171013163407.8038-1-himanshu.madhani@cavium.com> References: <20171013163407.8038-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)(376002)(346002)(2980300002)(428002)(199003)(189002)(16586007)(8936002)(42186006)(47776003)(2950100002)(50226002)(189998001)(4326008)(2906002)(6666003)(110136005)(50986999)(101416001)(54906003)(316002)(33646002)(105586002)(76176999)(106466001)(87636003)(305945005)(69596002)(1076002)(81156014)(80596001)(86362001)(8676002)(48376002)(81166006)(5003940100001)(36756003)(72206003)(5660300001)(478600001)(356003)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0701MB1941; 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; BY2FFO11FD036; 1:6nuCNHiTwwvj9gCkgJfRYeaON8nqbguKvQh4xONBeXBGkgimmi0Aw0iMkplIxuQ6wHnlipTI/lIdiR1BkwBBka6Ev+8Lh4/eTRjPpkbFa/CQdqkUOWCvlIoH/dvMVjhr X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2954c12c-5b4a-49d2-b3d0-08d512583d51 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BY2PR0701MB1941; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB1941; 3:5xmrN1QelBfXEYJIkUE4Fl9gzSj+7h3KWgeDCQakn+/2xhHj4JZt3aLhB8QcR2x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5qiJCdEGnjYpxUKWxpdOgBMAT6AaLxj2Yi4b1Ucj9D8dd51KOJfpxVCN914JI1xSAtPf8Ch84fXs4ebaL/5nVR0nx0ZfiUr7i282Xl4KbHcQ3d+aBSjqmWYxqUKh5ZqG+yjC1AXPIK0XNP8BgRerzN5aEMgiwObnk7Pk0CeroOzc3/MlJTzu6i0UQXgcH1+QPP7bdcsfUfJWTQA2/fHlm0h66K1F9ooWnJMdpt+8gW8xXVl8bMHYZfi8bzBQANQYpNM7zTIVw+L2POl3eBkTrbe8ezzVDkRHgOQVORwvRSFxzTOajanykjH6e6Q5G/Xfqw2pc8rxPePoiLvQ/wF0AgfhO32B3uliJUYy1+0IohnpHyiWrOgrCNCLWQecvngQU+d6/OqkYZMBCjyLs4+sytYDQNGo 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)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6041248)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR0701MB1941; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR0701MB1941; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB1941; 4:t1TJhdD7twXTaG89MkfUubdI28eVpqEZjQFAaQi38TmA3gHQtEh60b03ny1sTVFRToEAMzoCD9NdRjzWEueNTCZyfI8TWTduxzjNy5W4fVpsE7/kM2HhGyve8zaavbARJrtIlxE8DAgS/0TvEp4wFKBACOermL0aB7VZNbvBIwjBNnKyB3vjvapAJGluyECMlslqgqoM+2huofPAm9EldMF9jVV4i1av4to2rWAzd7TJ9yOXqjEMco1snc8EnH19 X-Forefront-PRVS: 04599F3534 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0701MB1941; 23:ynxEeJ/9WAPXv3YN/jQ62gEVBuVZnph1H3MlC40?= =?us-ascii?Q?0lA4XBLSSVY22Hnp5U0YaYD43r7zFcAVKEEug10IjKy1ujqIKKwyJUKrC8pZ?= =?us-ascii?Q?rBQKRAXQZCtNe+RxnpPf49ZjWlRYubJLXZhPIkUIIgd7wCTJ1X+5MlSPMI8f?= =?us-ascii?Q?XGtRjQi3RKtHChEQti8QZ6QKoZbO0DybSliJSOYnXrMk30wv9pvKVD7OLiov?= =?us-ascii?Q?SriGRIEOgXx7HpteYxOxYlN/Js6Gh6LcYO3cj+ste+TzAxkOvzajqm7JUmQK?= =?us-ascii?Q?IJfFyIZuPMDEbbhvAFuCFCXfDoV5+NzDD95X3ADtHaDPWNK7k1+LiDkmWhaF?= =?us-ascii?Q?qJVUk18bXFlqQQd0SXR1ezkjIfStszX5+yOwzn1+2tZ9Rr+dwB9l+Qeo4Goo?= =?us-ascii?Q?bZRHKY3ShXdLCbD/IcACyWbYeDy86VdbA6931VfPwpnzR9QqfIyFBOB5Rwmw?= =?us-ascii?Q?BLdsOOwNNyeF0YcHo22zfm38scEb2Lrg9VK8KUQGaqXyihPTDuhYFXsW+fCB?= =?us-ascii?Q?OCcXKr5Ms1EKKJ+iUX//9VyXNX7NAW/l5tV1xROZ8Si1V2ZNhQajBTq2AUWN?= =?us-ascii?Q?BTlNHJ7c+8upQL2h03RWAO80gGj0vye1rS5CWCsI9clZ8k+heR7j+QYX9spx?= =?us-ascii?Q?s5JikdPt8bXZ+HduXwf+iYiEKNy+3yEto2yiXLUZTY1DkDywS+2KLLJQeld4?= =?us-ascii?Q?S5ok3mc9JxJNdJOYvJEqL1GOlqBDWm+DMy4u/TPwAm5V+qPfbUY6Pw+nA37v?= =?us-ascii?Q?StZg+aDXKh2AbE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HtOUutn4gHj7VPm53f82HJHTYqso9E2a24PPxSOGPVn7nnd4bq6/F8kkyjuij3mOMl5LE/Bb1TKvMfWOxNFs1hbRswatt0/puhNRPrVsG6NGe2HMXQ/JmNHDpX+qsmfYV6WgrFKuI8J9bIP3lN4aVP9TfM/teX77+0dJL+zw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2017 16:34:13.5951 (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: BY2PR0701MB1941 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 --- 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 {