From patchwork Fri Dec 7 07:28:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suganath Prabu S X-Patchwork-Id: 10717567 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 F33F41750 for ; Fri, 7 Dec 2018 07:29:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE4392E946 for ; Fri, 7 Dec 2018 07:29:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D27C82EA4B; Fri, 7 Dec 2018 07:29: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 6EEE32E387 for ; Fri, 7 Dec 2018 07:29:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726062AbeLGH3G (ORCPT ); Fri, 7 Dec 2018 02:29:06 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:50868 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725998AbeLGH3G (ORCPT ); Fri, 7 Dec 2018 02:29:06 -0500 Received: by mail-wm1-f68.google.com with SMTP id n190so3357242wmd.0 for ; Thu, 06 Dec 2018 23:29:04 -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:in-reply-to:references; bh=ypRGzoIWXF8tEG14l3fT1mCIYyxdn10qesUV+trV0eo=; b=UhzIbfzpFPNMAwp34vXlVUHCIps+xH3Dim4aUyZMDKxmhm3tExibxZQX9bUe8I3L/+ VsnPPL3NTHV+Jlx1n0U+3zT72F+JwGjZFtiH0mBYqMG46vDOUuFP/vdiSs4ZlrRpHaxY JlJJgyhVQ88Ij9EU5RdgnFOLmS1azFH3F/yhI= 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=ypRGzoIWXF8tEG14l3fT1mCIYyxdn10qesUV+trV0eo=; b=luEKmCbauh6swJvBfOyDjvTGU8QWKcXer/MUbhrao+JhZfpSQiKsu2P+G98FKBg0Oe UIx6Lf3U6YlWLqRLtabtejMlDb4ydeJM09pyK+/vZ4sbFUtHygN00se08sWl0jPbnp81 Bi7XHaoPIdkQlmJyxyw4aNk29+/Uy2knGSQeruNwF9ylNcQngqaHXy2qKOCGzo3tzzDN y1/Lq8UTXW4QJfCKikOwXT/NXzF60iUXpC7yx84tpdtGl+MpfGcYcW4+xdpd9aSTLUjU xgjtsTysPzYow/77Yrd635LMbi7dsTy4TkogFkIBJSwL0PnOrC8hgerfvpcaArOOXXPG lolA== X-Gm-Message-State: AA+aEWZLslfO3XNuK0Js7KgUmElrHiQyLTnp0xuPLGdpaAYegYftxr9/ aWTYlvRyfpEGGlEerEtZ/SxlVw== X-Google-Smtp-Source: AFSGD/WnKchjgcHW9h8tPHVV79waFEssj3w3dCp3nqUvTzZ2bUaCwv2LKc5QgUQ0y3kJ4hvqR1Q7kA== X-Received: by 2002:a1c:c645:: with SMTP id w66mr1317653wmf.18.1544167743513; Thu, 06 Dec 2018 23:29:03 -0800 (PST) Received: from dhcp-10-123-74-106.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id b16sm1589317wrm.41.2018.12.06.23.29.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 23:29:03 -0800 (PST) From: Suganath Prabu To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org Cc: sathya.prakash@broadcom.com, suganath-prabu.subramani@broadcom.com Subject: [PATCH 1/4] mpt3sas: Introduce flag for aero based controllers. Date: Fri, 7 Dec 2018 12:58:32 +0530 Message-Id: <1544167715-5595-2-git-send-email-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1544167715-5595-1-git-send-email-suganath-prabu.subramani@broadcom.com> References: <1544167715-5595-1-git-send-email-suganath-prabu.subramani@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 Adding flag "is_aero_ioc" to differentiate aero based controllers from other gen35 controllers. Signed-off-by: Suganath Prabu --- drivers/scsi/mpt3sas/mpt3sas_base.h | 1 + drivers/scsi/mpt3sas/mpt3sas_scsih.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h index 4b8b602..f200929 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.h +++ b/drivers/scsi/mpt3sas/mpt3sas_base.h @@ -1399,6 +1399,7 @@ struct MPT3SAS_ADAPTER { void *device_remove_in_progress; u16 device_remove_in_progress_sz; u8 is_gen35_ioc; + u8 is_aero_ioc; PUT_SMID_IO_FP_HIP put_smid_scsi_io; }; diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 5b9806d..039dee4 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -10366,10 +10366,6 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) ioc->id = mpt3_ids++; sprintf(ioc->driver_name, "%s", MPT3SAS_DRIVER_NAME); switch (pdev->device) { - case MPI26_MFGPAGE_DEVID_CFG_SEC_3816: - case MPI26_MFGPAGE_DEVID_CFG_SEC_3916: - dev_info(&pdev->dev, - "HBA is in Configurable Secure mode\n"); case MPI26_MFGPAGE_DEVID_SAS3508: case MPI26_MFGPAGE_DEVID_SAS3508_1: case MPI26_MFGPAGE_DEVID_SAS3408: @@ -10377,12 +10373,18 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) case MPI26_MFGPAGE_DEVID_SAS3516_1: case MPI26_MFGPAGE_DEVID_SAS3416: case MPI26_MFGPAGE_DEVID_SAS3616: + ioc->is_gen35_ioc = 1; + break; + case MPI26_MFGPAGE_DEVID_CFG_SEC_3816: + case MPI26_MFGPAGE_DEVID_CFG_SEC_3916: + dev_info(&pdev->dev, + "HBA is in Configurable Secure mode\n"); case MPI26_MFGPAGE_DEVID_HARD_SEC_3816: case MPI26_MFGPAGE_DEVID_HARD_SEC_3916: - ioc->is_gen35_ioc = 1; + ioc->is_aero_ioc = ioc->is_gen35_ioc = 1; break; default: - ioc->is_gen35_ioc = 0; + ioc->is_gen35_ioc = ioc->is_aero_ioc = 0; } if ((ioc->hba_mpi_version_belonged == MPI25_VERSION && pdev->revision >= SAS3_PCI_DEVICE_C0_REVISION) || From patchwork Fri Dec 7 07:28:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suganath Prabu S X-Patchwork-Id: 10717569 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 622FF109C for ; Fri, 7 Dec 2018 07:29:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48D092EA61 for ; Fri, 7 Dec 2018 07:29:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 394EB2EA6D; Fri, 7 Dec 2018 07:29: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 C7CEF2EA61 for ; Fri, 7 Dec 2018 07:29:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726067AbeLGH3I (ORCPT ); Fri, 7 Dec 2018 02:29:08 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53109 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725998AbeLGH3I (ORCPT ); Fri, 7 Dec 2018 02:29:08 -0500 Received: by mail-wm1-f66.google.com with SMTP id r11-v6so3309660wmb.2 for ; Thu, 06 Dec 2018 23:29:07 -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:in-reply-to:references; bh=LIVNocUhSGdbhkR5q1azXuG8Cb7cGN4S1iYMW//3lWA=; b=WgaD6SyJDKejrMFdTOCJAGYrDYXZVmHqvvw8pJowZnBwH62eLTK6ahfUdik3QtMa0v ZBvRKIbGFsjrINpW/F1E4a62u9GeT0lLScXOKvHRDBGvnnZ8ji9M3r0/excDg6qdBDfo 42UxU/5GBlsHQZBRBZ8FDmTznZ79zG2q2vnzA= 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=LIVNocUhSGdbhkR5q1azXuG8Cb7cGN4S1iYMW//3lWA=; b=sVTG3c08lEk3ZGrzqwMMQmquSbJhzxMRtidotysCPN484t5n88nerJbfzVs8Ch9Chg ihdBjzGxw1ySmwHOpry1XYqMAzUahCrkiPGhQEvd0d3rC3Iw3d9cld577pPBGNtPHC62 5Rg2csI6vtIreud6wK6WDZn14MGVnWwxjHzws2xUuvdxmVXszHZmWoGBdakOr9H6jr0n YlEVFqezy+rJHbFuFefhgvkqkhBt6hiApIieRivWvRnYGZTUKO5lThIIpdY/r87RmAaB XrVMDWSR9ZND8eWG5vbjwNkzNB1ppKLv07aokbi5a76d8gO1lzYlz2ggXThVZOD0XQio RySQ== X-Gm-Message-State: AA+aEWbEOwilHXnV4dGo+3YQT8ezJFgA8u0vH9w3JowdDHJdxn1yn8lm YT2o3/JXXDNrpXY+TzXQc0ty8A== X-Google-Smtp-Source: AFSGD/WIUNOCtmgvUuCd7gN7nmjXXahfy4Tr5qUk0Zww47kzd1sfjbLXHyd5+YvTBgSO+irFyoqaSg== X-Received: by 2002:a1c:a4c3:: with SMTP id n186mr1143310wme.89.1544167746757; Thu, 06 Dec 2018 23:29:06 -0800 (PST) Received: from dhcp-10-123-74-106.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id b16sm1589317wrm.41.2018.12.06.23.29.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 23:29:06 -0800 (PST) From: Suganath Prabu To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org Cc: sathya.prakash@broadcom.com, suganath-prabu.subramani@broadcom.com Subject: [PATCH 2/4] mpt3sas: Add separate function for aero doorbell reads. Date: Fri, 7 Dec 2018 12:58:33 +0530 Message-Id: <1544167715-5595-3-git-send-email-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1544167715-5595-1-git-send-email-suganath-prabu.subramani@broadcom.com> References: <1544167715-5595-1-git-send-email-suganath-prabu.subramani@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 Sometimes Aero controllers appears to be returning bad data (0) for doorbell register read and if retries are performed immediately after the bad read, they return good data. Workaround is added to retry read from doorbell registers for maximum three times if driver get the zero. Added functions base_readl_aero for Aero IOC and base_readl for gen35 and other controllers. Signed-off-by: Suganath Prabu --- drivers/scsi/mpt3sas/mpt3sas_base.c | 30 ++++++++++++++++++++++++++++++ drivers/scsi/mpt3sas/mpt3sas_base.h | 2 ++ 2 files changed, 32 insertions(+) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 9254b52..d371c8e 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -157,6 +157,32 @@ module_param_call(mpt3sas_fwfault_debug, _scsih_set_fwfault_debug, param_get_int, &mpt3sas_fwfault_debug, 0644); /** + * _base_readl_aero - retry readl for max three times. + * @addr - MPT Fusion system interface register address + * + * Retry the readl() for max three times if it gets zero value + * while reading the system interface register. + */ +static inline u32 +_base_readl_aero(const volatile void __iomem *addr) +{ + u32 i = 0, ret_val; + + do { + ret_val = readl(addr); + i++; + } while (ret_val == 0 && i < 3); + + return ret_val; +} + +static inline u32 +_base_readl(const volatile void __iomem *addr) +{ + return readl(addr); +} + +/** * _base_clone_reply_to_sys_mem - copies reply to reply free iomem * in BAR0 space. * @@ -6398,6 +6424,10 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc) ioc->rdpq_array_enable_assigned = 0; ioc->dma_mask = 0; + if (ioc->is_aero_ioc) + ioc->base_readl = &_base_readl_aero; + else + ioc->base_readl = &_base_readl; r = mpt3sas_base_map_resources(ioc); if (r) goto out_free_resources; diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h index f200929..3a294b9 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.h +++ b/drivers/scsi/mpt3sas/mpt3sas_base.h @@ -912,6 +912,7 @@ typedef void (*NVME_BUILD_PRP)(struct MPT3SAS_ADAPTER *ioc, u16 smid, typedef void (*PUT_SMID_IO_FP_HIP) (struct MPT3SAS_ADAPTER *ioc, u16 smid, u16 funcdep); typedef void (*PUT_SMID_DEFAULT) (struct MPT3SAS_ADAPTER *ioc, u16 smid); +typedef u32 (*BASE_READ_REG) (const volatile void __iomem *addr); /* IOC Facts and Port Facts converted from little endian to cpu */ union mpi3_version_union { @@ -1392,6 +1393,7 @@ struct MPT3SAS_ADAPTER { u8 hide_drives; spinlock_t diag_trigger_lock; u8 diag_trigger_active; + BASE_READ_REG base_readl; struct SL_WH_MASTER_TRIGGER_T diag_trigger_master; struct SL_WH_EVENT_TRIGGERS_T diag_trigger_event; struct SL_WH_SCSI_TRIGGERS_T diag_trigger_scsi; From patchwork Fri Dec 7 07:28:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suganath Prabu S X-Patchwork-Id: 10717571 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 3E912109C for ; Fri, 7 Dec 2018 07:29:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2855B2EA57 for ; Fri, 7 Dec 2018 07:29:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C5A12EA66; Fri, 7 Dec 2018 07:29:13 +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 83EDF2EA57 for ; Fri, 7 Dec 2018 07:29:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726070AbeLGH3M (ORCPT ); Fri, 7 Dec 2018 02:29:12 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:44453 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725998AbeLGH3M (ORCPT ); Fri, 7 Dec 2018 02:29:12 -0500 Received: by mail-wr1-f66.google.com with SMTP id z5so2776645wrt.11 for ; Thu, 06 Dec 2018 23:29:10 -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:in-reply-to:references; bh=YfXUcgmHwU97F/zXDJB0GjLdHRNoqO1GJOeBBvyNQQQ=; b=cHeHgCaePXuMOrG1gCyOpywwTJkvvPL3uw9+IHF/vKVEVx9FehVYSJ5bRla+2dL8SP nfGhw4q2Ape+4atlCrBhS2TWXNA2MAeNZK/X80ZJCJN7PGN7zo+8TdbxHNBlsPj33QB1 qGUaSOfHTGoXlf+2eSJ1hEHhm0PPu2IPEYEIo= 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=YfXUcgmHwU97F/zXDJB0GjLdHRNoqO1GJOeBBvyNQQQ=; b=bNvKUg7AOwpDTXFh7TRtlELifyvxjSVpNq1LFDE8qpK8hWetdqPoAMLG2NgWeZxemn 2oQmretWjlI2ws+6bDyoJ9kvDzmPhbrmN7wLzcW7LqW6j124uFa89X3kZkpEDaiJ9XKw BJZIaAumenPEPfN6XWDeJ2pfeBMPHKmouIkStwccMO5W2erfhhZeZTLzUYRWynoLGod/ zJoc31g8y/WgJU5ooM1hV4IRJcS2Fas60uaGnrBFVtzDvwVC/aNvbb4Ym+IXdBF3k6BL N3mWOmSTTkNcNDqTb2oIYBwKTzLSNqJogg0LfXWB0shbUhWVOJSg3aesdlN5kgUUs9aa 1Kfw== X-Gm-Message-State: AA+aEWa3Mci5B3C0eKucKWZXYxTaIM71OlHlOQ5b2e/T24vilFcfhWEW IM6KNCyCr3A8BUh0Z8oe5p4KFA== X-Google-Smtp-Source: AFSGD/VbQhUX3TOgYaYoSv1oFB/6+VHxECN0xfDT0qfnhZijRpkRQbhrQb2s1zS3bzVoJEEoSdSq8g== X-Received: by 2002:adf:e407:: with SMTP id g7mr816742wrm.277.1544167749686; Thu, 06 Dec 2018 23:29:09 -0800 (PST) Received: from dhcp-10-123-74-106.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id b16sm1589317wrm.41.2018.12.06.23.29.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 23:29:09 -0800 (PST) From: Suganath Prabu To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org Cc: sathya.prakash@broadcom.com, suganath-prabu.subramani@broadcom.com Subject: [PATCH 3/4] mpt3sas: Replace readl with ioc->base_readl. Date: Fri, 7 Dec 2018 12:58:34 +0530 Message-Id: <1544167715-5595-4-git-send-email-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1544167715-5595-1-git-send-email-suganath-prabu.subramani@broadcom.com> References: <1544167715-5595-1-git-send-email-suganath-prabu.subramani@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 Use ioc->base_readl to restrict the readl retries to only Aero controllers. Signed-off-by: Suganath Prabu --- drivers/scsi/mpt3sas/mpt3sas_base.c | 39 +++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index d371c8e..8a0851e 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -742,7 +742,7 @@ mpt3sas_halt_firmware(struct MPT3SAS_ADAPTER *ioc) dump_stack(); - doorbell = readl(&ioc->chip->Doorbell); + doorbell = ioc->base_readl(&ioc->chip->Doorbell); if ((doorbell & MPI2_IOC_STATE_MASK) == MPI2_IOC_STATE_FAULT) mpt3sas_base_fault_info(ioc , doorbell); else { @@ -1351,10 +1351,10 @@ _base_mask_interrupts(struct MPT3SAS_ADAPTER *ioc) u32 him_register; ioc->mask_interrupts = 1; - him_register = readl(&ioc->chip->HostInterruptMask); + him_register = ioc->base_readl(&ioc->chip->HostInterruptMask); him_register |= MPI2_HIM_DIM + MPI2_HIM_RIM + MPI2_HIM_RESET_IRQ_MASK; writel(him_register, &ioc->chip->HostInterruptMask); - readl(&ioc->chip->HostInterruptMask); + ioc->base_readl(&ioc->chip->HostInterruptMask); } /** @@ -1368,7 +1368,7 @@ _base_unmask_interrupts(struct MPT3SAS_ADAPTER *ioc) { u32 him_register; - him_register = readl(&ioc->chip->HostInterruptMask); + him_register = ioc->base_readl(&ioc->chip->HostInterruptMask); him_register &= ~MPI2_HIM_RIM; writel(him_register, &ioc->chip->HostInterruptMask); ioc->mask_interrupts = 0; @@ -4880,7 +4880,7 @@ mpt3sas_base_get_iocstate(struct MPT3SAS_ADAPTER *ioc, int cooked) { u32 s, sc; - s = readl(&ioc->chip->Doorbell); + s = ioc->base_readl(&ioc->chip->Doorbell); sc = s & MPI2_IOC_STATE_MASK; return cooked ? sc : s; } @@ -4936,7 +4936,7 @@ _base_wait_for_doorbell_int(struct MPT3SAS_ADAPTER *ioc, int timeout) count = 0; cntdn = 1000 * timeout; do { - int_status = readl(&ioc->chip->HostInterruptStatus); + int_status = ioc->base_readl(&ioc->chip->HostInterruptStatus); if (int_status & MPI2_HIS_IOC2SYS_DB_STATUS) { dhsprintk(ioc, ioc_info(ioc, "%s: successful count(%d), timeout(%d)\n", @@ -4962,7 +4962,7 @@ _base_spin_on_doorbell_int(struct MPT3SAS_ADAPTER *ioc, int timeout) count = 0; cntdn = 2000 * timeout; do { - int_status = readl(&ioc->chip->HostInterruptStatus); + int_status = ioc->base_readl(&ioc->chip->HostInterruptStatus); if (int_status & MPI2_HIS_IOC2SYS_DB_STATUS) { dhsprintk(ioc, ioc_info(ioc, "%s: successful count(%d), timeout(%d)\n", @@ -5000,14 +5000,14 @@ _base_wait_for_doorbell_ack(struct MPT3SAS_ADAPTER *ioc, int timeout) count = 0; cntdn = 1000 * timeout; do { - int_status = readl(&ioc->chip->HostInterruptStatus); + int_status = ioc->base_readl(&ioc->chip->HostInterruptStatus); if (!(int_status & MPI2_HIS_SYS2IOC_DB_STATUS)) { dhsprintk(ioc, ioc_info(ioc, "%s: successful count(%d), timeout(%d)\n", __func__, count, timeout)); return 0; } else if (int_status & MPI2_HIS_IOC2SYS_DB_STATUS) { - doorbell = readl(&ioc->chip->Doorbell); + doorbell = ioc->base_readl(&ioc->chip->Doorbell); if ((doorbell & MPI2_IOC_STATE_MASK) == MPI2_IOC_STATE_FAULT) { mpt3sas_base_fault_info(ioc , doorbell); @@ -5042,7 +5042,7 @@ _base_wait_for_doorbell_not_used(struct MPT3SAS_ADAPTER *ioc, int timeout) count = 0; cntdn = 1000 * timeout; do { - doorbell_reg = readl(&ioc->chip->Doorbell); + doorbell_reg = ioc->base_readl(&ioc->chip->Doorbell); if (!(doorbell_reg & MPI2_DOORBELL_USED)) { dhsprintk(ioc, ioc_info(ioc, "%s: successful count(%d), timeout(%d)\n", @@ -5157,13 +5157,13 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, __le32 *mfp; /* make sure doorbell is not in use */ - if ((readl(&ioc->chip->Doorbell) & MPI2_DOORBELL_USED)) { + if ((ioc->base_readl(&ioc->chip->Doorbell) & MPI2_DOORBELL_USED)) { ioc_err(ioc, "doorbell is in use (line=%d)\n", __LINE__); return -EFAULT; } /* clear pending doorbell interrupts from previous state changes */ - if (readl(&ioc->chip->HostInterruptStatus) & + if (ioc->base_readl(&ioc->chip->HostInterruptStatus) & MPI2_HIS_IOC2SYS_DB_STATUS) writel(0, &ioc->chip->HostInterruptStatus); @@ -5206,7 +5206,7 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, } /* read the first two 16-bits, it gives the total length of the reply */ - reply[0] = le16_to_cpu(readl(&ioc->chip->Doorbell) + reply[0] = le16_to_cpu(ioc->base_readl(&ioc->chip->Doorbell) & MPI2_DOORBELL_DATA_MASK); writel(0, &ioc->chip->HostInterruptStatus); if ((_base_wait_for_doorbell_int(ioc, 5))) { @@ -5214,7 +5214,7 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, __LINE__); return -EFAULT; } - reply[1] = le16_to_cpu(readl(&ioc->chip->Doorbell) + reply[1] = le16_to_cpu(ioc->base_readl(&ioc->chip->Doorbell) & MPI2_DOORBELL_DATA_MASK); writel(0, &ioc->chip->HostInterruptStatus); @@ -5225,9 +5225,10 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, return -EFAULT; } if (i >= reply_bytes/2) /* overflow case */ - readl(&ioc->chip->Doorbell); + ioc->base_readl(&ioc->chip->Doorbell); else - reply[i] = le16_to_cpu(readl(&ioc->chip->Doorbell) + reply[i] = le16_to_cpu( + ioc->base_readl(&ioc->chip->Doorbell) & MPI2_DOORBELL_DATA_MASK); writel(0, &ioc->chip->HostInterruptStatus); } @@ -6053,14 +6054,14 @@ _base_diag_reset(struct MPT3SAS_ADAPTER *ioc) if (count++ > 20) goto out; - host_diagnostic = readl(&ioc->chip->HostDiagnostic); + host_diagnostic = ioc->base_readl(&ioc->chip->HostDiagnostic); drsprintk(ioc, ioc_info(ioc, "wrote magic sequence: count(%d), host_diagnostic(0x%08x)\n", count, host_diagnostic)); } while ((host_diagnostic & MPI2_DIAG_DIAG_WRITE_ENABLE) == 0); - hcb_size = readl(&ioc->chip->HCBSize); + hcb_size = ioc->base_readl(&ioc->chip->HCBSize); drsprintk(ioc, ioc_info(ioc, "diag reset: issued\n")); writel(host_diagnostic | MPI2_DIAG_RESET_ADAPTER, @@ -6073,7 +6074,7 @@ _base_diag_reset(struct MPT3SAS_ADAPTER *ioc) for (count = 0; count < (300000000 / MPI2_HARD_RESET_PCIE_SECOND_READ_DELAY_MICRO_SEC); count++) { - host_diagnostic = readl(&ioc->chip->HostDiagnostic); + host_diagnostic = ioc->base_readl(&ioc->chip->HostDiagnostic); if (host_diagnostic == 0xFFFFFFFF) goto out; From patchwork Fri Dec 7 07:28:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suganath Prabu S X-Patchwork-Id: 10717573 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 93E531750 for ; Fri, 7 Dec 2018 07:29:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EF9B2EA57 for ; Fri, 7 Dec 2018 07:29:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 739242EA66; Fri, 7 Dec 2018 07:29:15 +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 27D642EA57 for ; Fri, 7 Dec 2018 07:29:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726071AbeLGH3O (ORCPT ); Fri, 7 Dec 2018 02:29:14 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:33321 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725998AbeLGH3O (ORCPT ); Fri, 7 Dec 2018 02:29:14 -0500 Received: by mail-wr1-f66.google.com with SMTP id c14so2849491wrr.0 for ; Thu, 06 Dec 2018 23:29:13 -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:in-reply-to:references; bh=6FS9CyelikXzPae3gLBx6jwTA4POriHs99i7Tuw/9Vo=; b=F3NzKbBqJ+qSp0QC/SR84Yv7eGQIfc9JMjRGhVdI8uP+Erwe+PWDflzo7Ei5kGBLXF LHtNRP8Ym06nsSc0qeNpLMYqF1bYdXBZWHjelbRjE1IY4m4yLLw5oqNB8gOazQObWdgT RLIdzD5bSHFFNW0JzgCe0LoBjGwQpeJA5SnSg= 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=6FS9CyelikXzPae3gLBx6jwTA4POriHs99i7Tuw/9Vo=; b=Mem9tVHnFhA9qtFH9yO/6k4QsX3NIbLzHDOufA6osuulxzAnUHAljKgIIo3y5dZuo0 Q+AU9n0WPKHKFYad2Q77jgM3ds+Vd2VhekEdPvBds3VBwfzg/1Kwh0mGkgOOPBhwXNnO fA2Q/TBwFvi+5OwofakCVg6wtZGVQ/3SIWz7ovDNezz9sNE+SlcYFSinRNJE6e21sQ/j TWNgDb9Bk8ElteRt34bUu+ED1qHJrE8AkW7cb6CkP+vUhkLZr+F7gieVWYQVIxSE0Rtt 1TujneArqoRzDYOZjOXUbOO7whxnY2DgD+/GDbsxs6uxWkOA3+BaEEjFKoXWgnSS3BVJ 9N1w== X-Gm-Message-State: AA+aEWZwDthl2asbLlxdD0pzu7sn4hMHqmBb4eVPUI5/VbMKFAHALF5c ZROslNuUTHrL1fbw8HapxsC5+Q== X-Google-Smtp-Source: AFSGD/VnyKcO5tXUlTtuGlTfpnlIiYozfJ+CdzSjUUuNbprjs+6Nrn+MjQUncrlQGaAyBfBP+Cz2hw== X-Received: by 2002:adf:b649:: with SMTP id i9mr905665wre.70.1544167752921; Thu, 06 Dec 2018 23:29:12 -0800 (PST) Received: from dhcp-10-123-74-106.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id b16sm1589317wrm.41.2018.12.06.23.29.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 23:29:12 -0800 (PST) From: Suganath Prabu To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org Cc: sathya.prakash@broadcom.com, suganath-prabu.subramani@broadcom.com Subject: [PATCH 4/4] mpt3sas: Update driver version to 27.101.00.00. Date: Fri, 7 Dec 2018 12:58:35 +0530 Message-Id: <1544167715-5595-5-git-send-email-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1544167715-5595-1-git-send-email-suganath-prabu.subramani@broadcom.com> References: <1544167715-5595-1-git-send-email-suganath-prabu.subramani@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 Update driver version from 27.100.00.00 to 27.101.00.00. Signed-off-by: Suganath Prabu --- drivers/scsi/mpt3sas/mpt3sas_base.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h index 3a294b9..8003519 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.h +++ b/drivers/scsi/mpt3sas/mpt3sas_base.h @@ -75,9 +75,9 @@ #define MPT3SAS_DRIVER_NAME "mpt3sas" #define MPT3SAS_AUTHOR "Avago Technologies " #define MPT3SAS_DESCRIPTION "LSI MPT Fusion SAS 3.0 Device Driver" -#define MPT3SAS_DRIVER_VERSION "27.100.00.00" +#define MPT3SAS_DRIVER_VERSION "27.101.00.00" #define MPT3SAS_MAJOR_VERSION 27 -#define MPT3SAS_MINOR_VERSION 100 +#define MPT3SAS_MINOR_VERSION 101 #define MPT3SAS_BUILD_VERSION 0 #define MPT3SAS_RELEASE_VERSION 00