From patchwork Wed Feb 14 08:10:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivasharan Srikanteshwara X-Patchwork-Id: 10218149 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A9415601C2 for ; Wed, 14 Feb 2018 08:11:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9963D28C9F for ; Wed, 14 Feb 2018 08:11:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E46028CA7; Wed, 14 Feb 2018 08:11:10 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 EAE7328C9F for ; Wed, 14 Feb 2018 08:11:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754554AbeBNILI (ORCPT ); Wed, 14 Feb 2018 03:11:08 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:36020 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754589AbeBNILG (ORCPT ); Wed, 14 Feb 2018 03:11:06 -0500 Received: by mail-qk0-f196.google.com with SMTP id 15so25660942qkl.3 for ; Wed, 14 Feb 2018 00:11:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=JY+0F6T43P4t3L220XCl9L5bVGBka9pWvk6YONn/aOI=; b=CBwg2hEDuV/ajsFXdG8/+a852aX5+4+CqH5x0K1a6RCSFuHEgxg3ONb6T1tLrtq8Lb P9YUc9EsRlDeGOEDs6lL6eWhW2eL83jEfnaMhtFGUxHY2HlwGFLeV7vwttfrkXMVjr0B IcRFwwqs1IS1Qgz1q//3v2JM+Spusl7EJQ/4Y= 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; bh=JY+0F6T43P4t3L220XCl9L5bVGBka9pWvk6YONn/aOI=; b=CUtE0PLjOwJ4AnbpY+xS/MxR/3W4XlvK/r+vv+r8dCg3q+qBDsMDknZNK1q25vNVTy JCy1lqPGmSBI5MqiWuHGJ+QNOz86mQYakuGyQcuBGic7/UkLyPwKJ5xflZLfmOnC4ChK w9LvpPpn+jiQ6wl9AyZgvGAsWd6ev1vfY8KQe4TgN33wHc+jqoUvSinnh9rtY+46n+cB 3ocSbTMKTmoINbLTAOUxVP92rOy/0PlwzaFjCE64XqCa/byIHGB3cjFka5uUQxmMP189 M9QceiY46jYuo983ydVN4JTznDWnHEZ/YxUtZEpgmWEqfA6QuhWIWeH1wHBOMZelU2P/ 2J6w== X-Gm-Message-State: APf1xPBAcz2XEDlQ7evRmVPiMCpsvVEKkvd9IpzkFYxlGm9mv3aFWjpP 1F8w2wsb6bh29s2XlDMl8tDX7DrB3hU= X-Google-Smtp-Source: AH8x227bX1OdSZff73weLb0f73BKIWrUIyzSzB0fiBjmdHY7ZIHyeoVVTyupIEDfGDjgEY+lzNmmSQ== X-Received: by 10.55.99.139 with SMTP id x133mr6517406qkb.182.1518595865637; Wed, 14 Feb 2018 00:11:05 -0800 (PST) Received: from dhcp-135-24-192-142.dhcp.broadcom.net ([192.19.252.250]) by smtp.gmail.com with ESMTPSA id m31sm1697151qtd.91.2018.02.14.00.11.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Feb 2018 00:11:04 -0800 (PST) From: Shivasharan S To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, Shivasharan S , Subject: [PATCH v2] megaraid_sas: Do not use 32-bit atomic request descriptor for Ventura controllers Date: Wed, 14 Feb 2018 00:10:52 -0800 Message-Id: <1518595852-1490-1-git-send-email-shivasharan.srikanteshwara@broadcom.com> X-Mailer: git-send-email 2.4.3 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 Problem Statement: Sending I/O through 32 bit descriptors to Ventura series of controller results in IO timeout on certain conditions. This error only occurs on systems with high I/O activity on Ventura series controllers. Changes in this patch will prevent driver from using 32 bit descriptor and use 64 bit Descriptors. Cc: Signed-off-by: Kashyap Desai Signed-off-by: Shivasharan S Reviewed-by: Hannes Reinecke Reviewed-by: Tomas Henzl --- Changes in v2: Removed below text from function description: * Ventura supports 32 bit Descriptor. * Prior to Ventura (12G) MR controller supports 64 bit Descriptor. drivers/scsi/megaraid/megaraid_sas_fusion.c | 42 ++++++++++------------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 073ced07e662..dc8e850fbfd2 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -216,36 +216,30 @@ 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: 32bit or 64bit Request descriptor + * @req_desc: 64bit Request descriptor * - * Perform PCI Write. Ventura supports 32 bit Descriptor. - * Prior to Ventura (12G) MR controller supports 64 bit Descriptor. + * Perform PCI Write. */ static void megasas_fire_cmd_fusion(struct megasas_instance *instance, union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc) { - if (instance->adapter_type == VENTURA_SERIES) - writel(le32_to_cpu(req_desc->u.low), - &instance->reg_set->inbound_single_queue_port); - else { #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)); + 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); + writeq(req_data, &instance->reg_set->inbound_low_queue_port); #else - unsigned long flags; - spin_lock_irqsave(&instance->hba_lock, flags); - writel(le32_to_cpu(req_desc->u.low), - &instance->reg_set->inbound_low_queue_port); - writel(le32_to_cpu(req_desc->u.high), - &instance->reg_set->inbound_high_queue_port); - mmiowb(); - spin_unlock_irqrestore(&instance->hba_lock, flags); + unsigned long flags; + spin_lock_irqsave(&instance->hba_lock, flags); + writel(le32_to_cpu(req_desc->u.low), + &instance->reg_set->inbound_low_queue_port); + writel(le32_to_cpu(req_desc->u.high), + &instance->reg_set->inbound_high_queue_port); + mmiowb(); + spin_unlock_irqrestore(&instance->hba_lock, flags); #endif - } } /** @@ -982,7 +976,6 @@ megasas_ioc_init_fusion(struct megasas_instance *instance) const char *sys_info; MFI_CAPABILITIES *drv_ops; u32 scratch_pad_2; - unsigned long flags; ktime_t time; bool cur_fw_64bit_dma_capable; @@ -1121,14 +1114,7 @@ megasas_ioc_init_fusion(struct megasas_instance *instance) break; } - /* For Ventura also IOC INIT required 64 bit Descriptor write. */ - spin_lock_irqsave(&instance->hba_lock, flags); - writel(le32_to_cpu(req_desc.u.low), - &instance->reg_set->inbound_low_queue_port); - writel(le32_to_cpu(req_desc.u.high), - &instance->reg_set->inbound_high_queue_port); - mmiowb(); - spin_unlock_irqrestore(&instance->hba_lock, flags); + megasas_fire_cmd_fusion(instance, &req_desc); wait_and_poll(instance, cmd, MFI_POLL_TIMEOUT_SECS);