From patchwork Mon Feb 12 05:39:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivasharan Srikanteshwara X-Patchwork-Id: 10211829 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 BE17D60153 for ; Mon, 12 Feb 2018 05:39:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD52028B10 for ; Mon, 12 Feb 2018 05:39:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A127528B15; Mon, 12 Feb 2018 05:39:37 +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 8277328B10 for ; Mon, 12 Feb 2018 05:39:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751215AbeBLFjc (ORCPT ); Mon, 12 Feb 2018 00:39:32 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:45777 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751196AbeBLFjb (ORCPT ); Mon, 12 Feb 2018 00:39:31 -0500 Received: by mail-qt0-f193.google.com with SMTP id x27so17661691qtm.12 for ; Sun, 11 Feb 2018 21:39:30 -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=Hrm47DgvZ0/MMMxOFnnCv+sIH0hI+KMvig0OJ00EKAk=; b=Lt/XxrpCRQkTQHpS05zmEgSC0/AXk7+S4rK2F8ThXX5RPW24jfG5/LO+viIkVDANjU Z+EDVeDp79Ov8JncX7G6PRKXc576Sm2ll65hSzZ24tbIirYC4vH1Pnq+R7Fz6KkAmFuK 8ta2Tmf6VKVUWFBIlq360WvBNt7CpsJQYH8Ec= 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=Hrm47DgvZ0/MMMxOFnnCv+sIH0hI+KMvig0OJ00EKAk=; b=OkAO+/B/K8UMKS+4o0nmF76DR+uoFlUIWqZhvWOGIQBMCM8ahoT91jn0JHF0zyVJU4 5kOUyLLcpZZOmScedc+pP4RujgAIip75fX+aZKmPWUPOeeTlzX0XeUM8WlkuhQXETEMb F0bG4J+VxFnSQofyOl667BJROqNLd36DmJN6YsDGjEan6/siP0QEFuAaqXwupacNwtKv A/qFQxGr6QEqD9b4T4bxCMDQe8HDQwvCZmReVD1UXG7yvoyFgW/WIG2j31Lafi5ODC4j /x1JoOMz6b4cBqKO/WILQGpOxjTK46p9j+AOlN1AiA0F9KcITrLQQavjWXmVLF4J823h UYSw== X-Gm-Message-State: APf1xPCP4fPkzfPY9x0UK4gME3SKMXnEVViQJT9kSSkkzXQGWPIdxsYd 6bWCUpEtbUUAudFlz581PyQom5ogHV8= X-Google-Smtp-Source: AH8x224TAyEAzTlbxjzSPEaQZQwVkSuAm7txl2m32zlZ+904tNNeS/BEMMJauOfpe/DyMuvawcxM0Q== X-Received: by 10.200.34.237 with SMTP id g42mr16017536qta.93.1518413970025; Sun, 11 Feb 2018 21:39:30 -0800 (PST) Received: from dhcp-135-24-192-142.dhcp.broadcom.net ([192.19.252.250]) by smtp.gmail.com with ESMTPSA id b142sm1284510qkc.87.2018.02.11.21.39.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 21:39:29 -0800 (PST) From: Shivasharan S To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, Shivasharan S , Subject: [PATCH] megaraid_sas: Do not use 32-bit atomic request descriptor for Ventura controllers Date: Sun, 11 Feb 2018 21:39:00 -0800 Message-Id: <1518413940-1657-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 --- drivers/scsi/megaraid/megaraid_sas_fusion.c | 37 ++++++++++------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 073ced07e662..09f2bdb14b0a 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -226,26 +226,21 @@ 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 +977,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 +1115,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);