From patchwork Thu Jun 20 10:51:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006437 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 D5CD81398 for ; Thu, 20 Jun 2019 10:52:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C658127528 for ; Thu, 20 Jun 2019 10:52:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA18D28650; Thu, 20 Jun 2019 10:52:44 +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 A8EDF27528 for ; Thu, 20 Jun 2019 10:52:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726492AbfFTKwn (ORCPT ); Thu, 20 Jun 2019 06:52:43 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42956 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfFTKwn (ORCPT ); Thu, 20 Jun 2019 06:52:43 -0400 Received: by mail-pf1-f196.google.com with SMTP id q10so1445774pff.9 for ; Thu, 20 Jun 2019 03:52:42 -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=TgCgky6YIODK9Qkx2FukavRnGMLU1Hv4ZF/hfiUliTU=; b=JXM2NGrDmYl+yadi0p7R3ziMAAFRIPbLQ/j+eiHRvY46UAFbXzKzoqEYFg89TlYtNk 0QhGtGlpC8wTnQ7xKh/qjaek6RFWtXKRKJ1yYq1jdZwd4ANwyJtnGxjPYQ1NMGbZ+4OM Pv8SyzELuaCBJg4/SQvCJ3VgXRdPVka5XUtws= 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=TgCgky6YIODK9Qkx2FukavRnGMLU1Hv4ZF/hfiUliTU=; b=KJHxtwyVQ0s6k391ErBuuoCGugu9f/OoBVkQY5aWkbXd+EDJ4YaQ+CWO4QoWCFSpj8 Sta18Zm5uYHF0deHQ8us6V0TFZ0fPxttPHh/xzecmtgTxmVF9S0EhrgLHAPRQHie3pwa Ero/yNVlu1NKAhMal5viR3q9JMDGyZjStJoR1c8mZJ7wqJhyB3bWPsgAW41ziyoxek9p JAqNFKOa4dZbxif4lXAr8T6stBnncO/p/KPlNMqUsAvIeDRqaoNtp+6HLAzguTgbDGS7 hapylq/rBSvGICiC0ldHdbKcbXsaKa4I4Z9nsaeLsguwXDdeM8TgVtVZW7f0thcrTbiM QmBQ== X-Gm-Message-State: APjAAAWjyCsEZP5ZPDJVFd89q7ZAMHTJQsr8O94F4HVnqzYT9MBOd4VI 9tAQVqqEKNtDfPleor4aRbhSVOZSjY3fL9Vi036hplZhXnu5pK1tC9iV7zQEjTuZyRlP9E4DJeQ U7WKhakBwT51entaiOXEhpMmNBumTzROIblead9C3W2xuX9ctdacH5QJNXtnLbuXm1QmWCK+Z7P 4DnxHrwyrz3fJaPEY= X-Google-Smtp-Source: APXvYqwMQfVyfwH1lI372Q3gotx1MIL1CTTWXOjsWzgEo2uedYRuLIBdSH5Rgd/bbXPC6BZ4yCffCw== X-Received: by 2002:a17:90a:db44:: with SMTP id u4mr2465934pjx.52.1561027961871; Thu, 20 Jun 2019 03:52:41 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.52.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:52:41 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 01/18] megaraid_sas: Add 32 bit atomic descriptor support to AERO adapters Date: Thu, 20 Jun 2019 16:21:51 +0530 Message-Id: <20190620105208.15011-2-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 Aero adapters provides Atomic Request Descriptor as an alternative method for posting an entry onto a request queue. The posting of an Atomic Request Descriptor is an atomic operation, providing a safe mechanism for multiple processors on the host to post requests without synchronization. This Atomic Request Descriptor format is identical to first 32 bits of Default Request Descriptor and uses only 32 bits. If Aero adapters support Atomic descriptor, driver should use it for posting IOs and DCMDs to firmware. Signed-off-by: Sumit Saxena Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas.h | 3 ++ drivers/scsi/megaraid/megaraid_sas_fusion.c | 45 +++++++++++++++++++++++------ 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index e138d14..a08dd9c 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -1600,6 +1600,8 @@ enum FW_BOOT_CONTEXT { #define MR_CAN_HANDLE_SYNC_CACHE_OFFSET 0X01000000 +#define MR_ATOMIC_DESCRIPTOR_SUPPORT_OFFSET (1 << 24) + #define MR_CAN_HANDLE_64_BIT_DMA_OFFSET (1 << 25) #define MEGASAS_WATCHDOG_THREAD_INTERVAL 1000 @@ -2395,6 +2397,7 @@ struct megasas_instance { struct dentry *raidmap_dump; #endif u8 enable_fw_dev_list; + bool atomic_desc_support; }; struct MR_LD_VF_MAP { u32 size; diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 8a7ac5c..4411408 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -277,21 +277,17 @@ inline void megasas_return_cmd_fusion(struct megasas_instance *instance, } /** - * megasas_fire_cmd_fusion - Sends command to the FW - * @instance: Adapter soft state - * @req_desc: 64bit Request descriptor - * - * Perform PCI Write. + * megasas_write_64bit_req_desc - PCI writes 64bit request descriptor + * @instance: Adapter soft state + * @req_desc: 64bit Request descriptor */ - static void -megasas_fire_cmd_fusion(struct megasas_instance *instance, +megasas_write_64bit_req_desc(struct megasas_instance *instance, union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc) { #if defined(writeq) && defined(CONFIG_64BIT) u64 req_data = (((u64)le32_to_cpu(req_desc->u.high) << 32) | le32_to_cpu(req_desc->u.low)); - writeq(req_data, &instance->reg_set->inbound_low_queue_port); #else unsigned long flags; @@ -305,6 +301,25 @@ megasas_fire_cmd_fusion(struct megasas_instance *instance, } /** + * megasas_fire_cmd_fusion - Sends command to the FW + * @instance: Adapter soft state + * @req_desc: 32bit or 64bit Request descriptor + * + * Perform PCI Write. AERO SERIES supports 32 bit Descriptor. + * Prior to AERO_SERIES support 64 bit Descriptor. + */ +static void +megasas_fire_cmd_fusion(struct megasas_instance *instance, + union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc) +{ + if (instance->atomic_desc_support) + writel(le32_to_cpu(req_desc->u.low), + &instance->reg_set->inbound_single_queue_port); + else + megasas_write_64bit_req_desc(instance, req_desc); +} + +/** * megasas_fusion_update_can_queue - Do all Adapter Queue depth related calculations here * @instance: Adapter soft state * fw_boot_context: Whether this function called during probe or after OCR @@ -1171,7 +1186,8 @@ megasas_ioc_init_fusion(struct megasas_instance *instance) break; } - megasas_fire_cmd_fusion(instance, &req_desc); + /* For AERO also, IOC_INIT requires 64 bit descriptor write */ + megasas_write_64bit_req_desc(instance, &req_desc); wait_and_poll(instance, cmd, MFI_IO_TIMEOUT_SECS); @@ -1181,6 +1197,17 @@ megasas_ioc_init_fusion(struct megasas_instance *instance) goto fail_fw_init; } + if (instance->adapter_type >= AERO_SERIES) { + scratch_pad_1 = megasas_readl + (instance, &instance->reg_set->outbound_scratch_pad_1); + + instance->atomic_desc_support = + (scratch_pad_1 & MR_ATOMIC_DESCRIPTOR_SUPPORT_OFFSET) ? 1 : 0; + + dev_info(&instance->pdev->dev, "FW supports atomic descriptor\t: %s\n", + instance->atomic_desc_support ? "Yes" : "No"); + } + return 0; fail_fw_init: From patchwork Thu Jun 20 10:51:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006439 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 31F2C1398 for ; Thu, 20 Jun 2019 10:52:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23E7027528 for ; Thu, 20 Jun 2019 10:52:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1848E28650; Thu, 20 Jun 2019 10:52:47 +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 9DAD827528 for ; Thu, 20 Jun 2019 10:52:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726729AbfFTKwq (ORCPT ); Thu, 20 Jun 2019 06:52:46 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:36781 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfFTKwq (ORCPT ); Thu, 20 Jun 2019 06:52:46 -0400 Received: by mail-pg1-f196.google.com with SMTP id f21so1397457pgi.3 for ; Thu, 20 Jun 2019 03:52:45 -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=MTW9Jfhqa3WzeDUCjzlQ1hjebGSFomDtiNWcykKm+Kw=; b=OF1v33r/oR60J8/RY+KxyA/ZYBtD/z27LfWTK5fol50u0a3upPCD9t1m34vvub1i9j jOOYN451QfDKowZJ+eRdpEzh+74gTTWrXcEUfvcJpybm+qzvFjnFZJosTZNZVIGIeT/g owlpkBfVYhu48uynnIn14sON8YwKYtBQqN5XI= 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=MTW9Jfhqa3WzeDUCjzlQ1hjebGSFomDtiNWcykKm+Kw=; b=lazzQ4Dka0wj1y7GUWLG3oFw5TO+JG79kQpwM0/rrjf2gMuNYH5RTiSF7SjnSJq16f y1OmNKndI/jwCzCwgdcyz7mH7IiwdoGcUHjvT1EbufuwR8C2TlwY9nbUxoLlBkZdhjjN lgF1pDypk1oOoTDIijb5uoI/UPTaDSCxHdgRsEePbmqV4K5IKzAWXedoAZK+ETOiSqAr cHVGxjCK3Xu+8vktPN3vikx0ziibKmVKoYsRxy16NeYHeDlzrobeXN0i4cKIUrTiV+CI +i1gP7FHj7oKx/4XBzvkXmJPLYjnc+lYggpJRHGqIwpYi41wsxW5H0bjYRQSvtMdKnPE fYDQ== X-Gm-Message-State: APjAAAWk2XqdB5cAPwWDto5i4QTgeTp5byupgJVF4AN7no94hgPwyFQR H8zhLj4xLH2uTZuT29hZR2jbRlLk4Qd3EjT+RGjk466656lOieeq2tSJtR7P/QGW4hy2gGck5F0 ilJb9Zgo9gT/BoKTmCgWrmMfdbk4wV8g/DwefWfHQgGBbOShGz7XfvTnMY2fkGK9Ooy8Zqp1yjW 8YxQHHNh44eb3oaHI= X-Google-Smtp-Source: APXvYqw6lAhR5qFNqgX+VjO9s9XKsrJGKw8JnQXR4e7hiNgCKqKbMWkD6yFH54oTi74PARplvSLokQ== X-Received: by 2002:a62:7d13:: with SMTP id y19mr71409152pfc.62.1561027965008; Thu, 20 Jun 2019 03:52:45 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.52.42 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:52:44 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 02/18] megaraid_sas: Add support for Non-secure Aero PCI IDs Date: Thu, 20 Jun 2019 16:21:52 +0530 Message-Id: <20190620105208.15011-3-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 This patch will add support for Non-secure Aero adapters' PCI IDs. Driver will throw an error message when a non-secure type controller is detected. Purpose of this interface is to avoid interacting with any firmware which is not secured/signed by Broadcom. Any tampering on Firmware component will be detected by hardware and it will be communicated to the driver to avoid any further interaction with that component. Signed-off-by: Sumit Saxena Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas.h | 4 ++++ drivers/scsi/megaraid/megaraid_sas_base.c | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index a08dd9c..61bcf7a 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -64,6 +64,10 @@ #define PCI_DEVICE_ID_LSI_AERO_10E2 0x10e2 #define PCI_DEVICE_ID_LSI_AERO_10E5 0x10e5 #define PCI_DEVICE_ID_LSI_AERO_10E6 0x10e6 +#define PCI_DEVICE_ID_LSI_AERO_10E0 0x10e0 +#define PCI_DEVICE_ID_LSI_AERO_10E3 0x10e3 +#define PCI_DEVICE_ID_LSI_AERO_10E4 0x10e4 +#define PCI_DEVICE_ID_LSI_AERO_10E7 0x10e7 /* * Intel HBA SSDIDs diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 5490898..7d1cf4e 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -168,6 +168,10 @@ static struct pci_device_id megasas_pci_table[] = { {PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_AERO_10E2)}, {PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_AERO_10E5)}, {PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_AERO_10E6)}, + {PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_AERO_10E0)}, + {PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_AERO_10E3)}, + {PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_AERO_10E4)}, + {PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_AERO_10E7)}, {} }; @@ -6991,6 +6995,12 @@ static int megasas_probe_one(struct pci_dev *pdev, u16 control = 0; switch (pdev->device) { + case PCI_DEVICE_ID_LSI_AERO_10E0: + case PCI_DEVICE_ID_LSI_AERO_10E3: + case PCI_DEVICE_ID_LSI_AERO_10E4: + case PCI_DEVICE_ID_LSI_AERO_10E7: + dev_err(&pdev->dev, "Adapter is in non secure mode\n"); + return 1; case PCI_DEVICE_ID_LSI_AERO_10E1: case PCI_DEVICE_ID_LSI_AERO_10E5: dev_info(&pdev->dev, "Adapter is in configurable secure mode\n"); @@ -7246,6 +7256,10 @@ megasas_suspend(struct pci_dev *pdev, pm_message_t state) struct megasas_instance *instance; instance = pci_get_drvdata(pdev); + + if (!instance) + return 0; + instance->unload = 1; dev_info(&pdev->dev, "%s is called\n", __func__); @@ -7299,6 +7313,10 @@ megasas_resume(struct pci_dev *pdev) int irq_flags = PCI_IRQ_LEGACY; instance = pci_get_drvdata(pdev); + + if (!instance) + return 0; + host = instance->host; pci_set_power_state(pdev, PCI_D0); pci_enable_wake(pdev, PCI_D0, 0); @@ -7467,6 +7485,10 @@ static void megasas_detach_one(struct pci_dev *pdev) u32 pd_seq_map_sz; instance = pci_get_drvdata(pdev); + + if (!instance) + return; + host = instance->host; fusion = instance->ctrl_context; @@ -7595,6 +7617,9 @@ static void megasas_shutdown(struct pci_dev *pdev) { struct megasas_instance *instance = pci_get_drvdata(pdev); + if (!instance) + return; + instance->unload = 1; if (megasas_wait_for_adapter_operational(instance)) From patchwork Thu Jun 20 10:51:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006441 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 CBD47112C for ; Thu, 20 Jun 2019 10:52:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDBD227528 for ; Thu, 20 Jun 2019 10:52:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B214128650; Thu, 20 Jun 2019 10:52:49 +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 597B727528 for ; Thu, 20 Jun 2019 10:52:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731253AbfFTKwt (ORCPT ); Thu, 20 Jun 2019 06:52:49 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:35461 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfFTKws (ORCPT ); Thu, 20 Jun 2019 06:52:48 -0400 Received: by mail-pl1-f193.google.com with SMTP id p1so1253931plo.2 for ; Thu, 20 Jun 2019 03:52:48 -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=Ao3L+nsrX/w76VkkQgVXFDTTGZFNBOjj6cS0RAgCCzo=; b=NVU9C85b911tDn/rgZjDyOUQE+o3FQBUVryOctC2Oap/RMdY/41g+lol5kgsaLx8cD oAj60a/io7k6QumP6U9artIUzNY5Dfq5VOe4mr1QeyuvxFAz3ijM+w8jNuYbeaJ/6vSd CJTWM+GwvH7XrF0WIjNOgyyLfOIDXDObtA1ig= 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=Ao3L+nsrX/w76VkkQgVXFDTTGZFNBOjj6cS0RAgCCzo=; b=iN9iJCMqKlUavkTcjgal0yIZiGEe4nAP6DVE/7qS5BB0NSM0osleZbaTLCLdaih7k7 10So+5rSF1hkFdxRLAwlh0jE/TAtYZ9v8/2OhB15UXAlVWX+1S7WOM8ghSeB4fmqIHE+ 8Zk2EjIo7czxFAHva1CSr5FKKdy2ZBNZxXhPFqlKgeNSvee/GJYno2eJTHJm8wCuBaA+ 6mUTgmWRXHEStzWEdsWXjzZpQXCidXL5l6c39wAW7kaqx0fWs3Uf/gS3xbr1n+KTDmDm doyzArw3QCiHGc43u3QnzYWD+xocghehYPdPJVVz8pA+Bp4IhP0MBRPLWkH0I83eo09h MI1w== X-Gm-Message-State: APjAAAVvQ60rQufnB/rlIO0bQlGnhH4mOdF1CcFo/K6m2sDnog9N0fkE 7SRX0A82Q7yJhs10VaUKcuszCuJl0oJZr/Q/mri+bQjptfvWUIVzy+I62AVBKOWnlJ3fZeIHoM/ gf67QmM9r3dcOYI1W/5cFG7KrqynblA8BrfUaHsqM7+sjqYByA+zbUnyMv1TG9E2bT3uEnlsvZD ARQRQltsX9yQFcSdw= X-Google-Smtp-Source: APXvYqwHAz98+SyCVYRyiKlmqvS69B8ghuvp2tYQJ4+OqxbD1ISKqJjE09QPkDMRwaokiTUC2AWZrw== X-Received: by 2002:a17:902:ab90:: with SMTP id f16mr121854134plr.262.1561027967917; Thu, 20 Jun 2019 03:52:47 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.52.45 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:52:47 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 03/18] megaraid_sas: Remove few debug counters from IO path Date: Thu, 20 Jun 2019 16:21:53 +0530 Message-Id: <20190620105208.15011-4-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 Signed-off-by: Kashyap Desai Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas.h | 5 ----- drivers/scsi/megaraid/megaraid_sas_fusion.c | 5 ----- 2 files changed, 10 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 61bcf7a..a972021 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -2323,11 +2323,6 @@ struct megasas_instance { atomic_t fw_outstanding; atomic_t ldio_outstanding; atomic_t fw_reset_no_pci_access; - atomic_t ieee_sgl; - atomic_t prp_sgl; - atomic_t sge_holes_type1; - atomic_t sge_holes_type2; - atomic_t sge_holes_type3; atomic64_t total_io_count; struct megasas_instance_template *instancet; diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 4411408..dac8552 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -2066,7 +2066,6 @@ megasas_is_prp_possible(struct megasas_instance *instance, mega_mod64(sg_dma_address(sg_scmd), mr_nvme_pg_size)) { build_prp = false; - atomic_inc(&instance->sge_holes_type1); break; } } @@ -2076,7 +2075,6 @@ megasas_is_prp_possible(struct megasas_instance *instance, sg_dma_len(sg_scmd)), mr_nvme_pg_size))) { build_prp = false; - atomic_inc(&instance->sge_holes_type2); break; } } @@ -2085,7 +2083,6 @@ megasas_is_prp_possible(struct megasas_instance *instance, if (mega_mod64(sg_dma_address(sg_scmd), mr_nvme_pg_size)) { build_prp = false; - atomic_inc(&instance->sge_holes_type3); break; } } @@ -2218,7 +2215,6 @@ megasas_make_prp_nvme(struct megasas_instance *instance, struct scsi_cmnd *scmd, main_chain_element->Length = cpu_to_le32(num_prp_in_chain * sizeof(u64)); - atomic_inc(&instance->prp_sgl); return build_prp; } @@ -2293,7 +2289,6 @@ megasas_make_sgl_fusion(struct megasas_instance *instance, memset(sgl_ptr, 0, instance->max_chain_frame_sz); } } - atomic_inc(&instance->ieee_sgl); } /** From patchwork Thu Jun 20 10:51:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006443 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 DF2C5112C for ; Thu, 20 Jun 2019 10:52:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D00762864E for ; Thu, 20 Jun 2019 10:52:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3EEB28653; Thu, 20 Jun 2019 10:52:52 +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 6691A2864E for ; Thu, 20 Jun 2019 10:52:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731352AbfFTKww (ORCPT ); Thu, 20 Jun 2019 06:52:52 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46193 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfFTKwv (ORCPT ); Thu, 20 Jun 2019 06:52:51 -0400 Received: by mail-pf1-f195.google.com with SMTP id 81so1436238pfy.13 for ; Thu, 20 Jun 2019 03:52:51 -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=1YBgpyZC5t+wsWk7wChS8HOs3vSiojNUjxFitgNjZEY=; b=ZeWGoddCgf5Zu/D8mcM7cd0skwanPa65lMVgnNLSp+8i6R4+mYVIXy9BCNEsDkLgdk c2zABFLrFqD7xN2aPhR2CGokcvFwLaeYYh9y1m8KeIlDVQB3TRkhleeoWoqdZaYJf76e 84JplUWe5tfISzrl1DQLBbU25yMS1hy/ZdOC0= 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=1YBgpyZC5t+wsWk7wChS8HOs3vSiojNUjxFitgNjZEY=; b=SVXJnuxcON0gLn09spxRj/yFH0hVQXM0TjGnbIhwLbusd8FN5We4QY0CHcpLf8F6bD 204reBgoV5PKsqVZDs+RMso9NbV4UHLIZk+PtuoNLkfxscilzSmSrRCpNdwwJGt30bnD ZLwWA+TnnGdegxquqJ+OqPjM0miuLXLCIBbzf4oVl0SDOK0vdTiAxM4MHzvFxrmzS/44 Rz7/3Lxe9JP2HzDvab2Ot4d2k1Ud4n4e2dk0hBBqAeEymiJikh6aRK2rnwGqQV9gv9kE Up2om//vjkOgqagATHAJS5Hbbi+2D8M3nUBL1o7n90+KRQpMMJaKdp65+GxhQcpwheYp ADPg== X-Gm-Message-State: APjAAAVaFdcBqFy+w7Gf/793r472sofbAQVi92rVfI6E5fyiLMn4avfw fAZeugO3m0p23FiOmIsq2G9K4As3rfwYz7SAqhkVhj2yhupP3FEqdqi7Ze9/ZhFiXVvwgoS49ON 2hTGP9ix6ua1ZdkaX45RcB3LLfEGnndo1ES8QybHYLav56GLqOME8C69mLDeyUqvpHUHShrn4gf 0EKL/0hu9dCNYLO6o= X-Google-Smtp-Source: APXvYqyjOD35Y12gwlG04i0/E1+ObcIJ2h4o5dro3MD/r1XojXbH9DcbqX69DwqF97K7Fufz3CVEjA== X-Received: by 2002:aa7:9212:: with SMTP id 18mr91367938pfo.120.1561027970993; Thu, 20 Jun 2019 03:52:50 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.52.48 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:52:50 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 04/18] megaraid_sas: Call disable_irq from process IRQ poll Date: Thu, 20 Jun 2019 16:21:54 +0530 Message-Id: <20190620105208.15011-5-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 On PowerPC architecture, calling disable_irq_nosync from IRQ context is not providing the required effect. In current megaraid_sas driver, disable_irq_nosync is being called from IRQ context before enabling IRQ poll. But due to the issue seen on PPC, after IRQ poll disable and legacy ISR is enabled, we are not seeing our ISR getting called. Fix: Call disable_irq from IRQ poll thread context instead of IRQ context. Signed-off-by: Shivasharan S Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas.h | 1 + drivers/scsi/megaraid/megaraid_sas_fusion.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index a972021..d333b8e 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -2186,6 +2186,7 @@ struct megasas_irq_context { u32 os_irq; struct irq_poll irqpoll; bool irq_poll_scheduled; + bool irq_line_enable; }; struct MR_DRV_SYSTEM_INFO { diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index dac8552..b8a5bbf 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -3601,7 +3601,7 @@ complete_cmd_fusion(struct megasas_instance *instance, u32 MSIxIndex, if (irq_context) { if (!irq_context->irq_poll_scheduled) { irq_context->irq_poll_scheduled = true; - disable_irq_nosync(irq_context->os_irq); + irq_context->irq_line_enable = true; irq_poll_sched(&irq_context->irqpoll); } return num_completed; @@ -3681,6 +3681,11 @@ int megasas_irqpoll(struct irq_poll *irqpoll, int budget) irq_ctx = container_of(irqpoll, struct megasas_irq_context, irqpoll); instance = irq_ctx->instance; + if (irq_ctx->irq_line_enable) { + disable_irq(irq_ctx->os_irq); + irq_ctx->irq_line_enable = false; + } + num_entries = complete_cmd_fusion(instance, irq_ctx->MSIxIndex, irq_ctx); if (num_entries < budget) { irq_poll_complete(irqpoll); @@ -3726,6 +3731,11 @@ irqreturn_t megasas_isr_fusion(int irq, void *devp) if (instance->mask_interrupts) return IRQ_NONE; +#if defined(ENABLE_IRQ_POLL) + if (irq_context->irq_poll_scheduled) + return IRQ_HANDLED; +#endif + if (!instance->msix_vectors) { mfiStatus = instance->instancet->clear_intr(instance); if (!mfiStatus) From patchwork Thu Jun 20 10:51:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006445 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 74A891932 for ; Thu, 20 Jun 2019 10:52:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65D3D28650 for ; Thu, 20 Jun 2019 10:52:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A34628657; Thu, 20 Jun 2019 10:52:56 +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 EC3A428650 for ; Thu, 20 Jun 2019 10:52:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726777AbfFTKwz (ORCPT ); Thu, 20 Jun 2019 06:52:55 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:35489 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfFTKwz (ORCPT ); Thu, 20 Jun 2019 06:52:55 -0400 Received: by mail-pf1-f196.google.com with SMTP id d126so1466390pfd.2 for ; Thu, 20 Jun 2019 03:52:55 -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=x21bqmk9dLzO1D0BNR75+yjl+IKbX45VB/zMtMVbSDI=; b=CLTjePUgj8+tEk+9K+jginmNbqRPbTXnzn39VoYMNE9YVYpUJSpOf8EbZm+jgy7We6 6UHCIx33EoxqgeWlQrexBX274cHiSTUEKC8AnJiRHExbLKvTQkjdB17oTk5she2jUL8f FweqR8diZ9PrdnRtfMAf7muqlAOY1QmLQqxtQ= 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=x21bqmk9dLzO1D0BNR75+yjl+IKbX45VB/zMtMVbSDI=; b=OefpqwhqRVsLMphstUryTWqlictdkGVo0e9YWwTjNSYVRt0cBEP3t9YySt05/vXVTZ zSNc4A4VFnp1HHCjjsJ3cDmsb9P7r3PlgZnc/NthV+aCtHAHHoAv8Um8A4kcFlnCUAOI /NHrjOqeGgBCHqHbUrHAtzcEWplmnOLUQeuIa1zp3AciP7B1HpoKTKQtRiDPNtxaLWyy GYZVPR4rOkH9wOouKq99kX0JMuxqqOCGljp5eXGGR+GJfWuc80h7gpKQPQiQ7TBhRnep M56otBlbMT1/pkY7tsoepFO1K54IK7M2OmHkGOweTZGXoyK53+POTPJHnxP6/klIo3rK HWvg== X-Gm-Message-State: APjAAAUMMoNYxfMQ/95aOjqiF8pd8hGB1Q61GLHZk1YD8tf+kIrmA7va IMPYYSPK5YEsCSqv51xdfWBTtkJfg2Q2AFae0579stha6fnZCHfUjgxkrk7CWIW8XmURcUqUe7j BPzquWHztyZKsp7l9rKu57bNeHLHx3sw+sMGgDxOS+Oo/RpYB8xH8kEafzPi3wvrxQhoBchdG2K jSukJWnDgMRO2QHfM= X-Google-Smtp-Source: APXvYqzGlDfvNQafyGcbDZmxb6VB0X6CJ6qbxRE3jYkYvxiQLhQz8U6VJtlRyrNw+MhWU1xuSEebAQ== X-Received: by 2002:a63:231a:: with SMTP id j26mr12100527pgj.389.1561027974305; Thu, 20 Jun 2019 03:52:54 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.52.51 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:52:53 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 05/18] megaraid_sas: Release Mutex lock before OCR in case of DCMD timeout Date: Thu, 20 Jun 2019 16:21:55 +0530 Message-Id: <20190620105208.15011-6-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 Issue: There is possibility of few DCMDs timing out with 'reset_mutex' lock held. As part of DCMD timeout handling, driver calls function megasas_reset_fusion which also tries to acquire same lock 'reset_mutex' and end up with deadlock. Fix: Upon timeout of DCMDs(which are fired with 'reset_mutex' lock held), driver will release 'reset_mutex' before calling OCR function and will acquire lock again after OCR function returns. Signed-off-by: Sumit Saxena Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas_base.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 7d1cf4e..54bb48e 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -4369,8 +4369,10 @@ megasas_get_pd_info(struct megasas_instance *instance, struct scsi_device *sdev) switch (dcmd_timeout_ocr_possible(instance)) { case INITIATE_OCR: cmd->flags |= DRV_DCMD_SKIP_REFIRE; + mutex_unlock(&instance->reset_mutex); megasas_reset_fusion(instance->host, MFI_IO_TIMEOUT_OCR); + mutex_lock(&instance->reset_mutex); break; case KILL_ADAPTER: megaraid_sas_kill_hba(instance); @@ -4861,8 +4863,10 @@ megasas_host_device_list_query(struct megasas_instance *instance, switch (dcmd_timeout_ocr_possible(instance)) { case INITIATE_OCR: cmd->flags |= DRV_DCMD_SKIP_REFIRE; + mutex_unlock(&instance->reset_mutex); megasas_reset_fusion(instance->host, MFI_IO_TIMEOUT_OCR); + mutex_lock(&instance->reset_mutex); break; case KILL_ADAPTER: megaraid_sas_kill_hba(instance); @@ -5010,8 +5014,10 @@ void megasas_get_snapdump_properties(struct megasas_instance *instance) switch (dcmd_timeout_ocr_possible(instance)) { case INITIATE_OCR: cmd->flags |= DRV_DCMD_SKIP_REFIRE; + mutex_unlock(&instance->reset_mutex); megasas_reset_fusion(instance->host, MFI_IO_TIMEOUT_OCR); + mutex_lock(&instance->reset_mutex); break; case KILL_ADAPTER: megaraid_sas_kill_hba(instance); @@ -5141,8 +5147,10 @@ megasas_get_ctrl_info(struct megasas_instance *instance) switch (dcmd_timeout_ocr_possible(instance)) { case INITIATE_OCR: cmd->flags |= DRV_DCMD_SKIP_REFIRE; + mutex_unlock(&instance->reset_mutex); megasas_reset_fusion(instance->host, MFI_IO_TIMEOUT_OCR); + mutex_lock(&instance->reset_mutex); break; case KILL_ADAPTER: megaraid_sas_kill_hba(instance); @@ -6398,8 +6406,10 @@ megasas_get_target_prop(struct megasas_instance *instance, switch (dcmd_timeout_ocr_possible(instance)) { case INITIATE_OCR: cmd->flags |= DRV_DCMD_SKIP_REFIRE; + mutex_unlock(&instance->reset_mutex); megasas_reset_fusion(instance->host, MFI_IO_TIMEOUT_OCR); + mutex_lock(&instance->reset_mutex); break; case KILL_ADAPTER: megaraid_sas_kill_hba(instance); @@ -7801,10 +7811,13 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance, opcode = le32_to_cpu(cmd->frame->dcmd.opcode); if (opcode == MR_DCMD_CTRL_SHUTDOWN) { + mutex_lock(&instance->reset_mutex); if (megasas_get_ctrl_info(instance) != DCMD_SUCCESS) { megasas_return_cmd(instance, cmd); + mutex_unlock(&instance->reset_mutex); return -1; } + mutex_unlock(&instance->reset_mutex); } if (opcode == MR_DRIVER_SET_APP_CRASHDUMP_MODE) { From patchwork Thu Jun 20 10:51:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006447 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 D2E1B1398 for ; Thu, 20 Jun 2019 10:52:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C40B22864E for ; Thu, 20 Jun 2019 10:52:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7F4B28650; Thu, 20 Jun 2019 10:52: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=-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 5CB4827528 for ; Thu, 20 Jun 2019 10:52:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731359AbfFTKw7 (ORCPT ); Thu, 20 Jun 2019 06:52:59 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:35493 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfFTKw6 (ORCPT ); Thu, 20 Jun 2019 06:52:58 -0400 Received: by mail-pf1-f194.google.com with SMTP id d126so1466481pfd.2 for ; Thu, 20 Jun 2019 03:52:58 -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=mveVJiAznNjg5E86Wj26dh5RZ/LgPI6cFDk8lk8GhzU=; b=N3pk1BWWw5IJvi8/mjwazahI2kpJ1xAiyPtSi7AzppmkFa39q9mltv74u/WXXjqQJc /H+IkvWFfTgcm76NLfqGc2e9/mQPEFFd4yrBaneUiJcSbIfVOY++WNSV/TynTTDnJwhe 7dtDOX1rTfJGiEcCbAOLCkq++sH12o3nYrSwU= 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=mveVJiAznNjg5E86Wj26dh5RZ/LgPI6cFDk8lk8GhzU=; b=jeyx0kgj8fzSjVxMt7e8Ew9oGZW3nTa/x5Vyio/Q4bq3T5pu6YHRtMdV6RCxmKyOMY o+Gt7vqVnes7nqIGhjB4FEsiXZxVKz+5IZXbsoLYsaXhPoO8lPscUhZENfqNNKTBiiqa LlSMCk23OTPa5aLaaHCoLL/ENVpRS4MgxXlOd5Xz+BHqPQuhD3UwbRkm/6nlzo2cAUR2 E1JxRbfAln5dXrXSKBtuH93yWjQGFF3wiz8nLhyujRz3P1QrOcfpSMjXn8ikT8O8nJ2H jgT9gGdjqdDELF7jlJlFAILMyHMtl0YfyuO6oqtpPU/uewZIVEm/HpW5Kyo8q3bzu/Qr EV1A== X-Gm-Message-State: APjAAAXDiAmEYtjtU6DJ6tK4QYHu08tja0e1CFrt90bbBRx0GmKYdAK6 A7dS1HGzF4Y46T2ZNjLZFjci4pt2Ks/t+pBf5Yx8JjhUOk/g3H1Tk9Y1Ef6CvZOBC1uaO4SaTaC iQg5+dMxUDwru5znx7tTh+Nb3cPxS7Mmh3eO2h5Pt/D6k8qAkG2+MLR9XNlUE/ljYcT0p5XwqPg Eqx7AYDslOiOmxGdM= X-Google-Smtp-Source: APXvYqwQ6Xqj50qqLLoKl3hcRp/XdxvGJcf++VUOkwisFn+sqDTvSoY82kJbugTHZmJgrOboSv9Ezw== X-Received: by 2002:a62:e511:: with SMTP id n17mr119775257pff.181.1561027977751; Thu, 20 Jun 2019 03:52:57 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.52.54 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:52:57 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 06/18] megaraid_sas: In probe context, retry IOC INIT once if firmware is in fault Date: Thu, 20 Jun 2019 16:21:56 +0530 Message-Id: <20190620105208.15011-7-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 Issue: Under certain conditions, controller goes in FAULT state after IOC INIT fired to firmware. Such Fault can be recovered through controller reset. Fix: In driver probe context, if firmware fault is observed post IOC INIT, driver would do controller reset followed by retry logic for IOC INIT command. Signed-off-by: Shivasharan S Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas_fusion.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index b8a5bbf..2e711b1 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -1009,6 +1009,7 @@ wait_and_poll(struct megasas_instance *instance, struct megasas_cmd *cmd, { int i; struct megasas_header *frame_hdr = &cmd->frame->hdr; + u32 status_reg; u32 msecs = seconds * 1000; @@ -1018,6 +1019,12 @@ wait_and_poll(struct megasas_instance *instance, struct megasas_cmd *cmd, for (i = 0; (i < msecs) && (frame_hdr->cmd_status == 0xff); i += 20) { rmb(); msleep(20); + if (!(i % 5000)) { + status_reg = instance->instancet->read_fw_status_reg(instance) + & MFI_STATE_MASK; + if (status_reg == MFI_STATE_FAULT) + break; + } } if (frame_hdr->cmd_status == MFI_STAT_INVALID_STATUS) @@ -1720,6 +1727,7 @@ megasas_init_adapter_fusion(struct megasas_instance *instance) struct fusion_context *fusion; u32 scratch_pad_1; int i = 0, count; + u32 status_reg; fusion = instance->ctrl_context; @@ -1802,8 +1810,21 @@ megasas_init_adapter_fusion(struct megasas_instance *instance) if (megasas_alloc_cmds_fusion(instance)) goto fail_alloc_cmds; - if (megasas_ioc_init_fusion(instance)) - goto fail_ioc_init; + if (megasas_ioc_init_fusion(instance)) { + status_reg = instance->instancet->read_fw_status_reg(instance); + if (((status_reg & MFI_STATE_MASK) == MFI_STATE_FAULT) && + (status_reg & MFI_RESET_ADAPTER)) { + /* Do a chip reset and then retry IOC INIT once */ + if (megasas_adp_reset_wait_for_ready + (instance, true, 0) == FAILED) + goto fail_ioc_init; + + if (megasas_ioc_init_fusion(instance)) + goto fail_ioc_init; + } else { + goto fail_ioc_init; + } + } megasas_display_intel_branding(instance); if (megasas_get_ctrl_info(instance)) { From patchwork Thu Jun 20 10:51:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006449 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 13B741932 for ; Thu, 20 Jun 2019 10:53:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0526727528 for ; Thu, 20 Jun 2019 10:53:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDDCD28650; Thu, 20 Jun 2019 10:53:02 +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 A2CF527528 for ; Thu, 20 Jun 2019 10:53:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730913AbfFTKxC (ORCPT ); Thu, 20 Jun 2019 06:53:02 -0400 Received: from mail-pg1-f176.google.com ([209.85.215.176]:44377 "EHLO mail-pg1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfFTKxC (ORCPT ); Thu, 20 Jun 2019 06:53:02 -0400 Received: by mail-pg1-f176.google.com with SMTP id n2so1373148pgp.11 for ; Thu, 20 Jun 2019 03:53:01 -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=RL1aRJOLxqXyxOFp2XTkM11O//DXdQuboF4qE6dMT68=; b=AkfCEtGjdNCuJ9ExPiODDUwg+sjMG2yAGcBflrydJaEvC4JpNbjOR4HQ+IAhcV1Of4 vUHetJjL+lapT9hQuRpNljUrGsShQ8eMJjxHX9pnxAFLqUOOkQpEjSbDcyVIeyZuG6xp u3NTqOK6uzXR1db6tt04hjhGc92MdYftTezvM= 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=RL1aRJOLxqXyxOFp2XTkM11O//DXdQuboF4qE6dMT68=; b=bnA/OaL6mOog3A5/mCLrH+dZHLGSjfPChIUk7Y1nv15jFCzcdem6kV39eBFTojX24+ ZK4ZIkw+/yC0ayaaAsgOTxHRZJbmVr+c0VHMnvuLVc6rtKlRucGk3wdcs78ToLtYMW0W 7QpD8LEnuNPZ1/Zj8zip0i6ZZBOc9f9BnWdhyCM8fNbQIT2x7AAU1yWyAbch6HVkWHOO NtyvxE0BTioR+Rkmb/yEIlGnX9TSvmTuQjGsNfUP2ifD/6QOdIb+8yABqZW6CVf86w6C 3+Q+vuh8+HvOKSUph4i8PSXtVcz96zsRy7GSF+D07H0WtlNzpeD2PAh6Y45zhfcjlUBA eDkA== X-Gm-Message-State: APjAAAXBl4LJqh6nrbn8mnJTSzSPlF5eK86izseSGvovX95AB8B7C0xF fH1a1Bfrfv07mDK4gRS6GleVN00YGi9LXKYWgUy4kjiM/v6CDZJ1JQHNLQ/FiBB1log7x+YOvpE Grp2k4yEdQy2MeE1+ir5u2IGcdZyh/3U8kGSkwkfw0bkTjstiJS0KoNB+mckbFqR4jhhug9J/Dx wWBea7DIVPFzBS2pQ= X-Google-Smtp-Source: APXvYqwPQy/ZyBhRoW9Yt+rcnSCJufkxqdsDrN8NTyQx0q16KkH8GMRjBbsayKa3JZkdOM3e9yBw9g== X-Received: by 2002:a17:90a:480a:: with SMTP id a10mr2464867pjh.57.1561027981140; Thu, 20 Jun 2019 03:53:01 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.52.57 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:53:00 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 07/18] megaraid_sas: Don't send FPIO to RL Bypass queue Date: Thu, 20 Jun 2019 16:21:57 +0530 Message-Id: <20190620105208.15011-8-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 Firmware does not expect FastPath IO sent through Region Lock Bypass queue. Though firmware never exposes such settings when fastpath IO can be sent to RL bypass queue but it's safer to remove dead code which directs fastpath IO to RL Bypass queue. Signed-off-by: Sumit Saxena Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas_fusion.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 2e711b1..a765662 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -2876,10 +2876,6 @@ megasas_build_ldio_fusion(struct megasas_instance *instance, (MPI2_REQ_DESCRIPT_FLAGS_FP_IO << MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); if (instance->adapter_type == INVADER_SERIES) { - if (rctx->reg_lock_flags == REGION_TYPE_UNUSED) - cmd->request_desc->SCSIIO.RequestFlags = - (MEGASAS_REQ_DESCRIPT_FLAGS_NO_LOCK << - MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); rctx->type = MPI2_TYPE_CUDA; rctx->nseg = 0x1; io_request->IoFlags |= cpu_to_le16(MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH); From patchwork Thu Jun 20 10:51:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006451 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 C3E20112C for ; Thu, 20 Jun 2019 10:53:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B52AE27528 for ; Thu, 20 Jun 2019 10:53:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A945328650; Thu, 20 Jun 2019 10:53:06 +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 10BEC27528 for ; Thu, 20 Jun 2019 10:53:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731436AbfFTKxF (ORCPT ); Thu, 20 Jun 2019 06:53:05 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:46018 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfFTKxF (ORCPT ); Thu, 20 Jun 2019 06:53:05 -0400 Received: by mail-pg1-f195.google.com with SMTP id s21so1369564pga.12 for ; Thu, 20 Jun 2019 03:53:04 -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 :mime-version:content-transfer-encoding; bh=ZcglgUXaK1MvJIHZ8sWYFR18WSuVnGfZV5jcIw8NZcc=; b=HjGhu162cCjh1VLY89vI7z7hffueB5yWve9WFm0wx+MWKxcdC8USrgluGfftgDlEDD pRJEOZBe8AXhap652o1f7je6nK9iAbhzW6dQGYmxhzA+j9Z2+cPpEVEUKzjDEOBFjPeo nZwvBX8o2gueuFgvK87NJ6S9lADR8gIHKbQXs= 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:mime-version:content-transfer-encoding; bh=ZcglgUXaK1MvJIHZ8sWYFR18WSuVnGfZV5jcIw8NZcc=; b=LawDEC6AnuxsxXzx86VPNbfPB8wBwUQZ26Rio1DxpWjQ4dauv+JdrhsMtG4E6Tgu65 ldj1ZI/ltZSptOyeErI9XlKNmBuDs0MTN6rdTRNkL8pwJsbZkXwz9ptG17LAkI1CxALf 6yanY0J3KuAsmNAdkXGJ38MMtSvSTfia2s9v3XcCKSXsx1bE39U0hzbzfInRy1/U9gze TVLT8g4V51H45Ad2JqQx3xlAMArBmqk3KvHzVUwC0VELdhuAgfErmdAkyfaMdtwxQjSn ByzM713YfvloEdgi0MqTlQ5hiAP8guBrKycnRfY0zitQ6fWyjMLLWsdNAiT8UZt6Dcio x98g== X-Gm-Message-State: APjAAAWEGCp6vnO227UcItmpxpMNjoKBlJdEJlP6dZXTYz5wvwEHlJXC QjePQHHd7n6Na8wwvGly3at4HH/Bsos/QlDA1ip+h/xeurFZjJz8RJFewk84yxxKr/eLtElBFa3 nzU2s/IZqytsbMbFcM5KnU4ZCcHyhbtN4j2BHmt6ggtS4sTqNXzFdavSOK52Nr1K4C/jb3FUjCu 272IusZnDTMGK22CE= X-Google-Smtp-Source: APXvYqysEm4IxWlNLQiLtVRqCOA6TxfJgWu8u8oNjlYkfc/XOQI+mRTqig/TY9s8NWsGFHEZm/5MVQ== X-Received: by 2002:a63:c0e:: with SMTP id b14mr12318139pgl.4.1561027984063; Thu, 20 Jun 2019 03:53:04 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.53.01 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:53:03 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 08/18] megaraid_sas: Handle sequence JBOD map failure at driver level Date: Thu, 20 Jun 2019 16:21:58 +0530 Message-Id: <20190620105208.15011-9-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> MIME-Version: 1.0 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 Issue: This issue is applicable to scenario when JBOD sequence map is unavailable (memory allocation for JBOD sequence map failed) to driver but feature is supported by firmware. If the driver sends a JBOD IO by not adding 255(MAX_PHYSICAL_DEVICES - 1) to device ID when underlying firmware supports JBOD sequence map, it will lead to the IO failure. Fix: For JBOD IOs, driver will not use the RAID map to fetch the devhandle, if JBOD sequence map is unavailable. Driver will set Devhandle to 0xffff and Target ID to 'device ID + 255(MAX_PHYSICAL_DEVICES - 1)'. Signed-off-by: Sumit Saxena Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas.h | 2 + drivers/scsi/megaraid/megaraid_sas_base.c | 14 ++++-- drivers/scsi/megaraid/megaraid_sas_fusion.c | 77 ++++++++++++++++------------- 3 files changed, 55 insertions(+), 38 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index d333b8e..cd63281 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -2398,7 +2398,9 @@ struct megasas_instance { #endif u8 enable_fw_dev_list; bool atomic_desc_support; + bool support_seqnum_jbod_fp; }; + struct MR_LD_VF_MAP { u32 size; union MR_LD_REF ref; diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 54bb48e..554ec72 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -5103,7 +5103,7 @@ megasas_get_ctrl_info(struct megasas_instance *instance) * in case of Firmware upgrade without system reboot. */ megasas_update_ext_vd_details(instance); - instance->use_seqnum_jbod_fp = + instance->support_seqnum_jbod_fp = ci->adapterOperations3.useSeqNumJbodFP; instance->support_morethan256jbod = ci->adapter_operations4.support_pd_map_target_id; @@ -5140,6 +5140,8 @@ megasas_get_ctrl_info(struct megasas_instance *instance) dev_info(&instance->pdev->dev, "FW provided TM TaskAbort/Reset timeout\t: %d secs/%d secs\n", instance->task_abort_tmo, instance->max_reset_tmo); + dev_info(&instance->pdev->dev, "JBOD sequence map support\t: %s\n", + instance->support_seqnum_jbod_fp ? "Yes" : "No"); break; @@ -5554,10 +5556,12 @@ megasas_setup_jbod_map(struct megasas_instance *instance) pd_seq_map_sz = sizeof(struct MR_PD_CFG_SEQ_NUM_SYNC) + (sizeof(struct MR_PD_CFG_SEQ) * (MAX_PHYSICAL_DEVICES - 1)); + instance->use_seqnum_jbod_fp = + instance->support_seqnum_jbod_fp; if (reset_devices || !fusion || - !instance->ctrl_info_buf->adapterOperations3.useSeqNumJbodFP) { + !instance->support_seqnum_jbod_fp) { dev_info(&instance->pdev->dev, - "Jbod map is not supported %s %d\n", + "JBOD sequence map is disabled %s %d\n", __func__, __LINE__); instance->use_seqnum_jbod_fp = false; return; @@ -6042,8 +6046,8 @@ static int megasas_init_fw(struct megasas_instance *instance) instance->UnevenSpanSupport ? "yes" : "no"); dev_info(&instance->pdev->dev, "firmware crash dump : %s\n", instance->crash_dump_drv_support ? "yes" : "no"); - dev_info(&instance->pdev->dev, "jbod sync map : %s\n", - instance->use_seqnum_jbod_fp ? "yes" : "no"); + dev_info(&instance->pdev->dev, "JBOD sequence map : %s\n", + instance->use_seqnum_jbod_fp ? "enabled" : "disabled"); instance->max_sectors_per_req = instance->max_num_sge * SGE_BUFFER_SIZE / 512; diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index a765662..5121d4c 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -3083,44 +3083,55 @@ megasas_build_syspd_fusion(struct megasas_instance *instance, << MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT; /* If FW supports PD sequence number */ - if (instance->use_seqnum_jbod_fp && - instance->pd_list[pd_index].driveType == TYPE_DISK) { - /* TgtId must be incremented by 255 as jbod seq number is index - * below raid map - */ - /* More than 256 PD/JBOD support for Ventura */ - if (instance->support_morethan256jbod) - pRAID_Context->virtual_disk_tgt_id = - pd_sync->seq[pd_index].pd_target_id; - else - pRAID_Context->virtual_disk_tgt_id = - cpu_to_le16(device_id + (MAX_PHYSICAL_DEVICES - 1)); - pRAID_Context->config_seq_num = pd_sync->seq[pd_index].seqNum; - io_request->DevHandle = pd_sync->seq[pd_index].devHandle; - if (instance->adapter_type >= VENTURA_SERIES) { - io_request->RaidContext.raid_context_g35.routing_flags |= - (1 << MR_RAID_CTX_ROUTINGFLAGS_SQN_SHIFT); - io_request->RaidContext.raid_context_g35.nseg_type |= - (1 << RAID_CONTEXT_NSEG_SHIFT); - io_request->RaidContext.raid_context_g35.nseg_type |= - (MPI2_TYPE_CUDA << RAID_CONTEXT_TYPE_SHIFT); + if (instance->support_seqnum_jbod_fp) { + if (instance->use_seqnum_jbod_fp && + instance->pd_list[pd_index].driveType == TYPE_DISK) { + + /* More than 256 PD/JBOD support for Ventura */ + if (instance->support_morethan256jbod) + pRAID_Context->virtual_disk_tgt_id = + pd_sync->seq[pd_index].pd_target_id; + else + pRAID_Context->virtual_disk_tgt_id = + cpu_to_le16(device_id + + (MAX_PHYSICAL_DEVICES - 1)); + pRAID_Context->config_seq_num = + pd_sync->seq[pd_index].seqNum; + io_request->DevHandle = + pd_sync->seq[pd_index].devHandle; + if (instance->adapter_type >= VENTURA_SERIES) { + io_request->RaidContext.raid_context_g35.routing_flags |= + (1 << MR_RAID_CTX_ROUTINGFLAGS_SQN_SHIFT); + io_request->RaidContext.raid_context_g35.nseg_type |= + (1 << RAID_CONTEXT_NSEG_SHIFT); + io_request->RaidContext.raid_context_g35.nseg_type |= + (MPI2_TYPE_CUDA << RAID_CONTEXT_TYPE_SHIFT); + } else { + pRAID_Context->type = MPI2_TYPE_CUDA; + pRAID_Context->nseg = 0x1; + pRAID_Context->reg_lock_flags |= + (MR_RL_FLAGS_SEQ_NUM_ENABLE | + MR_RL_FLAGS_GRANT_DESTINATION_CUDA); + } } else { - pRAID_Context->type = MPI2_TYPE_CUDA; - pRAID_Context->nseg = 0x1; - pRAID_Context->reg_lock_flags |= - (MR_RL_FLAGS_SEQ_NUM_ENABLE|MR_RL_FLAGS_GRANT_DESTINATION_CUDA); + pRAID_Context->virtual_disk_tgt_id = + cpu_to_le16(device_id + + (MAX_PHYSICAL_DEVICES - 1)); + pRAID_Context->config_seq_num = 0; + io_request->DevHandle = cpu_to_le16(0xFFFF); } - } else if (fusion->fast_path_io) { - pRAID_Context->virtual_disk_tgt_id = cpu_to_le16(device_id); - pRAID_Context->config_seq_num = 0; - local_map_ptr = fusion->ld_drv_map[(instance->map_id & 1)]; - io_request->DevHandle = - local_map_ptr->raidMap.devHndlInfo[device_id].curDevHdl; } else { - /* Want to send all IO via FW path */ pRAID_Context->virtual_disk_tgt_id = cpu_to_le16(device_id); pRAID_Context->config_seq_num = 0; - io_request->DevHandle = cpu_to_le16(0xFFFF); + + if (fusion->fast_path_io) { + local_map_ptr = + fusion->ld_drv_map[(instance->map_id & 1)]; + io_request->DevHandle = + local_map_ptr->raidMap.devHndlInfo[device_id].curDevHdl; + } else { + io_request->DevHandle = cpu_to_le16(0xFFFF); + } } cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle; From patchwork Thu Jun 20 10:51:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006453 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 1F4EE1932 for ; Thu, 20 Jun 2019 10:53:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 109EE27528 for ; Thu, 20 Jun 2019 10:53:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01E0F2864E; Thu, 20 Jun 2019 10:53:09 +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 994EA28650 for ; Thu, 20 Jun 2019 10:53:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731448AbfFTKxI (ORCPT ); Thu, 20 Jun 2019 06:53:08 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:43992 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726392AbfFTKxI (ORCPT ); Thu, 20 Jun 2019 06:53:08 -0400 Received: by mail-pf1-f196.google.com with SMTP id i189so1443713pfg.10 for ; Thu, 20 Jun 2019 03:53:08 -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=CMzim16g0haLFiQPV9XYI5J3leuIdfSlox5jPaNCXRY=; b=dmstti4MBadGKh5tMU3ya5j83KDtpg0aiqYHKmkw2oUvuo0nezHf7pceBPLWB9GCsA NQ1+TgIyWIGaMmtoxJU8Kb6Rc0WS4b/I49h+VcFB39ZGOMV2YVJHdtI1Xb+D8RWDhzQR YsyL3yCSCe/+I1hUFjgQhvDbqCYH4ZzNDVL54= 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=CMzim16g0haLFiQPV9XYI5J3leuIdfSlox5jPaNCXRY=; b=lP+rvmwcW+4boG39LhqaIPb2W+gjahzdjjmt0B1rg1eluZ7mlTqnvrGrvAPq+zCUqh jDlrlg1Srr/kOeOWNCnr+saV17zAwRQhcZ7+1CHY98heRG2m6NLsKwoLCF67tw7rUU/U /n9nNtrDgJjxvdaDxfsDDXbzYUl3+JfIVMo+r4lizKgEMhcxN3B2QnkEzHsx8lgSYWXG lwzHdkb1finSqPqOCBZ3w+MGfVQkNFV4lOc2uR71W0bgPpOrEBQ7iIqwZXzcs4+/7mjd gYXVm5TU1jkT3UyhIwxXIzg8443TeZP6Uo7946U9q/+Nmx/skK+ko+LqSACkByrKfiZf srJg== X-Gm-Message-State: APjAAAXJgCva6yFY1gFM88+SLzBa0TRKFc+ux7u1LdPmRllAiGeJzlUP iPGEO+VZ1tvRe0jHZixytrHJyzxHRWx9GVlW44SwKMVxeY6vfeJGrNG4S5r2CmPGRt7z/QRWMHW aJ4GrniINxLbpdOlmtK0qQUPI4Q1pxmY7vKhRuny+UyR//8qLCHKOPOK26Y0IHMGochPzj6PivF ZJPQVz2Om5JKoeqUI= X-Google-Smtp-Source: APXvYqxQi2l8BREl0irCvPEt38PHCbyDJ3W311mGfWoQZ7BnmmeCeZeTQGPoZtw+V7fF1yAXOvt89Q== X-Received: by 2002:a17:90a:2343:: with SMTP id f61mr2486229pje.130.1561027987347; Thu, 20 Jun 2019 03:53:07 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.53.04 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:53:06 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 09/18] megaraid_sas: megaraid_sas: Add check for count returned by HOST_DEVICE_LIST DCMD Date: Thu, 20 Jun 2019 16:21:59 +0530 Message-Id: <20190620105208.15011-10-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 Signed-off-by: Shivasharan S Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas_base.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 554ec72..a886de3e3 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -4827,6 +4827,9 @@ megasas_host_device_list_query(struct megasas_instance *instance, */ count = le32_to_cpu(ci->count); + if (count > (MEGASAS_MAX_PD + MAX_LOGICAL_DRIVES_EXT)) + break; + if (megasas_dbg_lvl & LD_PD_DEBUG) dev_info(&instance->pdev->dev, "%s, Device count: 0x%x\n", __func__, count); From patchwork Thu Jun 20 10:52:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006455 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 C18BB112C for ; Thu, 20 Jun 2019 10:53:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3F0B27528 for ; Thu, 20 Jun 2019 10:53:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A856728650; Thu, 20 Jun 2019 10:53:12 +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 4130F27528 for ; Thu, 20 Jun 2019 10:53:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731352AbfFTKxM (ORCPT ); Thu, 20 Jun 2019 06:53:12 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33343 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfFTKxL (ORCPT ); Thu, 20 Jun 2019 06:53:11 -0400 Received: by mail-pg1-f194.google.com with SMTP id m4so786762pgk.0 for ; Thu, 20 Jun 2019 03:53:11 -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=TUNP3/GEs4BdPR5S0pmQLB6jVYGQK1gtCSlVf7s5jwk=; b=L8wXcK4spjKbkBS6EuJ1gH53SgsbJviQzR2xz2+ONYfewN66GFX+4VN++KT+RIqijH Z1tkXwgqEdVegjfdhgjVt7bNqnsZRpTNMUloZ+61HEHq/uGhhNbVCGuB8Fj85lnpWZH1 zI7GZwsFzvwA8d0pnjmMBd6MSa1FH6IbGQ2oc= 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=TUNP3/GEs4BdPR5S0pmQLB6jVYGQK1gtCSlVf7s5jwk=; b=sHxgmAWR4moTuNHJ6fLW3ZSVaQSm94MTv0GxI4YIoGeu9pFyhoEBKRl/BOIMOok/36 ZlvFBK6mq2cfMgeaxY00eT6fif9J1hVLpFeOTWwmZzP4993sUktc/aO0oGjxieQy/ykb tJxr6ERieobb5RMFiLbRmMDUnJfMnL7uofJ6pN9DxPibQ46UJ9joXV07ch32Dgnb+0C/ cvwQ24guJixFesp9Af3bPBCmTXwrtDJsVYUOwbsohQAe/NK1IH9zusYWDcl84fkahSc/ c8I8MA9z6VXf8YqzQe3byFEW1FzHTZyeB5uc/tv3o4FFCvwnLViQ89FlCxTPNwL7fjUK /Tow== X-Gm-Message-State: APjAAAWHpaWRY32li6lHC+AjllKA5IbKKpqO+aduxFOUCHrePmKQjWos zb1bZGT797fri30vaD/j5qGHoHZCIqquk/AXRzNaa3MsBo9jFzL3YttOYUNhG7u3uBnADJzsU5Z 6m+PR8R8K4PhLWq7BjnrYD8phSQCVgkFXqXBYR4gubeRBId2fTsIwuWwKRMhM09cfcost25N2z+ xCF5QnX3OweTr+ X-Google-Smtp-Source: APXvYqxGVRm84487gyp4KDNC63Wt0FQyG1nfPljdo6CfipvRmnbs1aZjvszKflA6hrW2aUPWbB+Fig== X-Received: by 2002:a17:90a:3590:: with SMTP id r16mr2501128pjb.44.1561027990509; Thu, 20 Jun 2019 03:53:10 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.53.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:53:09 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 10/18] megaraid_sas: RAID1 PCI bandwidth limit algorithm is applicable for only Ventura Date: Thu, 20 Jun 2019 16:22:00 +0530 Message-Id: <20190620105208.15011-11-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 RAID1 PCI bandwidth limit algorithm is not applicable to Aero as it's PCIe Gen4 adapter. Signed-off-by: Sumit Saxena Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas_base.c | 3 +++ drivers/scsi/megaraid/megaraid_sas_fusion.c | 24 +++++++++++++----------- drivers/scsi/megaraid/megaraid_sas_fusion.h | 2 +- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index a886de3e3..5244b6e 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -5777,6 +5777,9 @@ static int megasas_init_fw(struct megasas_instance *instance) MR_MAX_RAID_MAP_SIZE_MASK); } + if (instance->adapter_type == VENTURA_SERIES) + fusion->pcie_bw_limitation = true; + /* Check if MSI-X is supported while in ready state */ msix_enable = (instance->instancet->read_fw_status_reg(instance) & 0x4000000) >> 0x1a; diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 5121d4c..ad18474 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -2621,9 +2621,10 @@ static void megasas_stream_detect(struct megasas_instance *instance, * */ static void -megasas_set_raidflag_cpu_affinity(union RAID_CONTEXT_UNION *praid_context, - struct MR_LD_RAID *raid, bool fp_possible, - u8 is_read, u32 scsi_buff_len) +megasas_set_raidflag_cpu_affinity(struct fusion_context *fusion, + union RAID_CONTEXT_UNION *praid_context, + struct MR_LD_RAID *raid, bool fp_possible, + u8 is_read, u32 scsi_buff_len) { u8 cpu_sel = MR_RAID_CTX_CPUSEL_0; struct RAID_CONTEXT_G35 *rctx_g35; @@ -2681,11 +2682,11 @@ megasas_set_raidflag_cpu_affinity(union RAID_CONTEXT_UNION *praid_context, * vs MR_RAID_FLAGS_IO_SUB_TYPE_CACHE_BYPASS. * IO Subtype is not bitmap. */ - if ((raid->level == 1) && (!is_read)) { - if (scsi_buff_len > MR_LARGE_IO_MIN_SIZE) - praid_context->raid_context_g35.raid_flags = - (MR_RAID_FLAGS_IO_SUB_TYPE_LDIO_BW_LIMIT - << MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT); + if ((fusion->pcie_bw_limitation) && (raid->level == 1) && (!is_read) && + (scsi_buff_len > MR_LARGE_IO_MIN_SIZE)) { + praid_context->raid_context_g35.raid_flags = + (MR_RAID_FLAGS_IO_SUB_TYPE_LDIO_BW_LIMIT + << MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT); } } @@ -2834,8 +2835,9 @@ megasas_build_ldio_fusion(struct megasas_instance *instance, (instance->host->can_queue)) { fp_possible = false; atomic_dec(&instance->fw_outstanding); - } else if ((scsi_buff_len > MR_LARGE_IO_MIN_SIZE) || - (atomic_dec_if_positive(&mrdev_priv->r1_ldio_hint) > 0)) { + } else if (fusion->pcie_bw_limitation && + ((scsi_buff_len > MR_LARGE_IO_MIN_SIZE) || + (atomic_dec_if_positive(&mrdev_priv->r1_ldio_hint) > 0))) { fp_possible = false; atomic_dec(&instance->fw_outstanding); if (scsi_buff_len > MR_LARGE_IO_MIN_SIZE) @@ -2860,7 +2862,7 @@ megasas_build_ldio_fusion(struct megasas_instance *instance, /* If raid is NULL, set CPU affinity to default CPU0 */ if (raid) - megasas_set_raidflag_cpu_affinity(&io_request->RaidContext, + megasas_set_raidflag_cpu_affinity(fusion, &io_request->RaidContext, raid, fp_possible, io_info.isRead, scsi_buff_len); else diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.h b/drivers/scsi/megaraid/megaraid_sas_fusion.h index 9873829..b50da38 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.h +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.h @@ -1335,7 +1335,7 @@ struct fusion_context { dma_addr_t ioc_init_request_phys; struct MPI2_IOC_INIT_REQUEST *ioc_init_request; struct megasas_cmd *ioc_init_cmd; - + bool pcie_bw_limitation; }; union desc_value { From patchwork Thu Jun 20 10:52:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006457 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 6BD5A112C for ; Thu, 20 Jun 2019 10:53:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B13627528 for ; Thu, 20 Jun 2019 10:53:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AE0F28650; Thu, 20 Jun 2019 10:53: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=-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 91D2C27528 for ; Thu, 20 Jun 2019 10:53:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726777AbfFTKxP (ORCPT ); Thu, 20 Jun 2019 06:53:15 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:46233 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731158AbfFTKxP (ORCPT ); Thu, 20 Jun 2019 06:53:15 -0400 Received: by mail-pf1-f193.google.com with SMTP id 81so1436815pfy.13 for ; Thu, 20 Jun 2019 03:53:14 -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=UwfdqmjTCz96BciZ834nttPOE+gzE0u5ZgR+uMxNsaI=; b=YIrpfR3S3muPwXlibXHzsuvAE2yTBIifJMAJythwJrUe5Nuej3UvgWGgco32SbGkY7 La9WnWcTQTiXr9SzSqq0MjxocIHlN7t9Yn1VVlZq0GSuY3zxoXWXDGwiv2PENy3+A9sr rK++pz2w80soDheZJZk725V/hURwDXNB+UpVQ= 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=UwfdqmjTCz96BciZ834nttPOE+gzE0u5ZgR+uMxNsaI=; b=RZDTewxeXmoyTbw1pOKcK5hw0sAZNFeE4VHXCuVO79o5egu7wGbVZzVpXpkuwsTmRh 6+uQ1vBwBrYAPjGJRhOAs36pEbKVpcOeT1fLGqScopGsPHmfiTPBurRgIi743UOD6Ui2 Y+q/k0m76wBa36o2kdGUHN29c458ppeIpRwyYsSSjR0FtEp2dtFPT2ijQIMwZO/0L3mb baYfRuQxdKBa4oZ4/QBY5cQf4TL9yyo8zFgUO/CrNqbLknXDBiLtsubPkkmsiar4eCD6 xlm6TIhPV8sMp8i1UqOUfc77iRyrtvct9P6Weta19OQo0ZHYwBio92ZoWx5OLJrz1y5t LkVg== X-Gm-Message-State: APjAAAWOzEE3C9y8+bR5ipJFLPcwZliyMIX4gkbwXbEw4uS8rz5AT9pi /ZBFTOYBfsheWkLMfw2gxkSh5q538WVarXpz2hS0hIrMDi8qyGpKv14uqO1AuVQR86ZMMe3eYp9 u3vXdyFcN/LRUZy2fJHypcaojp3boNOJWSUhrA7qnpaxFwLQHq99gv/0jZjHyHbVQ9PEdyyOkbc vTcHtBRebiErLP X-Google-Smtp-Source: APXvYqxxkBlB2uoZI9thoXUtH8PI8hLVRtwr/Pcfh7+uC0iU0Oy/6ClTZTRT7lbVSCfi5+GLIWSnWg== X-Received: by 2002:a17:90a:be0a:: with SMTP id a10mr2337464pjs.112.1561027993823; Thu, 20 Jun 2019 03:53:13 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.53.10 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:53:13 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 11/18] megaraid_sas: Offload Aero RAID5/6 division calculations to driver Date: Thu, 20 Jun 2019 16:22:01 +0530 Message-Id: <20190620105208.15011-12-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 For RAID5/RAID6 volumes configured behind Aero, driver will be doing 64bit division operations on behalf of firmware as controller's ARM CPU is very slow in this division. Later, driver calculate Q-ARM, P-ARM and Log-ARM and pass those values to firmware by writing these values to RAID_CONTEXT. Signed-off-by: Sumit Saxena Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas_base.c | 10 +++- drivers/scsi/megaraid/megaraid_sas_fp.c | 78 +++++++++++++++++++++++++++++ drivers/scsi/megaraid/megaraid_sas_fusion.c | 6 +-- drivers/scsi/megaraid/megaraid_sas_fusion.h | 24 ++++++--- 4 files changed, 108 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 5244b6e..81e708b 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -5777,8 +5777,16 @@ static int megasas_init_fw(struct megasas_instance *instance) MR_MAX_RAID_MAP_SIZE_MASK); } - if (instance->adapter_type == VENTURA_SERIES) + switch (instance->adapter_type) { + case VENTURA_SERIES: fusion->pcie_bw_limitation = true; + break; + case AERO_SERIES: + fusion->r56_div_offload = true; + break; + default: + break; + } /* Check if MSI-X is supported while in ready state */ msix_enable = (instance->instancet->read_fw_status_reg(instance) & diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c index d296255..43a2e49 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fp.c +++ b/drivers/scsi/megaraid/megaraid_sas_fp.c @@ -902,6 +902,77 @@ u8 MR_GetPhyParams(struct megasas_instance *instance, u32 ld, u64 stripRow, } /* + * mr_get_phy_params_r56_rmw - Calculate parameters for R56 CTIO write operation + * @instance: Adapter soft state + * @ld: LD index + * @stripNo: Strip Number + * @io_info: IO info structure pointer + * pRAID_Context: RAID context pointer + * map: RAID map pointer + * + * This routine calculates the logical arm, data Arm, row number and parity arm + * for R56 CTIO write operation. + */ +static void mr_get_phy_params_r56_rmw(struct megasas_instance *instance, + u32 ld, u64 stripNo, + struct IO_REQUEST_INFO *io_info, + struct RAID_CONTEXT_G35 *pRAID_Context, + struct MR_DRV_RAID_MAP_ALL *map) +{ + struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); + u8 span, dataArms, arms, dataArm, logArm; + s8 rightmostParityArm, PParityArm; + u64 rowNum; + u64 *pdBlock = &io_info->pdBlock; + + dataArms = raid->rowDataSize; + arms = raid->rowSize; + + rowNum = mega_div64_32(stripNo, dataArms); + /* parity disk arm, first arm is 0 */ + rightmostParityArm = (arms - 1) - mega_mod64(rowNum, arms); + + /* logical arm within row */ + logArm = mega_mod64(stripNo, dataArms); + /* physical arm for data */ + dataArm = mega_mod64((rightmostParityArm + 1 + logArm), arms); + + if (raid->spanDepth == 1) { + span = 0; + } else { + span = (u8)MR_GetSpanBlock(ld, rowNum, pdBlock, map); + if (span == SPAN_INVALID) + return; + } + + if (raid->level == 6) { + /* P Parity arm, note this can go negative adjust if negative */ + PParityArm = (arms - 2) - mega_mod64(rowNum, arms); + + if (PParityArm < 0) + PParityArm += arms; + + /* rightmostParityArm is P-Parity for RAID 5 and Q-Parity for RAID */ + pRAID_Context->flow_specific.r56_arm_map = rightmostParityArm; + pRAID_Context->flow_specific.r56_arm_map |= + (u16)(PParityArm << RAID_CTX_R56_P_ARM_SHIFT); + } else { + pRAID_Context->flow_specific.r56_arm_map |= + (u16)(rightmostParityArm << RAID_CTX_R56_P_ARM_SHIFT); + } + + pRAID_Context->reg_lock_row_lba = cpu_to_le64(rowNum); + pRAID_Context->flow_specific.r56_arm_map |= + (u16)(logArm << RAID_CTX_R56_LOG_ARM_SHIFT); + cpu_to_le16s(&pRAID_Context->flow_specific.r56_arm_map); + pRAID_Context->span_arm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | dataArm; + pRAID_Context->raid_flags = (MR_RAID_FLAGS_IO_SUB_TYPE_R56_DIV_OFFLOAD << + MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT); + + return; +} + +/* ****************************************************************************** * * MR_BuildRaidContext function @@ -1108,6 +1179,13 @@ MR_BuildRaidContext(struct megasas_instance *instance, /* save pointer to raid->LUN array */ *raidLUN = raid->LUN; + /* Aero R5/6 Division Offload for WRITE */ + if (fusion->r56_div_offload && (raid->level >= 5) && !isRead) { + mr_get_phy_params_r56_rmw(instance, ld, start_strip, io_info, + (struct RAID_CONTEXT_G35 *)pRAID_Context, + map); + return true; + } /*Get Phy Params only if FP capable, or else leave it to MR firmware to do the calculation.*/ diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index ad18474..058d22b 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -3324,9 +3324,9 @@ void megasas_prepare_secondRaid1_IO(struct megasas_instance *instance, r1_cmd->request_desc->SCSIIO.DevHandle = cmd->r1_alt_dev_handle; r1_cmd->io_request->DevHandle = cmd->r1_alt_dev_handle; r1_cmd->r1_alt_dev_handle = cmd->io_request->DevHandle; - cmd->io_request->RaidContext.raid_context_g35.smid.peer_smid = + cmd->io_request->RaidContext.raid_context_g35.flow_specific.peer_smid = cpu_to_le16(r1_cmd->index); - r1_cmd->io_request->RaidContext.raid_context_g35.smid.peer_smid = + r1_cmd->io_request->RaidContext.raid_context_g35.flow_specific.peer_smid = cpu_to_le16(cmd->index); /*MSIxIndex of both commands request descriptors should be same*/ r1_cmd->request_desc->SCSIIO.MSIxIndex = @@ -3444,7 +3444,7 @@ megasas_complete_r1_command(struct megasas_instance *instance, rctx_g35 = &cmd->io_request->RaidContext.raid_context_g35; fusion = instance->ctrl_context; - peer_smid = le16_to_cpu(rctx_g35->smid.peer_smid); + peer_smid = le16_to_cpu(rctx_g35->flow_specific.peer_smid); r1_cmd = fusion->cmd_list[peer_smid - 1]; scmd_local = cmd->scmd; diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.h b/drivers/scsi/megaraid/megaraid_sas_fusion.h index b50da38..ca32b2b 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.h +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.h @@ -87,7 +87,8 @@ enum MR_RAID_FLAGS_IO_SUB_TYPE { MR_RAID_FLAGS_IO_SUB_TYPE_RMW_P = 3, MR_RAID_FLAGS_IO_SUB_TYPE_RMW_Q = 4, MR_RAID_FLAGS_IO_SUB_TYPE_CACHE_BYPASS = 6, - MR_RAID_FLAGS_IO_SUB_TYPE_LDIO_BW_LIMIT = 7 + MR_RAID_FLAGS_IO_SUB_TYPE_LDIO_BW_LIMIT = 7, + MR_RAID_FLAGS_IO_SUB_TYPE_R56_DIV_OFFLOAD = 8 }; /* @@ -151,12 +152,15 @@ struct RAID_CONTEXT_G35 { u16 timeout_value; /* 0x02 -0x03 */ u16 routing_flags; // 0x04 -0x05 routing flags u16 virtual_disk_tgt_id; /* 0x06 -0x07 */ - u64 reg_lock_row_lba; /* 0x08 - 0x0F */ + __le64 reg_lock_row_lba; /* 0x08 - 0x0F */ u32 reg_lock_length; /* 0x10 - 0x13 */ - union { - u16 next_lmid; /* 0x14 - 0x15 */ - u16 peer_smid; /* used for the raid 1/10 fp writes */ - } smid; + union { // flow specific + u16 rmw_op_index; /* 0x14 - 0x15, R5/6 RMW: rmw operation index*/ + u16 peer_smid; /* 0x14 - 0x15, R1 Write: peer smid*/ + u16 r56_arm_map; /* 0x14 - 0x15, Unused [15], LogArm[14:10], P-Arm[9:5], Q-Arm[4:0] */ + + } flow_specific; + u8 ex_status; /* 0x16 : OUT */ u8 status; /* 0x17 status */ u8 raid_flags; /* 0x18 resvd[7:6], ioSubType[5:4], @@ -247,6 +251,13 @@ union RAID_CONTEXT_UNION { #define RAID_CTX_SPANARM_SPAN_SHIFT (5) #define RAID_CTX_SPANARM_SPAN_MASK (0xE0) +/* LogArm[14:10], P-Arm[9:5], Q-Arm[4:0] */ +#define RAID_CTX_R56_Q_ARM_MASK (0x1F) +#define RAID_CTX_R56_P_ARM_SHIFT (5) +#define RAID_CTX_R56_P_ARM_MASK (0x3E0) +#define RAID_CTX_R56_LOG_ARM_SHIFT (10) +#define RAID_CTX_R56_LOG_ARM_MASK (0x7C00) + /* number of bits per index in U32 TrackStream */ #define BITS_PER_INDEX_STREAM 4 #define INVALID_STREAM_NUM 16 @@ -1336,6 +1347,7 @@ struct fusion_context { struct MPI2_IOC_INIT_REQUEST *ioc_init_request; struct megasas_cmd *ioc_init_cmd; bool pcie_bw_limitation; + bool r56_div_offload; }; union desc_value { From patchwork Thu Jun 20 10:52:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006459 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 386881398 for ; Thu, 20 Jun 2019 10:53:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2948A27528 for ; Thu, 20 Jun 2019 10:53:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DA8828650; Thu, 20 Jun 2019 10:53: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=-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 81D4A27528 for ; Thu, 20 Jun 2019 10:53:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731450AbfFTKxS (ORCPT ); Thu, 20 Jun 2019 06:53:18 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:45893 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731158AbfFTKxS (ORCPT ); Thu, 20 Jun 2019 06:53:18 -0400 Received: by mail-pl1-f193.google.com with SMTP id bi6so1230177plb.12 for ; Thu, 20 Jun 2019 03:53:17 -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=M5Ikn0WwF0jEYEACrmAo3QQIMRMmJhSVmksSrHy10kE=; b=LT3ujnN6/+Vsq4PjfdbEpOlMBk3tFQcLVi/Qv1X+RyLk9AGmXDylMr8329/vi0w1RT Botp1hrI1SBmSgrRschA2O3AiPmfiOVfcAMy/sUz3mJsI0+PfJ20tB3rDyiZcPYQux44 M6kkUJge+BRBZcESQCj8ki9lOlxu/Y48UUklo= 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=M5Ikn0WwF0jEYEACrmAo3QQIMRMmJhSVmksSrHy10kE=; b=DKCPwimhmYbjKBtYq7mH2KzMp6qLB70l6XIN1bgZ5vALoYyY3o9PiQOXuW2W+zmRos YG4PIB1uGuFJ2bcTT6F6xM0LdDsgMtMlMSJRLu9Pi1W3ixTaYzDErnLeY/TnTS5J8igY j2AVMJ2Wau5bNCKj1Ejc8gknJ6ZOQvvqC1yRHqn6GAFlM1oiJq8TPfXZyHN+tNPeq5Im eSY9/zgnl+FIsKnuF92rnu9UUuyUAEnsW1ceTsp5CU968v/vMvQmkztDyekC7zPOoWUc NgQwC4njb6CtoxEuYGSILqqlCzjx1w63TfoZPEpsvDwAt67jdxjk+UeAXaSL10+RCtSZ DKaw== X-Gm-Message-State: APjAAAXZeQuzDkm4dcm0OtLWr3q3CFy1PY3X/nofla3bew3bPndbRAzE jVFtdVd7mDYa6CnUBNOjg7xDQuydou9VirCfkgWcITq/c87NtqfqPyfOSkdvNAIgaDMWy91goul kFoXGF7QR9xJFbpanddRs/ckMAA1OPGyvQDqYh/yg6B6+NDDD8PIxVvI/70/SLDJzIB9p6aVs1/ w2ppVKjrTIc38l X-Google-Smtp-Source: APXvYqwNkBdza0dZsKqkLdB28vIMVWmDuFggrMP69gCk4+HTwYdE518Ph8q1FOruZiuLOgdHgmzrmA== X-Received: by 2002:a17:902:aa0a:: with SMTP id be10mr121115469plb.293.1561027996816; Thu, 20 Jun 2019 03:53:16 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.53.14 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:53:16 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 12/18] megaraid_sas: Add support for MPI toolbox commands Date: Thu, 20 Jun 2019 16:22:02 +0530 Message-Id: <20190620105208.15011-13-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 Added driver support to allow passthrough MPI toolbox type MFI commands to firmware based on firmware capability. Signed-off-by: Sumit Saxena Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas.h | 36 ++++++++++++++++++++++++++++- drivers/scsi/megaraid/megaraid_sas_base.c | 31 ++++++++++++++++++++++++- drivers/scsi/megaraid/megaraid_sas_fusion.c | 7 ++++++ 3 files changed, 72 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index cd63281..83baac3 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -208,6 +208,7 @@ enum MFI_CMD_OP { MFI_CMD_SMP = 0x7, MFI_CMD_STP = 0x8, MFI_CMD_NVME = 0x9, + MFI_CMD_TOOLBOX = 0xa, MFI_CMD_OP_COUNT, MFI_CMD_INVALID = 0xff }; @@ -1467,7 +1468,39 @@ struct megasas_ctrl_info { u8 reserved6[64]; - u32 rsvdForAdptOp[64]; + struct { + #if defined(__BIG_ENDIAN_BITFIELD) + u32 reserved:19; + u32 support_pci_lane_margining: 1; + u32 support_psoc_update:1; + u32 support_force_personality_change:1; + u32 support_fde_type_mix:1; + u32 support_snap_dump:1; + u32 support_nvme_tm:1; + u32 support_oce_only:1; + u32 support_ext_mfg_vpd:1; + u32 support_pcie:1; + u32 support_cvhealth_info:1; + u32 support_profile_change:2; + u32 mr_config_ext2_supported:1; + #else + u32 mr_config_ext2_supported:1; + u32 support_profile_change:2; + u32 support_cvhealth_info:1; + u32 support_pcie:1; + u32 support_ext_mfg_vpd:1; + u32 support_oce_only:1; + u32 support_nvme_tm:1; + u32 support_snap_dump:1; + u32 support_fde_type_mix:1; + u32 support_force_personality_change:1; + u32 support_psoc_update:1; + u32 support_pci_lane_margining: 1; + u32 reserved:19; + #endif + } adapter_operations5; + + u32 rsvdForAdptOp[63]; u8 reserved7[3]; @@ -2399,6 +2432,7 @@ struct megasas_instance { u8 enable_fw_dev_list; bool atomic_desc_support; bool support_seqnum_jbod_fp; + bool support_pci_lane_margining; }; struct MR_LD_VF_MAP { diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 81e708b..4c7a093 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -188,6 +188,7 @@ static u32 support_poll_for_event; u32 megasas_dbg_lvl; static u32 support_device_change; static bool support_nvme_encapsulation; +static bool support_pci_lane_margining; /* define lock for aen poll */ spinlock_t poll_aen_lock; @@ -3494,6 +3495,7 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd, case MFI_CMD_SMP: case MFI_CMD_STP: case MFI_CMD_NVME: + case MFI_CMD_TOOLBOX: megasas_complete_int_cmd(instance, cmd); break; @@ -5099,6 +5101,7 @@ megasas_get_ctrl_info(struct megasas_instance *instance) le32_to_cpus((u32 *)&ci->adapterOperations2); le32_to_cpus((u32 *)&ci->adapterOperations3); le16_to_cpus((u16 *)&ci->adapter_operations4); + le32_to_cpus((u32 *)&ci->adapter_operations5); /* Update the latest Ext VD info. * From Init path, store current firmware details. @@ -5112,6 +5115,8 @@ megasas_get_ctrl_info(struct megasas_instance *instance) ci->adapter_operations4.support_pd_map_target_id; instance->support_nvme_passthru = ci->adapter_operations4.support_nvme_passthru; + instance->support_pci_lane_margining = + ci->adapter_operations5.support_pci_lane_margining; instance->task_abort_tmo = ci->TaskAbortTO; instance->max_reset_tmo = ci->MaxResetTO; @@ -5145,6 +5150,8 @@ megasas_get_ctrl_info(struct megasas_instance *instance) instance->task_abort_tmo, instance->max_reset_tmo); dev_info(&instance->pdev->dev, "JBOD sequence map support\t: %s\n", instance->support_seqnum_jbod_fp ? "Yes" : "No"); + dev_info(&instance->pdev->dev, "PCI Lane Margining support\t: %s\n", + instance->support_pci_lane_margining ? "Yes" : "No"); break; @@ -7793,7 +7800,9 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance, if ((ioc->frame.hdr.cmd >= MFI_CMD_OP_COUNT) || ((ioc->frame.hdr.cmd == MFI_CMD_NVME) && - !instance->support_nvme_passthru)) { + !instance->support_nvme_passthru) || + ((ioc->frame.hdr.cmd == MFI_CMD_TOOLBOX) && + !instance->support_pci_lane_margining)) { dev_err(&instance->pdev->dev, "Received invalid ioctl command 0x%x\n", ioc->frame.hdr.cmd); @@ -8277,6 +8286,14 @@ support_nvme_encapsulation_show(struct device_driver *dd, char *buf) static DRIVER_ATTR_RO(support_nvme_encapsulation); +static ssize_t +support_pci_lane_margining_show(struct device_driver *dd, char *buf) +{ + return sprintf(buf, "%u\n", support_pci_lane_margining); +} + +static DRIVER_ATTR_RO(support_pci_lane_margining); + static inline void megasas_remove_scsi_device(struct scsi_device *sdev) { sdev_printk(KERN_INFO, sdev, "SCSI device is removed\n"); @@ -8546,6 +8563,7 @@ static int __init megasas_init(void) support_poll_for_event = 2; support_device_change = 1; support_nvme_encapsulation = true; + support_pci_lane_margining = true; memset(&megasas_mgmt_info, 0, sizeof(megasas_mgmt_info)); @@ -8602,8 +8620,17 @@ static int __init megasas_init(void) if (rval) goto err_dcf_support_nvme_encapsulation; + rval = driver_create_file(&megasas_pci_driver.driver, + &driver_attr_support_pci_lane_margining); + if (rval) + goto err_dcf_support_pci_lane_margining; + return rval; +err_dcf_support_pci_lane_margining: + driver_remove_file(&megasas_pci_driver.driver, + &driver_attr_support_nvme_encapsulation); + err_dcf_support_nvme_encapsulation: driver_remove_file(&megasas_pci_driver.driver, &driver_attr_support_device_change); @@ -8643,6 +8670,8 @@ static void __exit megasas_exit(void) driver_remove_file(&megasas_pci_driver.driver, &driver_attr_version); driver_remove_file(&megasas_pci_driver.driver, &driver_attr_support_nvme_encapsulation); + driver_remove_file(&megasas_pci_driver.driver, + &driver_attr_support_pci_lane_margining); pci_unregister_driver(&megasas_pci_driver); megasas_exit_debugfs(); diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 058d22b..e124341 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -4246,6 +4246,13 @@ void megasas_refire_mgmt_cmd(struct megasas_instance *instance) } break; + case MFI_CMD_TOOLBOX: + if (!instance->support_pci_lane_margining) { + cmd_mfi->frame->hdr.cmd_status = MFI_STAT_INVALID_CMD; + result = COMPLETE_CMD; + } + + break; default: break; } From patchwork Thu Jun 20 10:52:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006461 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 2B5831398 for ; Thu, 20 Jun 2019 10:53:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C53927528 for ; Thu, 20 Jun 2019 10:53:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10E5328650; Thu, 20 Jun 2019 10:53:22 +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 59EDA27528 for ; Thu, 20 Jun 2019 10:53:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731110AbfFTKxV (ORCPT ); Thu, 20 Jun 2019 06:53:21 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:41996 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726404AbfFTKxU (ORCPT ); Thu, 20 Jun 2019 06:53:20 -0400 Received: by mail-pf1-f196.google.com with SMTP id q10so1446768pff.9 for ; Thu, 20 Jun 2019 03:53:20 -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=sEFNuVq5acDFnuFNK80WEE4N3ubRxRDH6lU83qeQjQo=; b=JI+HIjBzHnBOeXxvp4NA4UMB/QYmeYkzqGOBA7CW3MZeXoueYK54I52wcGMRnU+hft eAUGgNK8RduzUlm0Op8LmSKNi4tIl3RpSfPv82/Vcg8lrX7FR8CmHMVidxDkORuGlKr8 oBDg3svnaKkpv8sp3UQ2PquKVunGaKr8a/Sj0= 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=sEFNuVq5acDFnuFNK80WEE4N3ubRxRDH6lU83qeQjQo=; b=s0qTqjJFiG8NL/YOYan6sw1I1ay1sv7vAjMyE+h7b0q3dIpU+CgTFI39raQOMIXt4y zgoaENF7kMyJlhHsb+2IkGZ8YU6t6ntrwz9BWo2RciqcBiPMT3x4P69Fobwcek05SVlt dUe/wBaRxzsYLNgOB/I4Qx2PbTrRwBN264CoMbI0/4fpkK8ROlihQzeeoiNMmYRfOeYw /vriaFhlfuZrXy2cv5uGObIMYDKu3yfGAHteifHHrbwtRIaErg9vLd/cgqGLlvCIU1Ib CmPEo41q3yIvjvcA0JhVj+apgEAfve6JdGfXpsjdn8/5ptdwfwg2mSrB12NwD5CKIZBU hBew== X-Gm-Message-State: APjAAAXYKq/ukywoTcYqw0kFJsBJWb8nguc7YO7beA4SO+OoBzfp019m 2qjnHuP17U6Pd2Ff6p+UQO6iLIdyfdKMJV3HX+H2fxDPYud5fFkz9tCw9epnGneci+eFFz1nocY GtcydOPk/sPF3rNaxtmGWgjvM13+H0GrqWnAbvcBG0qF5qy3LuJ9k/cdjbSl5Vf2PyUezedufgH O5o3dzB/G+hFZt X-Google-Smtp-Source: APXvYqwO0t/x1iHMAOdnKkuRWF0WbHB+jjlfXdmv3Bdk6gWv18thXuI3L5f0wTCJ9FPUbQ+GDB3gZQ== X-Received: by 2002:a62:6d47:: with SMTP id i68mr131911742pfc.189.1561027999740; Thu, 20 Jun 2019 03:53:19 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.53.17 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:53:19 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 13/18] megaraid_sas: Add support for High IOPs queues Date: Thu, 20 Jun 2019 16:22:03 +0530 Message-Id: <20190620105208.15011-14-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 Aero controllers support balanced performance mode through the ability to configure queues with different properties. Reply queues with interrupt coalescing enabled are called "high iops reply queues" and reply queues with interrupt coalescing disabled are called "low latency reply queues". The driver configures a combination of high iops and low latency reply queues if: - HBA is an AERO controller; - MSI-X vectors supported by the HBA is 128; - Total CPU count in the system more than high iops queue count; - Driver is loaded with default max_msix_vectors module parameter; and - System booted in non-kdump mode. Signed-off-by: Kashyap Desai Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas.h | 6 ++ drivers/scsi/megaraid/megaraid_sas_base.c | 135 ++++++++++++++++++++++++---- drivers/scsi/megaraid/megaraid_sas_fusion.c | 11 +++ 3 files changed, 135 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 83baac3..5b17d0f 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -1640,6 +1640,7 @@ enum FW_BOOT_CONTEXT { #define MR_ATOMIC_DESCRIPTOR_SUPPORT_OFFSET (1 << 24) #define MR_CAN_HANDLE_64_BIT_DMA_OFFSET (1 << 25) +#define MR_INTR_COALESCING_SUPPORT_OFFSET (1 << 26) #define MEGASAS_WATCHDOG_THREAD_INTERVAL 1000 #define MEGASAS_WAIT_FOR_NEXT_DMA_MSECS 20 @@ -2250,6 +2251,9 @@ enum MR_PD_TYPE { #define MR_DEFAULT_NVME_MDTS_KB 128 #define MR_NVME_PAGE_SIZE_MASK 0x000000FF +/*Aero performance parameters*/ +#define MR_HIGH_IOPS_QUEUE_COUNT 8 + struct megasas_instance { unsigned int *reply_map; @@ -2433,6 +2437,8 @@ struct megasas_instance { bool atomic_desc_support; bool support_seqnum_jbod_fp; bool support_pci_lane_margining; + u8 low_latency_index_start; + bool balanced_mode; }; struct MR_LD_VF_MAP { diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 4c7a093..2e3c7fd 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -5472,6 +5472,8 @@ megasas_setup_irqs_ioapic(struct megasas_instance *instance) __func__, __LINE__); return -1; } + instance->balanced_mode = false; + instance->low_latency_index_start = 0; return 0; } @@ -5610,9 +5612,11 @@ megasas_setup_jbod_map(struct megasas_instance *instance) static void megasas_setup_reply_map(struct megasas_instance *instance) { const struct cpumask *mask; - unsigned int queue, cpu; + unsigned int queue, cpu, low_latency_index_start; - for (queue = 0; queue < instance->msix_vectors; queue++) { + low_latency_index_start = instance->low_latency_index_start; + + for (queue = low_latency_index_start; queue < instance->msix_vectors; queue++) { mask = pci_irq_get_affinity(instance->pdev, queue); if (!mask) goto fallback; @@ -5623,8 +5627,14 @@ static void megasas_setup_reply_map(struct megasas_instance *instance) return; fallback: - for_each_possible_cpu(cpu) - instance->reply_map[cpu] = cpu % instance->msix_vectors; + queue = low_latency_index_start; + for_each_possible_cpu(cpu) { + instance->reply_map[cpu] = queue; + if (queue == (instance->msix_vectors - 1)) + queue = low_latency_index_start; + else + queue++; + } } /** @@ -5661,6 +5671,66 @@ int megasas_get_device_list(struct megasas_instance *instance) return SUCCESS; } + +static int +__megasas_alloc_irq_vectors(struct megasas_instance *instance) +{ + int i, irq_flags; + struct irq_affinity desc = { .pre_vectors = instance->low_latency_index_start }; + struct irq_affinity *descp = &desc; + + irq_flags = PCI_IRQ_MSIX; + + if (instance->smp_affinity_enable) + irq_flags |= PCI_IRQ_AFFINITY; + else + descp = NULL; + + i = pci_alloc_irq_vectors_affinity(instance->pdev, + instance->low_latency_index_start, + instance->msix_vectors, irq_flags, descp); + + return i; +} + +/** + * megasas_alloc_irq_vectors - Allocate IRQ vectors/enable MSI-x vectors + * @instance: Adapter soft state + * return: void + */ +static void +megasas_alloc_irq_vectors(struct megasas_instance *instance) +{ + int i; + unsigned int num_msix_req; + + i = __megasas_alloc_irq_vectors(instance); + + if (instance->balanced_mode && (i != instance->msix_vectors)) { + if (instance->msix_vectors) + pci_free_irq_vectors(instance->pdev); + /*Disable Balanced IOPs mode and try realloc vectors*/ + instance->balanced_mode = false; + instance->low_latency_index_start = 1; + num_msix_req = num_online_cpus() + instance->low_latency_index_start; + + instance->msix_vectors = min(num_msix_req, + instance->msix_vectors); + + i = __megasas_alloc_irq_vectors(instance); + + } + + dev_info(&instance->pdev->dev, + "requested/available msix %d/%d\n", instance->msix_vectors, i); + + if (i > 0) + instance->msix_vectors = i; + else + instance->msix_vectors = 0; + +} + /** * megasas_init_fw - Initializes the FW * @instance: Adapter soft state @@ -5680,6 +5750,8 @@ static int megasas_init_fw(struct megasas_instance *instance) int i, j, loop; struct IOV_111 *iovPtr; struct fusion_context *fusion; + bool intr_coalescing; + unsigned int num_msix_req; fusion = instance->ctrl_context; @@ -5799,7 +5871,6 @@ static int megasas_init_fw(struct megasas_instance *instance) msix_enable = (instance->instancet->read_fw_status_reg(instance) & 0x4000000) >> 0x1a; if (msix_enable && !msix_disable) { - int irq_flags = PCI_IRQ_MSIX; scratch_pad_1 = megasas_readl (instance, &instance->reg_set->outbound_scratch_pad_1); @@ -5865,19 +5936,49 @@ static int megasas_init_fw(struct megasas_instance *instance) } else /* MFI adapters */ instance->msix_vectors = 1; - /* Don't bother allocating more MSI-X vectors than cpus */ - instance->msix_vectors = min(instance->msix_vectors, - (unsigned int)num_online_cpus()); - if (instance->smp_affinity_enable) - irq_flags |= PCI_IRQ_AFFINITY; - i = pci_alloc_irq_vectors(instance->pdev, 1, - instance->msix_vectors, irq_flags); - if (i > 0) { - instance->msix_vectors = i; - } else { - instance->msix_vectors = 0; + + /* + * For Aero(if few conditions are met), driver will configure + * few additional reply queues with interrupt coalescing enabled. + * These queues with interrupt coalescing enabled are called + * High IOPs queues and rest of reply queues(based on number of + * logical CPUs) are termed as Low latency queues. + * + * Total Number of reply queues = High IOPs queues + low latency queues + * + * For rest of fusion adapters, 1 additional reply queue will be + * reserved for management commands, rest of reply queues + * (based on number of logical CPUs) will be used for IOs and + * referenced as IO queues. + * Total Number of reply queues = 1 + IO queues + * + * MFI adapters supports single MSI-x so single reply queue + * will be used for IO and management commands. + */ + + intr_coalescing = (scratch_pad_1 & MR_INTR_COALESCING_SUPPORT_OFFSET) ? + true : false; + if (intr_coalescing && + (num_online_cpus() >= MR_HIGH_IOPS_QUEUE_COUNT) && + (instance->msix_vectors == MEGASAS_MAX_MSIX_QUEUES)) + instance->balanced_mode = true; + else + instance->balanced_mode = false; + + if (instance->balanced_mode) + instance->low_latency_index_start = + MR_HIGH_IOPS_QUEUE_COUNT; + else + instance->low_latency_index_start = 1; + + num_msix_req = num_online_cpus() + instance->low_latency_index_start; + + instance->msix_vectors = min(num_msix_req, + instance->msix_vectors); + + megasas_alloc_irq_vectors(instance); + if (!instance->msix_vectors) instance->msix_load_balance = false; - } } /* * MSI-X host index 0 is common for all adapter. diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index e124341..44bfbe8 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -1058,6 +1058,7 @@ megasas_ioc_init_fusion(struct megasas_instance *instance) u32 scratch_pad_1; ktime_t time; bool cur_fw_64bit_dma_capable; + bool cur_intr_coalescing; fusion = instance->ctrl_context; @@ -1091,6 +1092,16 @@ megasas_ioc_init_fusion(struct megasas_instance *instance) goto fail_fw_init; } + cur_intr_coalescing = (scratch_pad_1 & MR_INTR_COALESCING_SUPPORT_OFFSET) ? + true : false; + + if ((instance->low_latency_index_start == + MR_HIGH_IOPS_QUEUE_COUNT) && cur_intr_coalescing) + instance->balanced_mode = true; + + dev_info(&instance->pdev->dev, "Balanced mode :%s\n", + instance->balanced_mode ? "Yes" : "No"); + instance->fw_sync_cache_support = (scratch_pad_1 & MR_CAN_HANDLE_SYNC_CACHE_OFFSET) ? 1 : 0; dev_info(&instance->pdev->dev, "FW supports sync cache\t: %s\n", From patchwork Thu Jun 20 10:52:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006463 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 243AC112C for ; Thu, 20 Jun 2019 10:53:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 157A327528 for ; Thu, 20 Jun 2019 10:53:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08F1A28650; Thu, 20 Jun 2019 10:53:25 +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 A629827528 for ; Thu, 20 Jun 2019 10:53:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731158AbfFTKxY (ORCPT ); Thu, 20 Jun 2019 06:53:24 -0400 Received: from mail-pg1-f175.google.com ([209.85.215.175]:42900 "EHLO mail-pg1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726404AbfFTKxY (ORCPT ); Thu, 20 Jun 2019 06:53:24 -0400 Received: by mail-pg1-f175.google.com with SMTP id l19so1377492pgh.9 for ; Thu, 20 Jun 2019 03:53:23 -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=6QT4tQX6YeIvXgliqgWDFrZYwJqIGjTRFovye1EtSvM=; b=GsCtzm1QMETr1/7PD6NH/xmWSMbQb2EwJ6aG2O6cyP1WrZtv74auo8AEomsfkexMfC nuD+F5j3xGUM9rgDLM/TjkfepW37GICDa2/D6U3YPZupdH3AA+/mu/bvZ7+zPvSB0+Iw LpqXgCljdCeQz3DWuYwg6y0nU8jTmtq2yqOU0= 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=6QT4tQX6YeIvXgliqgWDFrZYwJqIGjTRFovye1EtSvM=; b=NGaEf+LRicUjzmXJOmhSl6e9QLTQftAP1FY/QIyog0YkKWbkzwdNXSuLr0hxZDv6uV cPpxydUvmHDWr9jZyehz5aqhXDz+aN/kxyZ6tH03BSI4iIWlDtiMmcjhfQ99Sn3BVb/8 5YeKsOHfG4s2SAU/InrwQO4+bk2vhF08CEqQDVSwTu9aQ5oEIMlXDqFKryGQvmsFSEGa 5d3KiOWqG+hRtbHvjMT/DVHDfnK1Gcw19djGAg1iM43J0duzmm4LAJ1yY1qYGq72hld5 /8ZeQ9G1xno+agu/zphnO+jYpqCX3ErScxIXJOlq8EGJA51X47VlbeU6V5PHuKXRKh7x eUow== X-Gm-Message-State: APjAAAXuUNB+Cn3oLggKoiOrk2veoVhlAVUM2PIQLbGr69zGpjQddlfr QRA743cn4kgUiVjT7MjYB7tMELqiUnl2y9z8Zu/u2AKaqdT0h6V8sX0rrZyLqs9CWje5Fdhe5IA aiI/dvx1WoehZGhtm8YT7NuLWZP/xJ4UAzFI5ec9PPMR9bTMBOGk4ei1bU1aL79Y1dn+f3qIL3F CfuMEKksyeR6mO X-Google-Smtp-Source: APXvYqx40UHxQJvmmjUSwSi/JeiYNQ4g+U6dqORDTjfr72G1lJzF/Z9W0TSk4TnbDm4duGk84b6xGw== X-Received: by 2002:a65:5787:: with SMTP id b7mr12493802pgr.148.1561028002985; Thu, 20 Jun 2019 03:53:22 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.53.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:53:22 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 14/18] megaraid_sas: Enable coalescing for high IOPs queues Date: Thu, 20 Jun 2019 16:22:04 +0530 Message-Id: <20190620105208.15011-15-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 Driver should enable interrupt coalescing(during driver load and after Controller Reset) for High IOPs queues by masking appropriate bits in IOC INIT frame. Signed-off-by: Kashyap Desai Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas.h | 2 +- drivers/scsi/megaraid/megaraid_sas_fusion.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 5b17d0f..02e6e15 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -1819,7 +1819,7 @@ struct megasas_init_frame { __le32 pad_0; /*0Ch */ __le16 flags; /*10h */ - __le16 reserved_3; /*12h */ + __le16 replyqueue_mask; /*12h */ __le32 data_xfer_len; /*14h */ __le32 queue_info_new_phys_addr_lo; /*18h */ diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 44bfbe8..845ca2f 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -1186,6 +1186,14 @@ megasas_ioc_init_fusion(struct megasas_instance *instance) cpu_to_le32(lower_32_bits(ioc_init_handle)); init_frame->data_xfer_len = cpu_to_le32(sizeof(struct MPI2_IOC_INIT_REQUEST)); + /* + * Each bit in replyqueue_mask represents one group of MSI-x vectors + * (each group has 8 vectors) + */ + if (instance->balanced_mode) + init_frame->replyqueue_mask = + cpu_to_le16(~(~0 << instance->low_latency_index_start / 8)); + req_desc.u.low = cpu_to_le32(lower_32_bits(cmd->frame_phys_addr)); req_desc.u.high = cpu_to_le32(upper_32_bits(cmd->frame_phys_addr)); req_desc.MFAIo.RequestFlags = From patchwork Thu Jun 20 10:52:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006465 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 0AD411398 for ; Thu, 20 Jun 2019 10:53:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0C3727528 for ; Thu, 20 Jun 2019 10:53:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E547228650; Thu, 20 Jun 2019 10:53:27 +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 849C427528 for ; Thu, 20 Jun 2019 10:53:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726620AbfFTKx1 (ORCPT ); Thu, 20 Jun 2019 06:53:27 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:45034 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730913AbfFTKx1 (ORCPT ); Thu, 20 Jun 2019 06:53:27 -0400 Received: by mail-pl1-f193.google.com with SMTP id t7so1229167plr.11 for ; Thu, 20 Jun 2019 03:53:26 -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=FIPydZ3jEWaeWPodWxnrqDckJVIVod1VLHb1/9k7Fxg=; b=C37TnUNgK2YbPci9uOJobq5KNzA+A+oiysW38CzBbc4iSFwdANu3U6HNn+PHdf7bAF ECLqgDryleWUMga+GBg2mHDpKoTnHDeZoQ3e9OGY74t9ZZRoP35uwHmwr4Hcn0UyUctz ENrXcGVBhVahwBq5rdels2Pn+XPF4XQWzwZsc= 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=FIPydZ3jEWaeWPodWxnrqDckJVIVod1VLHb1/9k7Fxg=; b=FF3wojJFo75owBxCJfpRdwNhjCObPLwae1A6Q/8SkYb4Aze5CxriKWUnEg4CYL67xU an/lCfO1YBiXqTNOXxpmF23Q4mYMQOUGfsNoT7RPHcqkL4aoFD6xqnePPmdfzNdO4i/J 7NWyj/G+ECmrgkhFOtlPIDnbsF5FrZexL/g/lwMzTQAfmYoegOKK67/FtftHl49rmjUh ykIYSnEalhv+EvFkzwmH7xN6XcCEeW3QXQduul6ufCX1oSJjsBfN7eqCqcACsvBScjnA N8tfKKbOcISBgTzvJHY5JZxq+aqTq5cwJaNKeRTe8h5ccp+7kCb+82lqKw911gkUeGkb dKNA== X-Gm-Message-State: APjAAAVruB+ZHtV7VW1D3PD7idmzWBFPz5Y8LhA8HaUbfBzKAG74TKBn Vdo0qYkftrhfeYI9twBQPQEE6Kt1ljqtvpnEwQdCQNyX/iyYmQqDfZ4udrs+dlXkpK1qkelpm0s DG/haAtEIAvrI97g38bwlAb4EyB5qpE2JxbJdSBFGZ+Mk4QQ78hG2/1BYh5F79V90MBnoE9fjo6 J47Mx4btxpk93o X-Google-Smtp-Source: APXvYqwdRMkMNfo/Lu1IQ4cd52dE8TnHe3stgtT7C3v6Fc/LDbRjDzBCw6k7DLkehpf8cS9rskLzsA== X-Received: by 2002:a17:902:108a:: with SMTP id c10mr122170257pla.48.1561028005949; Thu, 20 Jun 2019 03:53:25 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.53.23 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:53:25 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 15/18] megaraid_sas: Set affinity for high IOPs reply queues Date: Thu, 20 Jun 2019 16:22:05 +0530 Message-Id: <20190620105208.15011-16-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 High iops queues are mapped to non-managed IRQs. Set affinity of non-managed irqs to local numa node. Low latency queues are mapped to managed IRQs. Driver reserves some reply queues for high iops queues (through pci_alloc_irq_vectors_affinity and .pre_vectors interface). The rest of queues are for low latency. Based on IO workload, driver will decide which group of reply queues (either high iops queues or low latency queues) to be used. High iops queues will be mapped to local numa node of controller and low latency queues will be mapped to CPUs across numa nodes. In general, high iops and low latency queues should fit into 128 reply queues which is the max number of reply queues supported by Aero adapters. Signed-off-by: Kashyap Desai Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas_base.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 2e3c7fd..fec3e57 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -5672,6 +5672,26 @@ int megasas_get_device_list(struct megasas_instance *instance) return SUCCESS; } +/** + * megasas_set_high_iops_queue_affinity_hint - Set affinity hint for high IOPs queues + * @instance: Adapter soft state + * return: void + */ +static inline void +megasas_set_high_iops_queue_affinity_hint(struct megasas_instance *instance) +{ + int i; + int local_numa_node; + + if (instance->balanced_mode) { + local_numa_node = dev_to_node(&instance->pdev->dev); + + for (i = 0; i < instance->low_latency_index_start; i++) + irq_set_affinity_hint(pci_irq_vector(instance->pdev, i), + cpumask_of_node(local_numa_node)); + } +} + static int __megasas_alloc_irq_vectors(struct megasas_instance *instance) { @@ -5729,6 +5749,8 @@ megasas_alloc_irq_vectors(struct megasas_instance *instance) else instance->msix_vectors = 0; + if (instance->smp_affinity_enable) + megasas_set_high_iops_queue_affinity_hint(instance); } /** From patchwork Thu Jun 20 10:52:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006467 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 2F3F31398 for ; Thu, 20 Jun 2019 10:53:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FFD227528 for ; Thu, 20 Jun 2019 10:53:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 145BA28650; Thu, 20 Jun 2019 10:53:31 +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 9B22927528 for ; Thu, 20 Jun 2019 10:53:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731359AbfFTKxa (ORCPT ); Thu, 20 Jun 2019 06:53:30 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:39380 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730886AbfFTKxa (ORCPT ); Thu, 20 Jun 2019 06:53:30 -0400 Received: by mail-pg1-f196.google.com with SMTP id 196so1389121pgc.6 for ; Thu, 20 Jun 2019 03:53:29 -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=T4xFAUQiRTbKSvU/plzn2gO53ObR6gnzkNhb7ykrKfo=; b=G5XsJ81MN+KW8okC+p1/CN7PoN7qqQctkRFqVDeCyKiKCChohLodbDnGEXUC8a3W3B RECZqI/0Nu1eKjbVeGzXkbDUB1LXc4B3fxTy4W19NHbH+C3eYMpNbhqSQUkTAgm+254j lvGcpUXLHi72UbtW26aTGDbpK5IbrcP93Uv5Q= 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=T4xFAUQiRTbKSvU/plzn2gO53ObR6gnzkNhb7ykrKfo=; b=OKWbVmfbAc0KVMmg6HNGbBRcdnk1P/HRuodPjltzH68ALB+OP4l2R5luvWTndW5zqv wbSjkcsZdvBPBOdkGIBwm0XDaE5qP1yKBZK2XXoHpd8MawgWF4QhdYDP1JlROVmq2DVw uuLGNUNK+eZRkwwlutbTixcYq8vXELQECIJHIwn6Zb20Ocic5WS3VVl1HXsFln4FRI2X 1xmKrFCDsN2vPfJ972kecBJMHOTFsqv4UCDYDlSgGsgovWhmpGUzyircqppvWZF3wUVn Fb/yMpY9Dr8B/dfg6RYlaKqoIpW+tXN3kB2px0ab0KozecT3v4te0Bx+uqVMx0rotAxg X6Gg== X-Gm-Message-State: APjAAAWWQjwRirYf5F1vNZvZpztWOeHVDBPtbf0w0hcLuvqEK/QEpGog JiHx/qq0Rx6VBM7hL2LTpWyHya+JFBMiCPtBij0lymHMGeYS/OfuD9ubWt5j5YkHeNjZFxPQ6xI W+m7GuWSqeYqgo4yRtBobT6cFqLVtuoDnZm2DXyzH/roxrSycU9gZ7FBI8OPv+29lWZNMN+pgO0 tTkn7yp9Pqu8Wt X-Google-Smtp-Source: APXvYqwFHO8MVMk5KPpkrQcPzMZhjagDPI1NbBUUs3pTA4lLdwHUTBOLKK/v9Ki1Zx1iQYOsRDIjpg== X-Received: by 2002:a62:4dc5:: with SMTP id a188mr131813919pfb.8.1561028008903; Thu, 20 Jun 2019 03:53:28 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.53.26 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:53:28 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 16/18] megaraid_sas: Use high IOPs queues based on IO workload Date: Thu, 20 Jun 2019 16:22:06 +0530 Message-Id: <20190620105208.15011-17-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 The driver will use round-robin method for IO submission in batches within the high iops queues when the number of in-flight ios on the target device is larger than 8. Otherwise the driver will use low latency reply queues. Signed-off-by: Kashyap Desai Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas.h | 3 +++ drivers/scsi/megaraid/megaraid_sas_fp.c | 1 + drivers/scsi/megaraid/megaraid_sas_fusion.c | 16 ++++++++++++++-- drivers/scsi/megaraid/megaraid_sas_fusion.h | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 02e6e15..3f4cb52 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -2253,6 +2253,8 @@ enum MR_PD_TYPE { /*Aero performance parameters*/ #define MR_HIGH_IOPS_QUEUE_COUNT 8 +#define MR_DEVICE_HIGH_IOPS_DEPTH 8 +#define MR_HIGH_IOPS_BATCH_COUNT 16 struct megasas_instance { @@ -2362,6 +2364,7 @@ struct megasas_instance { atomic_t ldio_outstanding; atomic_t fw_reset_no_pci_access; atomic64_t total_io_count; + atomic64_t high_iops_outstanding; struct megasas_instance_template *instancet; struct tasklet_struct isr_tasklet; diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c index 43a2e49..f9f7c34 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fp.c +++ b/drivers/scsi/megaraid/megaraid_sas_fp.c @@ -1038,6 +1038,7 @@ MR_BuildRaidContext(struct megasas_instance *instance, stripSize = 1 << raid->stripeShift; stripe_mask = stripSize-1; + io_info->data_arms = raid->rowDataSize; /* * calculate starting row and stripe, and number of strips and rows diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 845ca2f..90dced4 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -2811,6 +2811,7 @@ megasas_build_ldio_fusion(struct megasas_instance *instance, io_info.r1_alt_dev_handle = MR_DEVHANDLE_INVALID; scsi_buff_len = scsi_bufflen(scp); io_request->DataLength = cpu_to_le32(scsi_buff_len); + io_info.data_arms = 1; if (scp->sc_data_direction == DMA_FROM_DEVICE) io_info.isRead = 1; @@ -2830,7 +2831,13 @@ megasas_build_ldio_fusion(struct megasas_instance *instance, fp_possible = (io_info.fpOkForIo > 0) ? true : false; } - if (instance->msix_load_balance) + if (instance->balanced_mode && + atomic_read(&scp->device->device_busy) > + (io_info.data_arms * MR_DEVICE_HIGH_IOPS_DEPTH)) + cmd->request_desc->SCSIIO.MSIxIndex = + mega_mod64((atomic64_add_return(1, &instance->high_iops_outstanding) / + MR_HIGH_IOPS_BATCH_COUNT), instance->low_latency_index_start); + else if (instance->msix_load_balance) cmd->request_desc->SCSIIO.MSIxIndex = (mega_mod64(atomic64_add_return(1, &instance->total_io_count), instance->msix_vectors)); @@ -3157,7 +3164,12 @@ megasas_build_syspd_fusion(struct megasas_instance *instance, cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle; - if (instance->msix_load_balance) + if (instance->balanced_mode && + atomic_read(&scmd->device->device_busy) > MR_DEVICE_HIGH_IOPS_DEPTH) + cmd->request_desc->SCSIIO.MSIxIndex = + mega_mod64((atomic64_add_return(1, &instance->high_iops_outstanding) / + MR_HIGH_IOPS_BATCH_COUNT), instance->low_latency_index_start); + else if (instance->msix_load_balance) cmd->request_desc->SCSIIO.MSIxIndex = (mega_mod64(atomic64_add_return(1, &instance->total_io_count), instance->msix_vectors)); diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.h b/drivers/scsi/megaraid/megaraid_sas_fusion.h index ca32b2b..6fe3343 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.h +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.h @@ -962,6 +962,7 @@ struct IO_REQUEST_INFO { u8 pd_after_lb; u16 r1_alt_dev_handle; /* raid 1/10 only */ bool ra_capable; + u8 data_arms; }; struct MR_LD_TARGET_SYNC { From patchwork Thu Jun 20 10:52:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006469 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 76928112C for ; Thu, 20 Jun 2019 10:53:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 675032864E for ; Thu, 20 Jun 2019 10:53:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B6E128653; Thu, 20 Jun 2019 10:53:34 +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 919F22864E for ; Thu, 20 Jun 2019 10:53:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730815AbfFTKxd (ORCPT ); Thu, 20 Jun 2019 06:53:33 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:44331 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726394AbfFTKxd (ORCPT ); Thu, 20 Jun 2019 06:53:33 -0400 Received: by mail-pg1-f196.google.com with SMTP id n2so1373804pgp.11 for ; Thu, 20 Jun 2019 03:53: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=3khMEVRvfV9H2xFDMNGgyBp8FnUlrLv4MwXzxtYS9tM=; b=fr4RSHOZkC3rO8SuK5g6PVZ4YgpL7JjbRSOBHtAUQ/BSpMdyf9xRUCl2EdN1wyw2If An0uGfQfPPx3LnBQH8op6+Y2HcY7dR0jcEj2GLTlw0BZEtv0bSeRqRdkauKx5gF/Q9V0 iTKljRxe6F+0byLJ+LPFO9LFGdfD9Ln88JarM= 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=3khMEVRvfV9H2xFDMNGgyBp8FnUlrLv4MwXzxtYS9tM=; b=qPUzzq7h6xgpfyiWuJ3DiRI5Xo5gaD2vPFQt31I5u+6W7fpz3nueFYLD5lTBjw22bP PEiH6iQJAzLwphXME5k1g4DG7FR+tBchfGsA2LMjBNT2G5DxJEz5UX+iQ5XB8Vy2B5da CFcmHG2eCMVXD1RJcmrbiAU0RfumeaT9jcFGc57obxj7C/PuWwVYoMbptLJv2gUpjYOr E9fBhKossJ1zrqE/+UA4ANxCj2i6yJXfo8hVt3CasTCPbvNIduk+0nRyferUW0rxqWNs dt0T6sR1UtvrQDq8kLnncSbAQxBSeIdwGDhfXWfpC0+vSekkUGitltx8mLRUKWPBZjCV nvqw== X-Gm-Message-State: APjAAAW/RyWp54CLm5CBpktYmjWfGPRF/ifqN3AwKegKKTs94vBeyQAb 9iNw+VLcq/4Nda2MEnGNslcuAnnO0NvAGT0ug8vgOx7amv8rtmN4pdv3kDk4WMpqyCdr+apUAcF Y0RsKDUB7Vt2AlGWpYeG+WoU1v72OqKkfRFr7/Q6NXN2RCIyLcUpw605MfgTVDBa9kKJLkdKQBR K9l1jDdJzo66Uf X-Google-Smtp-Source: APXvYqw25JihabwK+FohhyqSVvlCxO/GE90HORX9eOh7vRF4C2lNoZ0rpQ0PYcF92TDG+Wegbgd1cA== X-Received: by 2002:a62:ee05:: with SMTP id e5mr14191574pfi.117.1561028011921; Thu, 20 Jun 2019 03:53:31 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.53.29 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:53:31 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 17/18] megaraid_sas: Introduce various Aero performance modes Date: Thu, 20 Jun 2019 16:22:07 +0530 Message-Id: <20190620105208.15011-18-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 For Aero adapters, driver provides three different performance modes controlled through module parameter named- 'perf_mode'. Below are those performance modes: 0: Balanced - Additional high IOPs reply queues will be enabled along with low latency queues. Interrupt coalescing will be enabled only for these high IOPs reply queues. 1: IOPs - No additional high IOPs queues are enabled. Interrupt coalescing will be enabled on all reply queues. 2: Latency - No additional high IOPs queues are enabled. Interrupt coalescing will be disabled on all reply queues. This is a legacy behavior similar to Ventura & Invader Series. Default performance mode settings: -Performance mode set to 'Balanced', if Aero controller is working in 16GT/s PCIe speed. -Performance mode will be set to 'Latency' mode for all other cases. Through module parameter- 'perf_mode', user can override default performance mode to desired one. Captured below some performance numbers with these performance modes. 4k Random Read IO performance numbers on 24 SAS SSD drives for above three permormance modes. Performance data is from Intel Skylake and HGST SS300 (drive model SDLL1DLR400GCCA1). IOPs: ----------------------------------------------------------------------- |perf_mode | qd = 1 | qd = 64 | note | |-------------|--------|---------|------------------------------------- |balanced | 259K | 3061k | Provides max performance numbers | | | | | both on lower QD workload & | | | | | also on higher QD workload | |-------------|--------|---------|------------------------------------- |iops | 220K | 3100k | Provides max performance numbers | | | | | only on higher QD workload. | |-------------|--------|---------|------------------------------------- |latency | 246k | 2226k | Provides good performance numbers | | | | | only on lower QD worklaod. | ----------------------------------------------------------------------- Average Latency: ----------------------------------------------------- |perf_mode | qd = 1 | qd = 64 | |-------------|--------------|----------------------| |balanced | 92.05 usec | 501.12 usec | |-------------|--------------|----------------------| |iops | 108.40 usec | 498.10 usec | |-------------|--------------|----------------------| |latency | 97.10 usec | 689.26 usec | ----------------------------------------------------- Signed-off-by: Sumit Saxena Signed-off-by: Chandrakanth Patil Reported-by: kbuild test robot Reported-by: Dan Carpenter --- drivers/scsi/megaraid/megaraid_sas.h | 14 ++++++- drivers/scsi/megaraid/megaraid_sas_base.c | 60 +++++++++++++++++++++++++---- drivers/scsi/megaraid/megaraid_sas_fusion.c | 22 +++++++---- 3 files changed, 81 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 3f4cb52..0b38691 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -2256,6 +2256,18 @@ enum MR_PD_TYPE { #define MR_DEVICE_HIGH_IOPS_DEPTH 8 #define MR_HIGH_IOPS_BATCH_COUNT 16 +enum MR_PERF_MODE { + MR_BALANCED_PERF_MODE = 0, + MR_IOPS_PERF_MODE = 1, + MR_LATENCY_PERF_MODE = 2, +}; + +#define MEGASAS_PERF_MODE_2STR(mode) \ + ((mode) == MR_BALANCED_PERF_MODE ? "Balanced" : \ + (mode) == MR_IOPS_PERF_MODE ? "IOPs" : \ + (mode) == MR_LATENCY_PERF_MODE ? "Latency" : \ + "Unknown") + struct megasas_instance { unsigned int *reply_map; @@ -2441,7 +2453,7 @@ struct megasas_instance { bool support_seqnum_jbod_fp; bool support_pci_lane_margining; u8 low_latency_index_start; - bool balanced_mode; + int perf_mode; }; struct MR_LD_VF_MAP { diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index fec3e57..9233b22 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -105,6 +105,18 @@ unsigned int scmd_timeout = MEGASAS_DEFAULT_CMD_TIMEOUT; module_param(scmd_timeout, int, 0444); MODULE_PARM_DESC(scmd_timeout, "scsi command timeout (10-90s), default 90s. See megasas_reset_timer."); +int perf_mode = -1; +module_param(perf_mode, int, 0444); +MODULE_PARM_DESC(perf_mode, "Performance mode (only for Aero adapters), options:\n\t\t" + "0 - balanced: High iops and low latency queues are allocated &\n\t\t" + "interrupt coalescing is enabled only on high iops queues\n\t\t" + "1 - iops: High iops queues are not allocated &\n\t\t" + "interrupt coalescing is enabled on all queues\n\t\t" + "2 - latency: High iops queues are not allocated &\n\t\t" + "interrupt coalescing is disabled on all queues\n\t\t" + "default mode is 'balanced'" + ); + MODULE_LICENSE("GPL"); MODULE_VERSION(MEGASAS_VERSION); MODULE_AUTHOR("megaraidlinux.pdl@broadcom.com"); @@ -5472,7 +5484,7 @@ megasas_setup_irqs_ioapic(struct megasas_instance *instance) __func__, __LINE__); return -1; } - instance->balanced_mode = false; + instance->perf_mode = MR_LATENCY_PERF_MODE; instance->low_latency_index_start = 0; return 0; } @@ -5683,7 +5695,7 @@ megasas_set_high_iops_queue_affinity_hint(struct megasas_instance *instance) int i; int local_numa_node; - if (instance->balanced_mode) { + if (instance->perf_mode == MR_BALANCED_PERF_MODE) { local_numa_node = dev_to_node(&instance->pdev->dev); for (i = 0; i < instance->low_latency_index_start; i++) @@ -5726,11 +5738,12 @@ megasas_alloc_irq_vectors(struct megasas_instance *instance) i = __megasas_alloc_irq_vectors(instance); - if (instance->balanced_mode && (i != instance->msix_vectors)) { + if ((instance->perf_mode == MR_BALANCED_PERF_MODE) && + (i != instance->msix_vectors)) { if (instance->msix_vectors) pci_free_irq_vectors(instance->pdev); /*Disable Balanced IOPs mode and try realloc vectors*/ - instance->balanced_mode = false; + instance->perf_mode = MR_LATENCY_PERF_MODE; instance->low_latency_index_start = 1; num_msix_req = num_online_cpus() + instance->low_latency_index_start; @@ -5774,6 +5787,7 @@ static int megasas_init_fw(struct megasas_instance *instance) struct fusion_context *fusion; bool intr_coalescing; unsigned int num_msix_req; + u16 lnksta, speed; fusion = instance->ctrl_context; @@ -5983,11 +5997,43 @@ static int megasas_init_fw(struct megasas_instance *instance) if (intr_coalescing && (num_online_cpus() >= MR_HIGH_IOPS_QUEUE_COUNT) && (instance->msix_vectors == MEGASAS_MAX_MSIX_QUEUES)) - instance->balanced_mode = true; + instance->perf_mode = MR_BALANCED_PERF_MODE; else - instance->balanced_mode = false; + instance->perf_mode = MR_LATENCY_PERF_MODE; + + + if (instance->adapter_type == AERO_SERIES) { + pcie_capability_read_word(instance->pdev, PCI_EXP_LNKSTA, &lnksta); + speed = lnksta & PCI_EXP_LNKSTA_CLS; + + /* + * For Aero, if PCIe link speed is <16 GT/s, then driver should operate + * in latency perf mode and enable R1 PCI bandwidth algorithm + */ + if (speed < 0x4) { + instance->perf_mode = MR_LATENCY_PERF_MODE; + fusion->pcie_bw_limitation = true; + } + + /* + * Performance mode settings provided through module parameter-perf_mode will + * take affect only for: + * 1. Aero family of adapters. + * 2. When user sets module parameter- perf_mode in range of 0-2. + */ + if ((perf_mode >= MR_BALANCED_PERF_MODE) && + (perf_mode <= MR_LATENCY_PERF_MODE)) + instance->perf_mode = perf_mode; + /* + * If intr coalescing is not supported by controller FW, then IOPs + * and Balanced modes are not feasible. + */ + if (!intr_coalescing) + instance->perf_mode = MR_LATENCY_PERF_MODE; + + } - if (instance->balanced_mode) + if (instance->perf_mode == MR_BALANCED_PERF_MODE) instance->low_latency_index_start = MR_HIGH_IOPS_QUEUE_COUNT; else diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 90dced4..8a3e255 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -1097,10 +1097,10 @@ megasas_ioc_init_fusion(struct megasas_instance *instance) if ((instance->low_latency_index_start == MR_HIGH_IOPS_QUEUE_COUNT) && cur_intr_coalescing) - instance->balanced_mode = true; + instance->perf_mode = MR_BALANCED_PERF_MODE; - dev_info(&instance->pdev->dev, "Balanced mode :%s\n", - instance->balanced_mode ? "Yes" : "No"); + dev_info(&instance->pdev->dev, "Performance mode :%s\n", + MEGASAS_PERF_MODE_2STR(instance->perf_mode)); instance->fw_sync_cache_support = (scratch_pad_1 & MR_CAN_HANDLE_SYNC_CACHE_OFFSET) ? 1 : 0; @@ -1190,9 +1190,17 @@ megasas_ioc_init_fusion(struct megasas_instance *instance) * Each bit in replyqueue_mask represents one group of MSI-x vectors * (each group has 8 vectors) */ - if (instance->balanced_mode) + switch (instance->perf_mode) { + case MR_BALANCED_PERF_MODE: init_frame->replyqueue_mask = - cpu_to_le16(~(~0 << instance->low_latency_index_start / 8)); + cpu_to_le16(~(~0 << instance->low_latency_index_start/8)); + break; + case MR_IOPS_PERF_MODE: + init_frame->replyqueue_mask = + cpu_to_le16(~(~0 << instance->msix_vectors/8)); + break; + } + req_desc.u.low = cpu_to_le32(lower_32_bits(cmd->frame_phys_addr)); req_desc.u.high = cpu_to_le32(upper_32_bits(cmd->frame_phys_addr)); @@ -2831,7 +2839,7 @@ megasas_build_ldio_fusion(struct megasas_instance *instance, fp_possible = (io_info.fpOkForIo > 0) ? true : false; } - if (instance->balanced_mode && + if ((instance->perf_mode == MR_BALANCED_PERF_MODE) && atomic_read(&scp->device->device_busy) > (io_info.data_arms * MR_DEVICE_HIGH_IOPS_DEPTH)) cmd->request_desc->SCSIIO.MSIxIndex = @@ -3164,7 +3172,7 @@ megasas_build_syspd_fusion(struct megasas_instance *instance, cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle; - if (instance->balanced_mode && + if ((instance->perf_mode == MR_BALANCED_PERF_MODE) && atomic_read(&scmd->device->device_busy) > MR_DEVICE_HIGH_IOPS_DEPTH) cmd->request_desc->SCSIIO.MSIxIndex = mega_mod64((atomic64_add_return(1, &instance->high_iops_outstanding) / From patchwork Thu Jun 20 10:52:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11006471 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 86879112C for ; Thu, 20 Jun 2019 10:53:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 769AF28650 for ; Thu, 20 Jun 2019 10:53:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6859B28657; Thu, 20 Jun 2019 10:53:36 +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 256AC28650 for ; Thu, 20 Jun 2019 10:53:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726654AbfFTKxf (ORCPT ); Thu, 20 Jun 2019 06:53:35 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:43976 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726394AbfFTKxf (ORCPT ); Thu, 20 Jun 2019 06:53:35 -0400 Received: by mail-pl1-f194.google.com with SMTP id cl9so1229360plb.10 for ; Thu, 20 Jun 2019 03:53:35 -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=K1LOMhUpywtS5Uzk5w46aLkAjiUVQZ4DE25kBQbLzcQ=; b=JIn93A0glRmGHNfGkxllHa5E7NnP4oXYkaAS0troul5D4gGBBwAg2bK8KQCVqdjTFz TSQW6VrGCdeiEWO7yhoy37SQyUKsAX7dbLwqbQZgar5IBJLrBXC3DCALYC9rOqRElSuD k76ZZGCCcSxCZ0nkL+0x+2hv2RCzHJ2wHQ64M= 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=K1LOMhUpywtS5Uzk5w46aLkAjiUVQZ4DE25kBQbLzcQ=; b=Yxek7caDFSvNUhm9L0lag7xnYDwmhljTeCtdN5hkCvzzv6X/0zbqLr+UknrVQJgXYs PYjvAcgVTczs/JzX02o8sytHgMbct9bNI77PtfOgJwQmgySzi53pCChoJlu7sNUtoELH bsiSkfaIqsZnbjRaArH3Moz8i8QORlVnVN3uJPOtCT108B0D4jdjfITFMifGy/K49Tz5 d3+c7FXvCkd9WDXfw7sv1dm49EAy/zOWc+QjqlnKI8u6nu92a37esuvHuCkaQx9GY03E sJgxJjjh7qcsSdZ+VLUtPwfbGiEuixWp3as0JTbEKFjXBWQ7JQT4KM/y1eO1TcKIn0Al DMpg== X-Gm-Message-State: APjAAAXwZzhtP64r0o/0atglIWoKb1iVLmKbSqOHGZjoEI34KfqzgYq3 SbHE4vzWP6bCAJadB0EV6j2WEF6hPMyMq0QPKEESJHUR5oWtkQlX/WMbmMyatu1tAD3z9M5ZceB CStbtguSJUD3GswGJvilyYVcfAs4+rsiw3e62HIO1/VYf4ZbOEiXdNIpAaHJa2sxwlijxbsmlTc 3OeBT0uOnmpoeZ X-Google-Smtp-Source: APXvYqx0QslABCnvRAmATUgJgi7OHaJxYxmr5ftZQzULl0awy0qotE4a9rx3T7+X5paw/yjqRJBvyg== X-Received: by 2002:a17:902:8b82:: with SMTP id ay2mr25441591plb.164.1561028014811; Thu, 20 Jun 2019 03:53:34 -0700 (PDT) Received: from dhcp-10-123-20-30.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l7sm24793995pfl.9.2019.06.20.03.53.32 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 03:53:34 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, Chandrakanth Patil Subject: [PATCH v2 18/18] megaraid_sas: Update driver version to 07.710.06.00-rc1 Date: Thu, 20 Jun 2019 16:22:08 +0530 Message-Id: <20190620105208.15011-19-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190620105208.15011-1-chandrakanth.patil@broadcom.com> References: <20190620105208.15011-1-chandrakanth.patil@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 Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 0b38691..dc0f71f 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -33,8 +33,8 @@ /* * MegaRAID SAS Driver meta data */ -#define MEGASAS_VERSION "07.708.03.00-rc1" -#define MEGASAS_RELDATE "March 14, 2019" +#define MEGASAS_VERSION "07.710.06.00-rc1" +#define MEGASAS_RELDATE "June 18, 2019" /* * Device IDs