From patchwork Mon Sep 24 06:35:11 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: 10611925 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 260FE13A4 for ; Mon, 24 Sep 2018 06:35:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 334A82867F for ; Mon, 24 Sep 2018 06:35:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2759D29BD9; Mon, 24 Sep 2018 06:35:32 +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 842F52867F for ; Mon, 24 Sep 2018 06:35:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726218AbeIXMgD (ORCPT ); Mon, 24 Sep 2018 08:36:03 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:43306 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725982AbeIXMgD (ORCPT ); Mon, 24 Sep 2018 08:36:03 -0400 Received: by mail-pg1-f194.google.com with SMTP id q19-v6so7862490pgn.10 for ; Sun, 23 Sep 2018 23:35:30 -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=bAnr+XZjx2o/sIi56CxxaeJ/uJF1SYkVYGPhWo5CVu8=; b=arOaSUWWmGzd8mnGzjC+upKzptZtPMp99JHxpgwyHMBYw7LZL5qhWyLhj55nHrcpL2 iNzKLPDX5upsEM840MgGP/eh5197scWW8lq4+TeHqFPhyrfKfTQPesL/kzBmz2Q/J1u+ oTtoRecpZZGLOrZqBq5cE0bsLD1oGx+2Z0i/E= 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=bAnr+XZjx2o/sIi56CxxaeJ/uJF1SYkVYGPhWo5CVu8=; b=qFuIQhPIZB0w28zPhhfM+XvtDh674s1gFDRP39CNEHd1ZhGEhngQf8PLgrpovZsz0l nr6+IJ+5u+vWUtzPYQdrgSCYklj0B4hCWtCKjxSZ3XCWqBnNfciBWMNuSD8SADTLiwUk d9sJChzVdMXmhhh5aWh/gv0lZM5VRUK9AovAli+VjiqNU0BDZ/ipkufNpPwlq5Rmn+TM jYGiOV4YxKExX1kmnIS9mA+I1I71zjSLpircOX5rtCCH6oRQU4qQKgOFZVze8s/itoF2 rUFpaM2viQTRqb/gbu7JxUC9kGLmb1WSGq7GRj0tHZ60fBeid9T0+zO2ij8poGoMFGa0 OkXg== X-Gm-Message-State: ABuFfogcSjynWI13xsbdS1pjs5yIsdU8scsyn4IWvSwYL/NDyPwspL2w zzmI/gQqnCj/mQHoiVrs2wqGiIaGmUo= X-Google-Smtp-Source: ACcGV60EhIB4vXbQkF9KxnTOXk0CWXnZUUaw+pWhsZt6ErmXTPmnAtLnWvsDiwvUQ/+85uia2qFfcQ== X-Received: by 2002:a63:69c3:: with SMTP id e186-v6mr8083298pgc.431.1537770929396; Sun, 23 Sep 2018 23:35:29 -0700 (PDT) Received: from dhcp-10-123-74-106.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 203-v6sm12287064pge.25.2018.09.23.23.35.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Sep 2018 23:35:28 -0700 (PDT) From: Suganath Prabu S To: linux-scsi@vger.kernel.org Cc: Sathya.Prakash@broadcom.com, sreekanth.reddy@broadcom.com, Suganath Prabu S Subject: [PATCH v3 1/6] mpt3sas: Introduce mpt3sas_base_pci_device_is_available Date: Mon, 24 Sep 2018 12:05:11 +0530 Message-Id: <1537770916-16337-2-git-send-email-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1537770916-16337-1-git-send-email-suganath-prabu.subramani@broadcom.com> References: <1537770916-16337-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 * Driver uses "pci_device_is_present" to check whether If Hot unplugged: the outstanding IOs with 'DID_NO_CONNECT' before removing the drives attached to the HBA. "DID_NO_CONNECT" status and free the smid, if driver detects that HBA is hot unplugged. * In the hard reset flush out all the outstanding IOs even if diag reset fails and also if driver detects that HBA is hot unplugged. v1 change set: ============== unlock mutex before goto "out_unlocked", if active reset is in progress. v2 change set: ============== 1) Use pci_device_is_present instead of mpt3sas_base_pci_device_is_unplugged. 2) As suggested by Lukas, removed using watchdog thread for checking hba hot unplug(Patch 02 of V1). Added Hot unplug checks in scan finish and reset paths. v3 Change Set: ============= Simplified function "mpt3sas_base_pci_device_is_available" and made inline. Signed-off-by: Suganath Prabu S --- drivers/scsi/mpt3sas/mpt3sas_base.c | 41 +++++++++++++++++++++++++++++ drivers/scsi/mpt3sas/mpt3sas_base.h | 3 ++- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 50 ++++++++++++++++++++++++++++++++---- 3 files changed, 88 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 59d7844..c98d8e2 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -543,6 +543,20 @@ static int mpt3sas_remove_dead_ioc_func(void *arg) } /** + * mpt3sas_base_pci_device_is_available - check whether pci device is + * available for any transactions with FW + * + * @ioc: per adapter object + * + * Return 1 if pci device state is up and running else return 0. + */ +inline bool +mpt3sas_base_pci_device_is_available(struct MPT3SAS_ADAPTER *ioc) +{ + return !ioc->pci_error_recovery && pci_device_is_present(ioc->pdev); +} + +/** * _base_fault_reset_work - workq handling ioc fault conditions * @work: input argument, used to derive ioc * @@ -6122,6 +6136,11 @@ _base_diag_reset(struct MPT3SAS_ADAPTER *ioc) count = 0; do { + if (!pci_device_is_present(ioc->pdev)) { + ioc->remove_host = 1; + pr_err(MPT3SAS_FMT "Hba Hot unplugged\n", ioc->name); + goto out; + } /* Write magic sequence to WriteSequence register * Loop until in diagnostic mode */ @@ -6853,6 +6872,14 @@ mpt3sas_wait_for_commands_to_complete(struct MPT3SAS_ADAPTER *ioc) ioc->pending_io_count = 0; + if (!mpt3sas_base_pci_device_is_available(ioc)) { + pr_err(MPT3SAS_FMT + "%s: pci error recovery reset or" + " pci device unplug occurred\n", + ioc->name, __func__); + return; + } + ioc_state = mpt3sas_base_get_iocstate(ioc, 0); if ((ioc_state & MPI2_IOC_STATE_MASK) != MPI2_IOC_STATE_OPERATIONAL) return; @@ -6899,6 +6926,20 @@ mpt3sas_base_hard_reset_handler(struct MPT3SAS_ADAPTER *ioc, /* wait for an active reset in progress to complete */ mutex_lock(&ioc->reset_in_progress_mutex); + if (!mpt3sas_base_pci_device_is_available(ioc)) { + pr_err(MPT3SAS_FMT + "%s: pci error recovery reset or" + " pci device unplug occurred\n", + ioc->name, __func__); + if (!pci_device_is_present(ioc->pdev)) + ioc->schedule_dead_ioc_flush_running_cmds(ioc); + r = 0; + mutex_unlock(&ioc->reset_in_progress_mutex); + goto out_unlocked; + } + + mpt3sas_halt_firmware(ioc); + spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); ioc->shost_recovery = 1; spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h index 96dc15e..a802ad4 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.h +++ b/drivers/scsi/mpt3sas/mpt3sas_base.h @@ -1474,7 +1474,8 @@ void mpt3sas_base_update_missing_delay(struct MPT3SAS_ADAPTER *ioc, u16 device_missing_delay, u8 io_missing_delay); int mpt3sas_port_enable(struct MPT3SAS_ADAPTER *ioc); - +inline bool mpt3sas_base_pci_device_is_available( + struct MPT3SAS_ADAPTER *ioc); void mpt3sas_wait_for_commands_to_complete(struct MPT3SAS_ADAPTER *ioc); diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 53133cf..566a550 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -2846,9 +2846,19 @@ scsih_abort(struct scsi_cmnd *scmd) "attempting task abort! scmd(%p)\n", scmd); _scsih_tm_display_info(ioc, scmd); + if (!pci_device_is_present(ioc->pdev) || ioc->remove_host) { + sdev_printk(KERN_INFO, scmd->device, "%s scmd(%p)\n", + ((ioc->remove_host) ? ("shost is getting removed!") : + ("pci device been removed!")), scmd); + if (st && st->smid) + mpt3sas_base_free_smid(ioc, st->smid); + scmd->result = DID_NO_CONNECT << 16; + r = FAST_IO_FAIL; + goto out; + } + sas_device_priv_data = scmd->device->hostdata; - if (!sas_device_priv_data || !sas_device_priv_data->sas_target || - ioc->remove_host) { + if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { sdev_printk(KERN_INFO, scmd->device, "device been deleted! scmd(%p)\n", scmd); scmd->result = DID_NO_CONNECT << 16; @@ -2918,6 +2928,15 @@ scsih_dev_reset(struct scsi_cmnd *scmd) "attempting device reset! scmd(%p)\n", scmd); _scsih_tm_display_info(ioc, scmd); + if (!pci_device_is_present(ioc->pdev) || ioc->remove_host) { + sdev_printk(KERN_INFO, scmd->device, "%s scmd(%p)\n", + ((ioc->remove_host) ? ("shost is getting removed!") : + ("pci device been removed!")), scmd); + scmd->result = DID_NO_CONNECT << 16; + r = FAST_IO_FAIL; + goto out; + } + sas_device_priv_data = scmd->device->hostdata; if (!sas_device_priv_data || !sas_device_priv_data->sas_target || ioc->remove_host) { @@ -2995,9 +3014,17 @@ scsih_target_reset(struct scsi_cmnd *scmd) scmd); _scsih_tm_display_info(ioc, scmd); + if ((!pci_device_is_present(ioc->pdev)) || ioc->remove_host) { + sdev_printk(KERN_INFO, scmd->device, "%s scmd(%p)\n", + ((ioc->remove_host) ? ("shost is getting removed!") : + ("pci device been removed!")), scmd); + scmd->result = DID_NO_CONNECT << 16; + r = FAST_IO_FAIL; + goto out; + } + sas_device_priv_data = scmd->device->hostdata; - if (!sas_device_priv_data || !sas_device_priv_data->sas_target || - ioc->remove_host) { + if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { starget_printk(KERN_INFO, starget, "target been deleted! scmd(%p)\n", scmd); scmd->result = DID_NO_CONNECT << 16; @@ -4474,7 +4501,9 @@ _scsih_flush_running_cmds(struct MPT3SAS_ADAPTER *ioc) st = scsi_cmd_priv(scmd); mpt3sas_base_clear_st(ioc, st); scsi_dma_unmap(scmd); - if (ioc->pci_error_recovery || ioc->remove_host) + + if ((!mpt3sas_base_pci_device_is_available(ioc)) + || ioc->remove_host) scmd->result = DID_NO_CONNECT << 16; else scmd->result = DID_RESET << 16; @@ -9726,6 +9755,9 @@ _scsih_ir_shutdown(struct MPT3SAS_ADAPTER *ioc) if (list_empty(&ioc->raid_device_list)) return; + if (!pci_device_is_present(ioc->pdev)) + return; + mutex_lock(&ioc->scsih_cmds.mutex); if (ioc->scsih_cmds.status != MPT3_CMD_NOT_USED) { @@ -10247,6 +10279,14 @@ scsih_scan_finished(struct Scsi_Host *shost, unsigned long time) { struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); + if (!pci_device_is_present(ioc->pdev)) { + complete(&ioc->port_enable_cmds.done); + ioc->port_enable_cmds.status = MPT3_CMD_NOT_USED; + ioc->is_driver_loading = 0; + ioc->remove_host = 1; + return 1; + } + if (disable_discovery > 0) { ioc->is_driver_loading = 0; ioc->wait_for_discovery_to_complete = 0; From patchwork Mon Sep 24 06:35:12 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: 10611927 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 F0B9514BD for ; Mon, 24 Sep 2018 06:35:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 085222867F for ; Mon, 24 Sep 2018 06:35:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0CFC29BD9; Mon, 24 Sep 2018 06:35: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 217FC2867F for ; Mon, 24 Sep 2018 06:35:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726273AbeIXMgG (ORCPT ); Mon, 24 Sep 2018 08:36:06 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:42005 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725982AbeIXMgG (ORCPT ); Mon, 24 Sep 2018 08:36:06 -0400 Received: by mail-pf1-f194.google.com with SMTP id l9-v6so8608066pff.9 for ; Sun, 23 Sep 2018 23:35: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=+a7mzD7lNkb/LyfD/133s+24a95ItOTV8nKeI/kTPzI=; b=QE+NjFLFxFfahVZEC1QArLslPsBrYSaEFeIIYHTXXxQ6VLuQz9AhEv5u8nJu8k7ors d52zS1RwRvHztPMMQTvH/Nh8EueYm406kQ2Z3xCwhtqbyD1GXdaNLAUrurXWOGaXFMRR 1xi3Evqs4u22I261s1jxBueLe22iRCtHxf9c4= 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=+a7mzD7lNkb/LyfD/133s+24a95ItOTV8nKeI/kTPzI=; b=cZk73sb4yb9a+jFf7d18Nn2voBpj0CbCoMgv/QNAoyVNCw/rW9IN1jxBFS7oxiHGe7 SdvH+KKFs0uMQGu/uiFDdCD4NYhqUwTJ5Rk8GDVzNcdJdACMnkkBW/meNpN3i6IYCecY HDldvHxMS/aUs3YKhx9lo233dzx8NsFM7vs6uy5x14THfil63e65lESuBwasAIrZVILf bcBxfOefoDV0PNtEiRzjtuMGeR+mq2vYUrbF5vm7lPvxy/TSJY23xb67YQez1G2Rkmek F4/WxY+e6rYVsbPj2JgJdgItKfx4mCRiR1Eg6kBq6NOaPr3g0Yg9mtU6QGdzsbJCTuIX XN8w== X-Gm-Message-State: APzg51CxtMaoSYAH61EZVpjS1H0tnjlR4GaUPTfpaRj0zPuotmJsLIvT irxLOBARQtqYacEgj/f51Gq3b6ib8o4= X-Google-Smtp-Source: ANB0VdbGe7UJ5l0afZDDZ54TmF6sQnsIDJxU0pDFaIgANRK1cDi5uV9ab+xfCAyQoIpSMfv/IfnxMw== X-Received: by 2002:a62:9894:: with SMTP id d20-v6mr8984411pfk.186.1537770932002; Sun, 23 Sep 2018 23:35:32 -0700 (PDT) Received: from dhcp-10-123-74-106.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 203-v6sm12287064pge.25.2018.09.23.23.35.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Sep 2018 23:35:31 -0700 (PDT) From: Suganath Prabu S To: linux-scsi@vger.kernel.org Cc: Sathya.Prakash@broadcom.com, sreekanth.reddy@broadcom.com, Suganath Prabu S Subject: [PATCH v3 2/6] mpt3sas: Separate out mpt3sas_wait_for_ioc_to_operational Date: Mon, 24 Sep 2018 12:05:12 +0530 Message-Id: <1537770916-16337-3-git-send-email-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1537770916-16337-1-git-send-email-suganath-prabu.subramani@broadcom.com> References: <1537770916-16337-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 Introduce mpt3sas_wait_for_ioc_to_operational. This section of code "wait for IOC to be operational" is used in many places across the driver, and hence moved this section of code in to the function "mpt3sas_wait_for_ioc_to_operational". Also added HBA hot unplug checks, and this returns with error code EFAULT, if it detects HBA is hot unplugged or IOC is not in operational state. V2 change set: used pci_device_is_present instead of mpt3sas_base_pci_device_is_unplugged Signed-off-by: Suganath Prabu S --- drivers/scsi/mpt3sas/mpt3sas_base.c | 92 +++++++++++++++++++------------- drivers/scsi/mpt3sas/mpt3sas_base.h | 4 ++ drivers/scsi/mpt3sas/mpt3sas_config.c | 28 +++------- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 26 ++------- drivers/scsi/mpt3sas/mpt3sas_transport.c | 75 +++++--------------------- 5 files changed, 81 insertions(+), 144 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index c98d8e2..55e6fd0 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -5176,6 +5176,53 @@ _base_send_ioc_reset(struct MPT3SAS_ADAPTER *ioc, u8 reset_type, int timeout) } /** + * mpt3sas_wait_for_ioc_to_operational - IOC's operational + * state and HBA hot unplug status are checked here. + * @ioc: per adapter object + * @wait_count: timeout in seconds + * + * Return: Returns EFAULT, if HBA is hot unplugged or IOC is + * not in operational state, within the wait_count. + * And returns 0, If not hot unplugged Or ioc is in + * operational state. + */ + +int +mpt3sas_wait_for_ioc_to_operational(struct MPT3SAS_ADAPTER *ioc, + int wait_count) +{ + int wait_state_count = 0; + u32 ioc_state; + + if (!pci_device_is_present(ioc->pdev)) + return -EFAULT; + + ioc_state = mpt3sas_base_get_iocstate(ioc, 1); + while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) { + + if (!pci_device_is_present(ioc->pdev)) + return -EFAULT; + + if (wait_state_count++ == wait_count) { + pr_err(MPT3SAS_FMT + "%s: failed due to ioc not operational\n", + ioc->name, __func__); + return -EFAULT; + } + ssleep(1); + ioc_state = mpt3sas_base_get_iocstate(ioc, 1); + pr_info(MPT3SAS_FMT "%s: waiting for " + "operational state(count=%d)\n", ioc->name, + __func__, wait_state_count); + } + if (wait_state_count) + pr_info(MPT3SAS_FMT "%s: ioc is operational\n", + ioc->name, __func__); + + return 0; +} + +/** * _base_handshake_req_reply_wait - send request thru doorbell interface * @ioc: per adapter object * @request_bytes: request length @@ -5316,11 +5363,9 @@ mpt3sas_base_sas_iounit_control(struct MPT3SAS_ADAPTER *ioc, Mpi2SasIoUnitControlRequest_t *mpi_request) { u16 smid; - u32 ioc_state; u8 issue_reset = 0; int rc; void *request; - u16 wait_state_count; dinitprintk(ioc, pr_info(MPT3SAS_FMT "%s\n", ioc->name, __func__)); @@ -5334,22 +5379,10 @@ mpt3sas_base_sas_iounit_control(struct MPT3SAS_ADAPTER *ioc, goto out; } - wait_state_count = 0; - ioc_state = mpt3sas_base_get_iocstate(ioc, 1); - while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) { - if (wait_state_count++ == 10) { - pr_err(MPT3SAS_FMT - "%s: failed due to ioc not operational\n", - ioc->name, __func__); - rc = -EFAULT; - goto out; - } - ssleep(1); - ioc_state = mpt3sas_base_get_iocstate(ioc, 1); - pr_info(MPT3SAS_FMT - "%s: waiting for operational state(count=%d)\n", - ioc->name, __func__, wait_state_count); - } + rc = mpt3sas_wait_for_ioc_to_operational(ioc, + IOC_OPERATIONAL_WAIT_COUNT); + if (rc) + goto out; smid = mpt3sas_base_get_smid(ioc, ioc->base_cb_idx); if (!smid) { @@ -5416,11 +5449,9 @@ mpt3sas_base_scsi_enclosure_processor(struct MPT3SAS_ADAPTER *ioc, Mpi2SepReply_t *mpi_reply, Mpi2SepRequest_t *mpi_request) { u16 smid; - u32 ioc_state; u8 issue_reset = 0; int rc; void *request; - u16 wait_state_count; dinitprintk(ioc, pr_info(MPT3SAS_FMT "%s\n", ioc->name, __func__)); @@ -5434,23 +5465,10 @@ mpt3sas_base_scsi_enclosure_processor(struct MPT3SAS_ADAPTER *ioc, goto out; } - wait_state_count = 0; - ioc_state = mpt3sas_base_get_iocstate(ioc, 1); - while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) { - if (wait_state_count++ == 10) { - pr_err(MPT3SAS_FMT - "%s: failed due to ioc not operational\n", - ioc->name, __func__); - rc = -EFAULT; - goto out; - } - ssleep(1); - ioc_state = mpt3sas_base_get_iocstate(ioc, 1); - pr_info(MPT3SAS_FMT - "%s: waiting for operational state(count=%d)\n", - ioc->name, - __func__, wait_state_count); - } + rc = mpt3sas_wait_for_ioc_to_operational(ioc, + IOC_OPERATIONAL_WAIT_COUNT); + if (rc) + goto out; smid = mpt3sas_base_get_smid(ioc, ioc->base_cb_idx); if (!smid) { diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h index a802ad4..f0351a2 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.h +++ b/drivers/scsi/mpt3sas/mpt3sas_base.h @@ -139,6 +139,8 @@ #define DEFAULT_NUM_FWCHAIN_ELEMTS 8 #define FW_IMG_HDR_READ_TIMEOUT 15 + +#define IOC_OPERATIONAL_WAIT_COUNT 10 /* * NVMe defines */ @@ -1481,6 +1483,8 @@ mpt3sas_wait_for_commands_to_complete(struct MPT3SAS_ADAPTER *ioc); u8 mpt3sas_base_check_cmd_timeout(struct MPT3SAS_ADAPTER *ioc, u8 status, void *mpi_request, int sz); +int mpt3sas_wait_for_ioc_to_operational(struct MPT3SAS_ADAPTER *ioc, + int wait_count); /* scsih shared API */ struct scsi_cmnd *mpt3sas_scsih_scsi_lookup_get(struct MPT3SAS_ADAPTER *ioc, diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c index d29a2dc..5713a2d 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_config.c +++ b/drivers/scsi/mpt3sas/mpt3sas_config.c @@ -303,11 +303,10 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t void *config_page, u16 config_page_sz) { u16 smid; - u32 ioc_state; Mpi2ConfigRequest_t *config_request; int r; u8 retry_count, issue_host_reset = 0; - u16 wait_state_count; + struct config_request mem; u32 ioc_status = UINT_MAX; @@ -365,26 +364,11 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t pr_info(MPT3SAS_FMT "%s: attempting retry (%d)\n", ioc->name, __func__, retry_count); } - wait_state_count = 0; - ioc_state = mpt3sas_base_get_iocstate(ioc, 1); - while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) { - if (wait_state_count++ == MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT) { - pr_err(MPT3SAS_FMT - "%s: failed due to ioc not operational\n", - ioc->name, __func__); - ioc->config_cmds.status = MPT3_CMD_NOT_USED; - r = -EFAULT; - goto free_mem; - } - ssleep(1); - ioc_state = mpt3sas_base_get_iocstate(ioc, 1); - pr_info(MPT3SAS_FMT - "%s: waiting for operational state(count=%d)\n", - ioc->name, __func__, wait_state_count); - } - if (wait_state_count) - pr_info(MPT3SAS_FMT "%s: ioc is operational\n", - ioc->name, __func__); + + r = mpt3sas_wait_for_ioc_to_operational(ioc, + MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT); + if (r) + goto free_mem; smid = mpt3sas_base_get_smid(ioc, ioc->config_cb_idx); if (!smid) { diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c index 5e8c059..a46039c 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c +++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c @@ -652,7 +652,6 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg, MPI2DefaultReply_t *mpi_reply; Mpi26NVMeEncapsulatedRequest_t *nvme_encap_request = NULL; struct _pcie_device *pcie_device = NULL; - u32 ioc_state; u16 smid; u8 timeout; u8 issue_reset; @@ -665,7 +664,6 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg, dma_addr_t data_in_dma = 0; size_t data_in_sz = 0; long ret; - u16 wait_state_count; u16 device_handle = MPT3SAS_INVALID_DEVICE_HANDLE; u8 tr_method = MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE; @@ -678,26 +676,10 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg, goto out; } - wait_state_count = 0; - ioc_state = mpt3sas_base_get_iocstate(ioc, 1); - while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) { - if (wait_state_count++ == 10) { - pr_err(MPT3SAS_FMT - "%s: failed due to ioc not operational\n", - ioc->name, __func__); - ret = -EFAULT; - goto out; - } - ssleep(1); - ioc_state = mpt3sas_base_get_iocstate(ioc, 1); - pr_info(MPT3SAS_FMT - "%s: waiting for operational state(count=%d)\n", - ioc->name, - __func__, wait_state_count); - } - if (wait_state_count) - pr_info(MPT3SAS_FMT "%s: ioc is operational\n", - ioc->name, __func__); + ret = mpt3sas_wait_for_ioc_to_operational(ioc, + IOC_OPERATIONAL_WAIT_COUNT); + if (ret) + goto out; mpi_request = kzalloc(ioc->request_sz, GFP_KERNEL); if (!mpi_request) { diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c index f8cc267..b10d73e 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_transport.c +++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c @@ -299,7 +299,6 @@ _transport_expander_report_manufacture(struct MPT3SAS_ADAPTER *ioc, struct rep_manu_request *manufacture_request; int rc; u16 smid; - u32 ioc_state; void *psge; u8 issue_reset = 0; void *data_out = NULL; @@ -307,7 +306,6 @@ _transport_expander_report_manufacture(struct MPT3SAS_ADAPTER *ioc, dma_addr_t data_in_dma; size_t data_in_sz; size_t data_out_sz; - u16 wait_state_count; if (ioc->shost_recovery || ioc->pci_error_recovery) { pr_info(MPT3SAS_FMT "%s: host reset in progress!\n", @@ -325,25 +323,10 @@ _transport_expander_report_manufacture(struct MPT3SAS_ADAPTER *ioc, } ioc->transport_cmds.status = MPT3_CMD_PENDING; - wait_state_count = 0; - ioc_state = mpt3sas_base_get_iocstate(ioc, 1); - while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) { - if (wait_state_count++ == 10) { - pr_err(MPT3SAS_FMT - "%s: failed due to ioc not operational\n", - ioc->name, __func__); - rc = -EFAULT; - goto out; - } - ssleep(1); - ioc_state = mpt3sas_base_get_iocstate(ioc, 1); - pr_info(MPT3SAS_FMT - "%s: waiting for operational state(count=%d)\n", - ioc->name, __func__, wait_state_count); - } - if (wait_state_count) - pr_info(MPT3SAS_FMT "%s: ioc is operational\n", - ioc->name, __func__); + rc = mpt3sas_wait_for_ioc_to_operational(ioc, + IOC_OPERATIONAL_WAIT_COUNT); + if (rc) + goto out; smid = mpt3sas_base_get_smid(ioc, ioc->transport_cb_idx); if (!smid) { @@ -1089,13 +1072,11 @@ _transport_get_expander_phy_error_log(struct MPT3SAS_ADAPTER *ioc, struct phy_error_log_reply *phy_error_log_reply; int rc; u16 smid; - u32 ioc_state; void *psge; u8 issue_reset = 0; void *data_out = NULL; dma_addr_t data_out_dma; u32 sz; - u16 wait_state_count; if (ioc->shost_recovery || ioc->pci_error_recovery) { pr_info(MPT3SAS_FMT "%s: host reset in progress!\n", @@ -1113,25 +1094,10 @@ _transport_get_expander_phy_error_log(struct MPT3SAS_ADAPTER *ioc, } ioc->transport_cmds.status = MPT3_CMD_PENDING; - wait_state_count = 0; - ioc_state = mpt3sas_base_get_iocstate(ioc, 1); - while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) { - if (wait_state_count++ == 10) { - pr_err(MPT3SAS_FMT - "%s: failed due to ioc not operational\n", - ioc->name, __func__); - rc = -EFAULT; - goto out; - } - ssleep(1); - ioc_state = mpt3sas_base_get_iocstate(ioc, 1); - pr_info(MPT3SAS_FMT - "%s: waiting for operational state(count=%d)\n", - ioc->name, __func__, wait_state_count); - } - if (wait_state_count) - pr_info(MPT3SAS_FMT "%s: ioc is operational\n", - ioc->name, __func__); + rc = mpt3sas_wait_for_ioc_to_operational(ioc, + IOC_OPERATIONAL_WAIT_COUNT); + if (rc) + goto out; smid = mpt3sas_base_get_smid(ioc, ioc->transport_cb_idx); if (!smid) { @@ -1402,13 +1368,11 @@ _transport_expander_phy_control(struct MPT3SAS_ADAPTER *ioc, struct phy_control_reply *phy_control_reply; int rc; u16 smid; - u32 ioc_state; void *psge; u8 issue_reset = 0; void *data_out = NULL; dma_addr_t data_out_dma; u32 sz; - u16 wait_state_count; if (ioc->shost_recovery || ioc->pci_error_recovery) { pr_info(MPT3SAS_FMT "%s: host reset in progress!\n", @@ -1426,25 +1390,10 @@ _transport_expander_phy_control(struct MPT3SAS_ADAPTER *ioc, } ioc->transport_cmds.status = MPT3_CMD_PENDING; - wait_state_count = 0; - ioc_state = mpt3sas_base_get_iocstate(ioc, 1); - while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) { - if (wait_state_count++ == 10) { - pr_err(MPT3SAS_FMT - "%s: failed due to ioc not operational\n", - ioc->name, __func__); - rc = -EFAULT; - goto out; - } - ssleep(1); - ioc_state = mpt3sas_base_get_iocstate(ioc, 1); - pr_info(MPT3SAS_FMT - "%s: waiting for operational state(count=%d)\n", - ioc->name, __func__, wait_state_count); - } - if (wait_state_count) - pr_info(MPT3SAS_FMT "%s: ioc is operational\n", - ioc->name, __func__); + rc = mpt3sas_wait_for_ioc_to_operational(ioc, + IOC_OPERATIONAL_WAIT_COUNT); + if (rc) + goto out; smid = mpt3sas_base_get_smid(ioc, ioc->transport_cb_idx); if (!smid) { From patchwork Mon Sep 24 06:35:13 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: 10611929 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 EF4E014BD for ; Mon, 24 Sep 2018 06:35:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 075222867F for ; Mon, 24 Sep 2018 06:35:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EFF8B29BD9; Mon, 24 Sep 2018 06:35: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 67CBA2867F for ; Mon, 24 Sep 2018 06:35:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727088AbeIXMgI (ORCPT ); Mon, 24 Sep 2018 08:36:08 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:37368 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725982AbeIXMgI (ORCPT ); Mon, 24 Sep 2018 08:36:08 -0400 Received: by mail-pl1-f194.google.com with SMTP id q1-v6so3194804plr.4 for ; Sun, 23 Sep 2018 23:35: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=CQIUVe8kw8rc54n+Jp4srCzp/ifB3+reTSintP2mjnE=; b=QkWPcCxxJaw9lCmCySZTAWkqYkZ+whUJPG801lYB0oY9A6nq+KrgX+3HQTD1MvPTKk AlPD4PA/NA64MgSRIDUediHmWcKjQ+S263ZLB/UWoyctbmTkReS+EqoHqJ0RSeG0uRU7 oAz9FVSSqUEfwDaH6bizJUJ2HyWobdTzJEPLM= 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=CQIUVe8kw8rc54n+Jp4srCzp/ifB3+reTSintP2mjnE=; b=GALRa+uZLix5dTIAufD7mAPSBQhzWzbVqx5l8ZFlBCVhF9l2/Ujofz1R0FYrqbkO+b 3emJrOhUjELmFWm7y2/PR1+IodrciiTZM0AiqkSvUG2D2BRkqtC79jc3iQvm81MQ8Ipl 1491zngPJIAWALvHM5dBsvJkx3J87bYvIVpRoAnKq14tXXbmm3ByyPn/QAfq6+DNusmp wQVv7Zio7eA5FxJByYDAmqQfBUlZtKUpp8REQMfCy8aDcdoFM290nZyj42bw0kM0RmXQ PxWuy3tVtYFqOCkUxfC+Uazr+NZ/VaDBm5ryuoNp815irS2RWYDWRqXt+IXrWcck/dV3 rjQA== X-Gm-Message-State: ABuFfognXibgYqvhHbhZUr11ioFYR4GoowWMxSIWv+XHeyOhOnMhUKqg wv2jtxHLRQO72gkYa0NMRCh3gLRJ52A= X-Google-Smtp-Source: ACcGV61shQfT73Z1+v1pSF1a0wXhwKZBww2mf46HO4dVj2SLv66TnbXMg2e2MYlMkV+FQvvoc10YpQ== X-Received: by 2002:a17:902:8bc4:: with SMTP id r4-v6mr8918858plo.124.1537770934588; Sun, 23 Sep 2018 23:35:34 -0700 (PDT) Received: from dhcp-10-123-74-106.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 203-v6sm12287064pge.25.2018.09.23.23.35.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Sep 2018 23:35:33 -0700 (PDT) From: Suganath Prabu S To: linux-scsi@vger.kernel.org Cc: Sathya.Prakash@broadcom.com, sreekanth.reddy@broadcom.com, Suganath Prabu S Subject: [PATCH v3 3/6] mpt3sas: Introdude _scsih_get_shost_and_ioc. Date: Mon, 24 Sep 2018 12:05:13 +0530 Message-Id: <1537770916-16337-4-git-send-email-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1537770916-16337-1-git-send-email-suganath-prabu.subramani@broadcom.com> References: <1537770916-16337-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 The code for getting shost and IOC is redundant so moved that to function "scsih_get_shost_and_ioc". Also checks for NULL are added to IOC and shost. Signed-off-by: Suganath Prabu S --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 98 ++++++++++++++++++++++++++++++------ 1 file changed, 82 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 566a550..f6e92eb 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -9809,6 +9809,35 @@ _scsih_ir_shutdown(struct MPT3SAS_ADAPTER *ioc) } /** + * _scsih_get_shost_and_ioc - get shost and ioc + * and verify whether they are NULL or not + * @pdev: PCI device struct + * @shost: address of scsi host pointer + * @ioc: address of HBA adapter pointer + * + * Return zero if *shost and *ioc are not NULL otherwise return error number. + */ +static int +_scsih_get_shost_and_ioc(struct pci_dev *pdev, + struct Scsi_Host **shost, struct MPT3SAS_ADAPTER **ioc) +{ + *shost = pci_get_drvdata(pdev); + if (*shost == NULL) { + dev_err(&pdev->dev, "pdev's driver data is null\n"); + return -ENXIO; + } + + *ioc = shost_priv(*shost); + if (*ioc == NULL) { + dev_err(&pdev->dev, "shost's private data is null\n"); + return -ENXIO; + } + + return 0; +} + + +/** * scsih_remove - detach and remove add host * @pdev: PCI device struct * @@ -9816,8 +9845,8 @@ _scsih_ir_shutdown(struct MPT3SAS_ADAPTER *ioc) */ static void scsih_remove(struct pci_dev *pdev) { - struct Scsi_Host *shost = pci_get_drvdata(pdev); - struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); + struct Scsi_Host *shost = NULL; + struct MPT3SAS_ADAPTER *ioc = NULL; struct _sas_port *mpt3sas_port, *next_port; struct _raid_device *raid_device, *next; struct MPT3SAS_TARGET *sas_target_priv_data; @@ -9825,6 +9854,10 @@ static void scsih_remove(struct pci_dev *pdev) struct workqueue_struct *wq; unsigned long flags; + if (_scsih_get_shost_and_ioc(pdev, &shost, &ioc)) { + dev_err(&pdev->dev, "unable to remove device\n"); + return; + } ioc->remove_host = 1; mpt3sas_wait_for_commands_to_complete(ioc); @@ -9898,11 +9931,16 @@ static void scsih_remove(struct pci_dev *pdev) static void scsih_shutdown(struct pci_dev *pdev) { - struct Scsi_Host *shost = pci_get_drvdata(pdev); - struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); + struct Scsi_Host *shost = NULL; + struct MPT3SAS_ADAPTER *ioc = NULL; struct workqueue_struct *wq; unsigned long flags; + if (_scsih_get_shost_and_ioc(pdev, &shost, &ioc)) { + dev_err(&pdev->dev, "unable to shutdown device\n"); + return; + } + ioc->remove_host = 1; mpt3sas_wait_for_commands_to_complete(ioc); @@ -10727,10 +10765,16 @@ out_add_shost_fail: static int scsih_suspend(struct pci_dev *pdev, pm_message_t state) { - struct Scsi_Host *shost = pci_get_drvdata(pdev); - struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); + struct Scsi_Host *shost = NULL; + struct MPT3SAS_ADAPTER *ioc = NULL; pci_power_t device_state; + int rc; + rc = _scsih_get_shost_and_ioc(pdev, &shost, &ioc); + if (rc) { + dev_err(&pdev->dev, "unable to suspend device\n"); + return rc; + } mpt3sas_base_stop_watchdog(ioc); flush_scheduled_work(); scsi_block_requests(shost); @@ -10754,11 +10798,17 @@ scsih_suspend(struct pci_dev *pdev, pm_message_t state) static int scsih_resume(struct pci_dev *pdev) { - struct Scsi_Host *shost = pci_get_drvdata(pdev); - struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); + struct Scsi_Host *shost = NULL; + struct MPT3SAS_ADAPTER *ioc = NULL; pci_power_t device_state = pdev->current_state; int r; + r = _scsih_get_shost_and_ioc(pdev, &shost, &ioc); + if (r) { + dev_err(&pdev->dev, "unable to resume device\n"); + return r; + } + pr_info(MPT3SAS_FMT "pdev=0x%p, slot=%s, previous operating state [D%d]\n", ioc->name, pdev, pci_name(pdev), device_state); @@ -10790,9 +10840,13 @@ scsih_resume(struct pci_dev *pdev) static pci_ers_result_t scsih_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state) { - struct Scsi_Host *shost = pci_get_drvdata(pdev); - struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); + struct Scsi_Host *shost = NULL; + struct MPT3SAS_ADAPTER *ioc = NULL; + if (_scsih_get_shost_and_ioc(pdev, &shost, &ioc)) { + dev_err(&pdev->dev, "device unavailable\n"); + return PCI_ERS_RESULT_DISCONNECT; + } pr_info(MPT3SAS_FMT "PCI error: detected callback, state(%d)!!\n", ioc->name, state); @@ -10827,10 +10881,14 @@ scsih_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state) static pci_ers_result_t scsih_pci_slot_reset(struct pci_dev *pdev) { - struct Scsi_Host *shost = pci_get_drvdata(pdev); - struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); + struct Scsi_Host *shost = NULL; + struct MPT3SAS_ADAPTER *ioc = NULL; int rc; + if (_scsih_get_shost_and_ioc(pdev, &shost, &ioc)) { + dev_err(&pdev->dev, "unable to perform slot reset\n"); + return PCI_ERS_RESULT_DISCONNECT; + } pr_info(MPT3SAS_FMT "PCI error: slot reset callback!!\n", ioc->name); @@ -10863,9 +10921,13 @@ scsih_pci_slot_reset(struct pci_dev *pdev) static void scsih_pci_resume(struct pci_dev *pdev) { - struct Scsi_Host *shost = pci_get_drvdata(pdev); - struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); + struct Scsi_Host *shost = NULL; + struct MPT3SAS_ADAPTER *ioc = NULL; + if (_scsih_get_shost_and_ioc(pdev, &shost, &ioc)) { + dev_err(&pdev->dev, "unable to resume device\n"); + return; + } pr_info(MPT3SAS_FMT "PCI error: resume callback!!\n", ioc->name); pci_cleanup_aer_uncorrect_error_status(pdev); @@ -10880,9 +10942,13 @@ scsih_pci_resume(struct pci_dev *pdev) static pci_ers_result_t scsih_pci_mmio_enabled(struct pci_dev *pdev) { - struct Scsi_Host *shost = pci_get_drvdata(pdev); - struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); + struct Scsi_Host *shost = NULL; + struct MPT3SAS_ADAPTER *ioc = NULL; + if (_scsih_get_shost_and_ioc(pdev, &shost, &ioc)) { + dev_err(&pdev->dev, "unable to enable mmio\n"); + return PCI_ERS_RESULT_DISCONNECT; + } pr_info(MPT3SAS_FMT "PCI error: mmio enabled callback!!\n", ioc->name); From patchwork Mon Sep 24 06:35:14 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: 10611931 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 757AD13A4 for ; Mon, 24 Sep 2018 06:35:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82E552867F for ; Mon, 24 Sep 2018 06:35:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 776E929C7A; Mon, 24 Sep 2018 06:35:39 +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 16C0D2867F for ; Mon, 24 Sep 2018 06:35:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727387AbeIXMgL (ORCPT ); Mon, 24 Sep 2018 08:36:11 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:35929 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727229AbeIXMgL (ORCPT ); Mon, 24 Sep 2018 08:36:11 -0400 Received: by mail-pl1-f193.google.com with SMTP id p5-v6so8680445plk.3 for ; Sun, 23 Sep 2018 23:35:38 -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=0/V5YKy5esTLDrOt7DVdzxfFXSOKSFPF2j7Lhnoe424=; b=U4a7F8EXn0E7WnUpTSrOr2qfyvvMMCUeaxBb/6UBMI5q05jlpimKlnOEHDKoG3tDjH /yb32tfoBGGRsJQgmONHMlK9+6sueWYGAUiwzO10FFtD2jsMPKVYZ8s4M+kO976lT4/+ sN1cujMAE9TrPNBu2QrNgpy48nRQ01GXL7GBA= 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=0/V5YKy5esTLDrOt7DVdzxfFXSOKSFPF2j7Lhnoe424=; b=KdDyqb/pxPf3fx+JR4Iiwsdnf41azaOILLv9hROi0pce8ldHduu1fdje8gqIpdN6Y0 gc3eZl9H1Wh1JHkHEGmEqDjqjSXEW6HFLxNrpncUJOYkKHCnUVozhyWwCbf3lYC0QES3 ZpplICcPpausJEi5XSQ3uoqz0xeeVhTZCdZQLLg56VoyC8Fkm3h8Cfi7eFjktAmZfQbK PCvU1Ly75PBO1VMp4rWKaoiQOkvpnQN94IAeeyl4yGihiVKzeDvv7loyHHqp5R8hErA/ UNtaivuVppGtcACOPk9GiadFRXYwzgzDu0zeN7/aoKJNbcKHKNJFV0xDaZ/Gm4+sYUFD wWkg== X-Gm-Message-State: ABuFfoiQog3PNi8GHxWEY4c57SfBU0xmIxySwhNEjiSezt7ZojocQbuf 5uHIk2IrMIIAXNyLvk3vzf3JE/Snnqg= X-Google-Smtp-Source: ACcGV63Yo/64i2v2ff7Nuu2dWVfS6UZSaq4vSE8RGddTBW6x9GhwOA8cOUMej5RTk4bjwvQ6jOPGWg== X-Received: by 2002:a17:902:4203:: with SMTP id g3-v6mr9280243pld.30.1537770937211; Sun, 23 Sep 2018 23:35:37 -0700 (PDT) Received: from dhcp-10-123-74-106.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 203-v6sm12287064pge.25.2018.09.23.23.35.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Sep 2018 23:35:36 -0700 (PDT) From: Suganath Prabu S To: linux-scsi@vger.kernel.org Cc: Sathya.Prakash@broadcom.com, sreekanth.reddy@broadcom.com, Suganath Prabu S Subject: [PATCH v3 4/6] mpt3sas: Fix Sync cache command failure during driver unload. Date: Mon, 24 Sep 2018 12:05:14 +0530 Message-Id: <1537770916-16337-5-git-send-email-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1537770916-16337-1-git-send-email-suganath-prabu.subramani@broadcom.com> References: <1537770916-16337-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 This is to fix Sync cache and start stop command failures with DID_NO_CONNECT during driver unload. 1) Release drives first from SML, then remove internally in driver. 2) And allow sync cache and Start stop commands to firmware, even when remove_host flag is set v2 Changeset: Replaced this function mpt3sas_base_pci_device_is_unplugged with pci_device_is_present Signed-off-by: Suganath Prabu S --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 41 ++++++++++++++++++++++++++++++-- drivers/scsi/mpt3sas/mpt3sas_transport.c | 7 ++++-- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index f6e92eb..5d15d06 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -3806,6 +3806,43 @@ _scsih_tm_tr_complete(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, return _scsih_check_for_pending_tm(ioc, smid); } +/** _scsih_allow_scmd_to_device - check whether scmd needs to + * issue to IOC or not. + * @ioc: per adapter object + * @scmd: pointer to scsi command object + * + * Returns true if scmd can be issued to IOC otherwise returns false. + */ +inline bool _scsih_allow_scmd_to_device(struct MPT3SAS_ADAPTER *ioc, + struct scsi_cmnd *scmd) +{ + + if (ioc->pci_error_recovery) + return false; + + if (ioc->hba_mpi_version_belonged == MPI2_VERSION) { + if (ioc->remove_host) + return false; + + return true; + } + + + if (ioc->remove_host) { + if (!pci_device_is_present(ioc->pdev)) + return false; + + switch (scmd->cmnd[0]) { + case SYNCHRONIZE_CACHE: + case START_STOP: + return true; + default: + return false; + } + } + + return true; +} /** * _scsih_sas_control_complete - completion routine @@ -4640,7 +4677,7 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd) return 0; } - if (ioc->pci_error_recovery || ioc->remove_host) { + if (!(_scsih_allow_scmd_to_device(ioc, scmd))) { scmd->result = DID_NO_CONNECT << 16; scmd->scsi_done(scmd); return 0; @@ -9874,6 +9911,7 @@ static void scsih_remove(struct pci_dev *pdev) /* release all the volumes */ _scsih_ir_shutdown(ioc); + sas_remove_host(shost); list_for_each_entry_safe(raid_device, next, &ioc->raid_device_list, list) { if (raid_device->starget) { @@ -9916,7 +9954,6 @@ static void scsih_remove(struct pci_dev *pdev) ioc->sas_hba.num_phys = 0; } - sas_remove_host(shost); mpt3sas_base_detach(ioc); spin_lock(&gioc_lock); list_del(&ioc->list); diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c index b10d73e..742da74 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_transport.c +++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c @@ -817,10 +817,13 @@ mpt3sas_transport_port_remove(struct MPT3SAS_ADAPTER *ioc, u64 sas_address, mpt3sas_port->remote_identify.sas_address, mpt3sas_phy->phy_id); mpt3sas_phy->phy_belongs_to_port = 0; - sas_port_delete_phy(mpt3sas_port->port, mpt3sas_phy->phy); + if (!ioc->remove_host) + sas_port_delete_phy(mpt3sas_port->port, + mpt3sas_phy->phy); list_del(&mpt3sas_phy->port_siblings); } - sas_port_delete(mpt3sas_port->port); + if (!ioc->remove_host) + sas_port_delete(mpt3sas_port->port); kfree(mpt3sas_port); } From patchwork Mon Sep 24 06:35:15 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: 10611933 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 11FA713A4 for ; Mon, 24 Sep 2018 06:35:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D05E29B5E for ; Mon, 24 Sep 2018 06:35:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1101D29D36; Mon, 24 Sep 2018 06:35:42 +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 7928529B5E for ; Mon, 24 Sep 2018 06:35:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727430AbeIXMgN (ORCPT ); Mon, 24 Sep 2018 08:36:13 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:41505 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727229AbeIXMgN (ORCPT ); Mon, 24 Sep 2018 08:36:13 -0400 Received: by mail-pl1-f193.google.com with SMTP id b12-v6so8671630plr.8 for ; Sun, 23 Sep 2018 23:35:40 -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=Qub/dioptc5DoD0Ch7SpF0hZ6JxCzX83iDHbCuuetQg=; b=YyuKnl+Tm9VCYZBbS6bzZUUAljRccyHppdSTPNYauDz+Se3mi2RqvpcJxoZH3KgEHY gKx6pdk26lKwC+o9XjQLDtqAvbnxB1jYFPBWnTFYjpdkaC5Bh9jA0/ehaxOjvpP65T7o kf4pEpZumMT64rdzMkOofUZQuBFbH5fQS/yMA= 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=Qub/dioptc5DoD0Ch7SpF0hZ6JxCzX83iDHbCuuetQg=; b=A8gLwE9O+Ovd5xaCRzXnSJca8+lHRRoTdVqoMJoWgQfmIBsxUfeEN+5w9oHzpxJ91t kbxT7ueuJZwRmbwxvfAcxMvkGhq5YT2zw2b34sPEMpp3FczI7V/g5mgVWWxwalFRj/uT QehcRAhC0aZbaEuZtIKMXrBv5REShbd0gfxOy/aKSe/OVW1UeQbfZz1eebB7oJgmHFaP n5Y32fU7ZsAmL0js8S1j6YVLKpPHIcNxxiXTraSheReE7qG7lmVC6OAwx+HybCPKb2h1 T6s0DJvh93ppIEpmaVBGR/xbTH2k/7aLys/gKa1C40FTrmyLxLSe8CRP1GzMuGhDSygo 1umA== X-Gm-Message-State: ABuFfoiwTB/Lvz0LoO9NsTWZhWogDzZrRsfRUvnGI2bRRe3l8F95ewTV VQzHPyeoD78kuRPSdclFa2EOp9f4Bmc= X-Google-Smtp-Source: ACcGV62rNI9qiRSfKrbg/F4RRp2F0T8DgxexwwWxwXaKUs5TdosQvMz1LV5TwB2naEHQipaTuqB+zQ== X-Received: by 2002:a17:902:3fa5:: with SMTP id a34-v6mr9240261pld.244.1537770939780; Sun, 23 Sep 2018 23:35:39 -0700 (PDT) Received: from dhcp-10-123-74-106.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 203-v6sm12287064pge.25.2018.09.23.23.35.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Sep 2018 23:35:38 -0700 (PDT) From: Suganath Prabu S To: linux-scsi@vger.kernel.org Cc: Sathya.Prakash@broadcom.com, sreekanth.reddy@broadcom.com, Suganath Prabu S Subject: [PATCH v3 5/6] mpt3sas: Fix driver modifying NVRAM/persistent data. Date: Mon, 24 Sep 2018 12:05:15 +0530 Message-Id: <1537770916-16337-6-git-send-email-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1537770916-16337-1-git-send-email-suganath-prabu.subramani@broadcom.com> References: <1537770916-16337-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 * If EEDPTagMode field in manufacturing page11 is set, unset it. This is needed to fix a hardware bug in SAS3/SAS2 cards, So, skipping EEDPTagMode changes in Manufacturing page11 for SAS35 controllers. * Fix driver modifying NVRAM/persistent data in Manufacturing page11 along with current copy. Driver should change only current copy of Manufacturing page11 Signed-off-by: Suganath Prabu S --- drivers/scsi/mpt3sas/mpt3sas_base.c | 2 +- drivers/scsi/mpt3sas/mpt3sas_config.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 55e6fd0..87a67fe 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -4122,7 +4122,7 @@ _base_static_config_pages(struct MPT3SAS_ADAPTER *ioc) * flag unset in NVDATA. */ mpt3sas_config_get_manufacturing_pg11(ioc, &mpi_reply, &ioc->manu_pg11); - if (ioc->manu_pg11.EEDPTagMode == 0) { + if ((!ioc->is_gen35_ioc) && (ioc->manu_pg11.EEDPTagMode == 0)) { pr_err("%s: overriding NVDATA EEDPTagMode setting\n", ioc->name); ioc->manu_pg11.EEDPTagMode &= ~0x3; diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c index 5713a2d..f2a326a 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_config.c +++ b/drivers/scsi/mpt3sas/mpt3sas_config.c @@ -676,10 +676,6 @@ mpt3sas_config_set_manufacturing_pg11(struct MPT3SAS_ADAPTER *ioc, r = _config_request(ioc, &mpi_request, mpi_reply, MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page, sizeof(*config_page)); - mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM; - r = _config_request(ioc, &mpi_request, mpi_reply, - MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page, - sizeof(*config_page)); out: return r; } From patchwork Mon Sep 24 06:35:16 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: 10611935 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 2C93114BD for ; Mon, 24 Sep 2018 06:35:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A73029B5E for ; Mon, 24 Sep 2018 06:35:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 26DDE29C98; Mon, 24 Sep 2018 06:35: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 C5D9F29B5E for ; Mon, 24 Sep 2018 06:35:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727480AbeIXMgQ (ORCPT ); Mon, 24 Sep 2018 08:36:16 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:32774 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727229AbeIXMgQ (ORCPT ); Mon, 24 Sep 2018 08:36:16 -0400 Received: by mail-pl1-f196.google.com with SMTP id b97-v6so8694552plb.0 for ; Sun, 23 Sep 2018 23:35:43 -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=r8rw6gqDYpHlvoJp0P0z8qjG62+8NnbzxaNMbNQa04I=; b=UX8Q3UrsJ26ywTcG2Ksd7b3EMsodIhtv8f4IERDCbOl3g4m7B7fAx8rlvFPnDvpRtW QH6sJM4hj7uQgh02eAy/GsR3Eu4FjmgGrvBvkVCvpsbopq4rzmS4Iy1/CDgGrogd/uR5 ZyuCRMXVtYZLh4xkBCi+rDXQ/pWAoTrn1MtBs= 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=r8rw6gqDYpHlvoJp0P0z8qjG62+8NnbzxaNMbNQa04I=; b=ZZq4GB8aYTZs9K09+JXnzLob2dtgU7q0NxsokXXMzLAlS3iDZvBr++lbvsl4OFvcgk q7aMwYzFp+zRjjK5FtrhnKt/7r4b0KGJdjgjCJrAXJsAgY9nL9s/yStdFQaV/zAjeNGB clVUcj4yFNicjPsPfWwNlF5s6nATVvUCZqUhnYb71PEWAPdXUZkGeAyBvIy+chpBFKYt 8xyeEYI+s2xDhPygq++HSPtu2d5g9XkgC4To96Y7XZD8K5FzlSRLG8FD5A5kMrk+C64C DtlcByXVlYmaZyFPjQ+uJKBjJB3LSVnvn18iULPzPUTMAOMjqhX6iPcnUDdsjSEpRryl mz4Q== X-Gm-Message-State: ABuFfoi3E56/a1BAx4PiPJ0Rm/tlhCTSDOvL+/iYakdGumorGZ7emp+g dRvmToMegV6pchDLTiKm8Y5126bIr4o= X-Google-Smtp-Source: ACcGV61gGlnEP8D+uRjT2TanvIRHNakXgCMmcOwlhNI5fEmCPDF9r26OoYv4k/cBH7ykALG4p4kJjg== X-Received: by 2002:a17:902:4324:: with SMTP id i33-v6mr8962205pld.43.1537770942341; Sun, 23 Sep 2018 23:35:42 -0700 (PDT) Received: from dhcp-10-123-74-106.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 203-v6sm12287064pge.25.2018.09.23.23.35.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Sep 2018 23:35:41 -0700 (PDT) From: Suganath Prabu S To: linux-scsi@vger.kernel.org Cc: Sathya.Prakash@broadcom.com, sreekanth.reddy@broadcom.com, Suganath Prabu S Subject: [PATCH v3 6/6] mpt3sas: Bump driver version to 27.100.00.00. Date: Mon, 24 Sep 2018 12:05:16 +0530 Message-Id: <1537770916-16337-7-git-send-email-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1537770916-16337-1-git-send-email-suganath-prabu.subramani@broadcom.com> References: <1537770916-16337-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 Modify driver version to 27.100.00.00 (which is equivalent to PH8 OOB driver) Signed-off-by: Suganath Prabu S --- 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 f0351a2..b880d79 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.h +++ b/drivers/scsi/mpt3sas/mpt3sas_base.h @@ -74,8 +74,8 @@ #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 "26.100.00.00" -#define MPT3SAS_MAJOR_VERSION 26 +#define MPT3SAS_DRIVER_VERSION "27.100.00.00" +#define MPT3SAS_MAJOR_VERSION 27 #define MPT3SAS_MINOR_VERSION 100 #define MPT3SAS_BUILD_VERSION 0 #define MPT3SAS_RELEASE_VERSION 00