From patchwork Thu Apr 5 15:46:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitra P B X-Patchwork-Id: 10324837 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 841BE600CB for ; Thu, 5 Apr 2018 15:47:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7496E206AF for ; Thu, 5 Apr 2018 15:47:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6939227EED; Thu, 5 Apr 2018 15:47: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=-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 D849B206AF for ; Thu, 5 Apr 2018 15:47:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751558AbeDEPrj (ORCPT ); Thu, 5 Apr 2018 11:47:39 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:40951 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751535AbeDEPrh (ORCPT ); Thu, 5 Apr 2018 11:47:37 -0400 Received: by mail-wm0-f68.google.com with SMTP id x4so8393620wmh.5 for ; Thu, 05 Apr 2018 08:47:37 -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=OpKdpUA11QE8vcxVj+SBwU8H+RGUnxnN3LE8MJb0gBQ=; b=RVtYzdW8LytUWqA8Wh8MRYVlsdk2G96C0BIbYwgDpDLl8I6s1/XAWpuUGHAmtzvAzP 0GmZaV1wmCvmqm34mqgrOdHvmpqVol+kTJvmcbJ8VWus+/+lVSas5q3ASefMsemlVnV2 OYlNbm0JDj7XaL7iysjCFDi8AvdsQYUBLIlPg= 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=OpKdpUA11QE8vcxVj+SBwU8H+RGUnxnN3LE8MJb0gBQ=; b=VwtpUG0xXFqEGGs1IKmazOTNrhGkYM7U5L8Cj14cHb/BUM+bZ/zEgtjAiLTWoeSEuT 9dS/gqCJ54SIgYOYdj8u0aqPGmidHQBjfqLeWGdndnMfqtutixUHFi9ZPNI0g8jXyATJ hx2wMKuAy3Mr9dvX3jfalgVykGAjc4HBciyPNwvH+ZXshAElquW992D7mL3WTvPc5tnM cG7PBNvE0Dh46zViWqJaubGgg6OlZ/7D+BDNDj/xJ2nuOGl2KFIjrgWeS1HWW9GflRvN enQ81l9qMWT3QQY/Xxd95jFQO3XWScSl3+YlS7aWWUisIzoJItbGToijGsDTGZBdOrfc zANQ== X-Gm-Message-State: ALQs6tDXfIJ7YZjCYVm1GoHxwCrMkWBbfnjUThTKnkCdDYVM+vpOs2eQ y6+2Pf7bBKsO3FsWtteqDFRTEedW X-Google-Smtp-Source: AIpwx48BCvYqxO4FBdjffCnW1exSLaDACQOl+u98JiAffboLE5c38Z69u1RExqyR4RgsJg14a1slVg== X-Received: by 10.80.134.120 with SMTP id 53mr3500180edt.187.1522943256081; Thu, 05 Apr 2018 08:47:36 -0700 (PDT) Received: from localhost.localdomain.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id p91sm4745777edp.65.2018.04.05.08.47.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Apr 2018 08:47:35 -0700 (PDT) From: Chaitra P B To: linux-scsi@vger.kernel.org Cc: Sathya.Prakash@broadcom.com, sreekanth.reddy@broadcom.com, suganath-prabu.subramani@broadcom.com, Chaitra P B Subject: [PATCH v1 09/15] mpt3sas: Allow processing of events during driver unload. Date: Thu, 5 Apr 2018 11:46:31 -0400 Message-Id: <1522943197-5408-10-git-send-email-chaitra.basappa@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1522943197-5408-1-git-send-email-chaitra.basappa@broadcom.com> References: <1522943197-5408-1-git-send-email-chaitra.basappa@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 Events were not processed during driver unload, hence unloading of driver doesn't complete when drives are disconnected while unloading of driver. So don't block events in ISR path, i,e., remove the flag ioc->remove_host so that events are getting processed during driver unload. Thus allowing driver unload to complete by processing drive removal events during driver unload. Signed-off-by: Chaitra P B Signed-off-by: Suganath Prabu S --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 0e06d19..f6861a6 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -3677,11 +3677,7 @@ _scsih_tm_tr_complete(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 ioc_state; struct _sc_list *delayed_sc; - if (ioc->remove_host) { - dewtprintk(ioc, pr_info(MPT3SAS_FMT - "%s: host has been removed\n", __func__, ioc->name)); - return 1; - } else if (ioc->pci_error_recovery) { + if (ioc->pci_error_recovery) { dewtprintk(ioc, pr_info(MPT3SAS_FMT "%s: host in pci error recovery\n", __func__, ioc->name)); @@ -3803,8 +3799,7 @@ _scsih_tm_tr_volume_send(struct MPT3SAS_ADAPTER *ioc, u16 handle) u16 smid; struct _tr_list *delayed_tr; - if (ioc->shost_recovery || ioc->remove_host || - ioc->pci_error_recovery) { + if (ioc->pci_error_recovery) { dewtprintk(ioc, pr_info(MPT3SAS_FMT "%s: host reset in progress!\n", __func__, ioc->name)); @@ -3857,8 +3852,7 @@ _scsih_tm_volume_tr_complete(struct MPT3SAS_ADAPTER *ioc, u16 smid, Mpi2SCSITaskManagementReply_t *mpi_reply = mpt3sas_base_get_reply_virt_addr(ioc, reply); - if (ioc->shost_recovery || ioc->remove_host || - ioc->pci_error_recovery) { + if (ioc->shost_recovery || ioc->pci_error_recovery) { dewtprintk(ioc, pr_info(MPT3SAS_FMT "%s: host reset in progress!\n", __func__, ioc->name)); @@ -9475,8 +9469,8 @@ mpt3sas_scsih_event_callback(struct MPT3SAS_ADAPTER *ioc, u8 msix_index, u16 sz; Mpi26EventDataActiveCableExcept_t *ActiveCableEventData; - /* events turned off due to host reset or driver unloading */ - if (ioc->remove_host || ioc->pci_error_recovery) + /* events turned off due to host reset */ + if (ioc->pci_error_recovery) return 1; mpi_reply = mpt3sas_base_get_reply_virt_addr(ioc, reply);