From patchwork Fri Apr 26 09:36:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivasharan Srikanteshwara X-Patchwork-Id: 10918931 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 E49B11390 for ; Fri, 26 Apr 2019 09:38:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D332628D55 for ; Fri, 26 Apr 2019 09:38:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C65F028D69; Fri, 26 Apr 2019 09:38: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 B692628D55 for ; Fri, 26 Apr 2019 09:38:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726218AbfDZJiV (ORCPT ); Fri, 26 Apr 2019 05:38:21 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:36014 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726197AbfDZJiV (ORCPT ); Fri, 26 Apr 2019 05:38:21 -0400 Received: by mail-pl1-f195.google.com with SMTP id w20so671577plq.3 for ; Fri, 26 Apr 2019 02:38:21 -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=b8LcUew8y2c2qcOdIdJueDfN1EbZQu2fqTFNgaHgjzU=; b=R7nhwWEQ/E0ysCxBSqvCwe1MqeTgI3kk1sXletDM7z+z0lIPBl0pSYGQEYe6lVPTNg +p2iIt0P6bQXYrNtafh25nlYYLjOV4s787EReXC1pDJ5xrRuCl73yStyz5bFaizBJPeS Mtl4c580AMMJAG0SkenUU7RNWnzaphGMR12iQ= 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=b8LcUew8y2c2qcOdIdJueDfN1EbZQu2fqTFNgaHgjzU=; b=dkeY6hLMZ3KPsDrgdoW8WJUXnNQcAta5r1zGJBp+IQQyEe7UjcOM8I4yU6ayLZWl6U 4ayRzD4524o+jFI1bt16SbVYkYSx1s0h0ui7fWN1ZJY872a8gzN/XBGRUJfY8WONOnaZ i6ADJuQDZJLgoL11saQt9dM/zn7LX8fkXd586KBCrFblGvqPtVjOfWm9U+/tTmttXTRd EZLQuNqvYqKrlRtYFI/+dVze0MBY93Su0QirqyhbovbbAsV+Yping+ofbiEnYBO1ivIz RMlMatCqpsDQmy2Ccly8mkPkyrE0Tl2Wp75uzeXojxoZRKYN2YRnEJDVbpXP/Y9fTKQf 4eUw== X-Gm-Message-State: APjAAAUNbME2NpEseEcvza7FyjW9+AuYP9aIPsK5BJTZ54OSEMMCIT4e 3Z8yUaMb/YQ9sh5MvbfdbK42KCyDohubJv9h/YotWFzPO85/XKjcmuAz/2uUjOr42WdfPHVb4XG apAkzpcHuGffYSk1GfvwJTg8tmkYZiYHA7qVDJW++aZ4rfHqUPdLSMWZ7cO/ib1l34TPHQvyX8V E2eu9wzY/G9no5uPGz89Ja X-Google-Smtp-Source: APXvYqzjhRuNo2QpvDS/3WcLT/gr810wkwLiNfy2/a8SvVGJi7/kyuvbvXf4FQELBZR8sDF6Rdng6w== X-Received: by 2002:a17:902:e109:: with SMTP id cc9mr747635plb.148.1556271500258; Fri, 26 Apr 2019 02:38:20 -0700 (PDT) Received: from dhcp-135-24-192-142.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id r4sm37994649pgl.69.2019.04.26.02.38.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Apr 2019 02:38:19 -0700 (PDT) From: Shivasharan S 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, chandrakanth.patil@broadcom.com, Shivasharan S Subject: [PATCH 03/21] megaraid_sas: fw_reset_no_pci_access required for MFI adapters only Date: Fri, 26 Apr 2019 02:36:57 -0700 Message-Id: <1556271435-27252-4-git-send-email-shivasharan.srikanteshwara@broadcom.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1556271435-27252-1-git-send-email-shivasharan.srikanteshwara@broadcom.com> References: <1556271435-27252-1-git-send-email-shivasharan.srikanteshwara@broadcom.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP fw_reset_no_pci_access is only applicable for MFI controllers and is not used for Fusion controllers. For all Fusion controllers, driver can check reset adapter bit in status register before performing a chip reset, without setting "fw_reset_no_pci_access". Signed-off-by: Shivasharan S --- drivers/scsi/megaraid/megaraid_sas_base.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index d2714fc833ae..77db6e773a01 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -5489,7 +5489,6 @@ static int megasas_init_fw(struct megasas_instance *instance) int i, j, loop, fw_msix_count = 0; struct IOV_111 *iovPtr; struct fusion_context *fusion; - bool do_adp_reset = true; fusion = instance->ctrl_context; @@ -5536,13 +5535,18 @@ static int megasas_init_fw(struct megasas_instance *instance) } if (megasas_transition_to_ready(instance, 0)) { - if (instance->adapter_type >= INVADER_SERIES) { + if (instance->adapter_type != MFI_SERIES) { status_reg = instance->instancet->read_fw_status_reg( instance); - do_adp_reset = status_reg & MFI_RESET_ADAPTER; - } - - if (do_adp_reset) { + if (status_reg & MFI_RESET_ADAPTER) { + instance->instancet->adp_reset + (instance, instance->reg_set); + if (megasas_transition_to_ready(instance, 0)) + goto fail_ready_state; + } else { + goto fail_ready_state; + } + } else { atomic_set(&instance->fw_reset_no_pci_access, 1); instance->instancet->adp_reset (instance, instance->reg_set); @@ -5556,8 +5560,6 @@ static int megasas_init_fw(struct megasas_instance *instance) if (megasas_transition_to_ready(instance, 0)) goto fail_ready_state; - } else { - goto fail_ready_state; } }