From patchwork Wed Oct 17 06:37:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivasharan Srikanteshwara X-Patchwork-Id: 10644653 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C192C157A for ; Wed, 17 Oct 2018 06:38:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B18CD2999D for ; Wed, 17 Oct 2018 06:38:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A602529A95; Wed, 17 Oct 2018 06:38:33 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 4A6772999D for ; Wed, 17 Oct 2018 06:38:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727288AbeJQOck (ORCPT ); Wed, 17 Oct 2018 10:32:40 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:45237 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727099AbeJQOck (ORCPT ); Wed, 17 Oct 2018 10:32:40 -0400 Received: by mail-pf1-f193.google.com with SMTP id u12-v6so12666339pfn.12 for ; Tue, 16 Oct 2018 23:38:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dhAI+fUwX/oauhz/QIPe0ugjJ+IQ/5jWphTpBRSPWG8=; b=Qh0Eu/Ykxb7nW4bF8P/TJisYuT60XMmWkP+4UR9B/uTAW5zQsyp/MJa5kxB08s9eqh pGBx3biF4Ysn+XVFWpmjSoktTY+1+2XCigPvIuCYd8e51nrUiY1rTx0i+vnyfT/O30i7 7joxKS47d+EQvEhHIq8pHWDds6U0eml+nGZew= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dhAI+fUwX/oauhz/QIPe0ugjJ+IQ/5jWphTpBRSPWG8=; b=G1VZNQSV2eRdiav8QbJvyzOz47l4uPhhWyR2jE7z2CDN0egiLrx2lIJyixn6f7I+q9 XTli8akAjl8AZED8iDudy/vIxaHlGEuye+fWQjOzpqn1VmX2BbGDt9EBqxK31rwW6k07 6liJQ0a3NKcZZ2rx/HMfMD68kX4qIkcBuZNeJCM8BnNbPlJW+uV4fmVyk1xfylzQF8tm kFsJ8B2e3TLfdYKL5KyQ2tbcuCoDI4Wip0KxBLLfM5zTtGQsbkcrCWdZM9fZ63M2rJAU ZzVnZu+l7yJOFhzWd6hLDk3WEbISZ3tyq7CJqb0WUYT9HnkSEwuONoGVG/fGswR/5Pzq sSxg== X-Gm-Message-State: ABuFfohkXQrr5PctyKiTZXntPpn6pxF//gOM26sO8dBbyh/X2Ynh0T1I t8L63l8AbuflOg7av39rt0Coy9vIjNuL3Q== X-Google-Smtp-Source: ACcGV60OtJBJ2/QEIYo+3pYJrSAVTe2oDMkxjvJQn0ks0Cv4N3nYXnD7qao4li35jOX5MsWgW7EhOQ== X-Received: by 2002:a62:d206:: with SMTP id c6-v6mr185169pfg.8.1539758311455; Tue, 16 Oct 2018 23:38:31 -0700 (PDT) Received: from dhcp-135-24-192-142.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id y131-v6sm19375425pfg.164.2018.10.16.23.38.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Oct 2018 23:38:30 -0700 (PDT) From: Shivasharan S To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, Shivasharan S Subject: [PATCH V2 08/19] megaraid_sas: Fix combined reply queue mode detection Date: Tue, 16 Oct 2018 23:37:46 -0700 Message-Id: <1539758277-1882-9-git-send-email-shivasharan.srikanteshwara@broadcom.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1539758277-1882-1-git-send-email-shivasharan.srikanteshwara@broadcom.com> References: <1539758277-1882-1-git-send-email-shivasharan.srikanteshwara@broadcom.com> 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 Fix - For Invader series, if FW supports more than 8 MSI-x vectors, driver needs to enable combined reply queue mode. For Ventura series, driver enables combined reply queue mode in case of more than 16 MSI-x vectors. Signed-off-by: Sumit Saxena Signed-off-by: Shivasharan S --- drivers/scsi/megaraid/megaraid_sas_base.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index ab72acae08e5..57899ff7ca0b 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -5415,12 +5415,29 @@ static int megasas_init_fw(struct megasas_instance *instance) instance->msix_vectors = (scratch_pad_2 & MR_MAX_REPLY_QUEUES_OFFSET) + 1; fw_msix_count = instance->msix_vectors; - } else { /* Invader series supports more than 8 MSI-x vectors*/ + } else { instance->msix_vectors = ((scratch_pad_2 & MR_MAX_REPLY_QUEUES_EXT_OFFSET) >> MR_MAX_REPLY_QUEUES_EXT_OFFSET_SHIFT) + 1; - if (instance->msix_vectors > 16) - instance->msix_combined = true; + + /* + * For Invader series, > 8 MSI-x vectors + * supported by FW/HW implies combined + * reply queue mode is enabled. + * For Ventura series, > 16 MSI-x vectors + * supported by FW/HW implies combined + * reply queue mode is enabled. + */ + switch (instance->adapter_type) { + case INVADER_SERIES: + if (instance->msix_vectors > 8) + instance->msix_combined = true; + break; + case VENTURA_SERIES: + if (instance->msix_vectors > 16) + instance->msix_combined = true; + break; + } if (rdpq_enable) instance->is_rdpq = (scratch_pad_2 & MR_RDPQ_MODE_OFFSET) ?