From patchwork Tue Apr 24 09:28:37 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: 10359083 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 40B996038F for ; Tue, 24 Apr 2018 09:29:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33D5D28D04 for ; Tue, 24 Apr 2018 09:29:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28CCD28D3B; Tue, 24 Apr 2018 09:29:31 +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 BE73828D04 for ; Tue, 24 Apr 2018 09:29:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753948AbeDXJ3a (ORCPT ); Tue, 24 Apr 2018 05:29:30 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:39021 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753790AbeDXJ3Z (ORCPT ); Tue, 24 Apr 2018 05:29:25 -0400 Received: by mail-qk0-f195.google.com with SMTP id z75so7935986qkb.6 for ; Tue, 24 Apr 2018 02:29:24 -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=rHTDyJTG1l6f088mYOvCw1eKf2s2UO3uG7qJb/P9m3A=; b=h1vV/I2Gayu9CC6zYNObu+R02JQOO8L8AVpxgD2sBf2UL/990n+MMoTvQ1UWvmXXVN 3C3Xw4RNdeJrOH3a1YOK0Ot4VAPkbx1onXoV/Hx7o3JWsrijcLUVo47Zm2lfmuMKAR7t G2AGACan7HeTPV/ig+eqznkK6/EDUao4nnVek= 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=rHTDyJTG1l6f088mYOvCw1eKf2s2UO3uG7qJb/P9m3A=; b=RMYfKQljM6CALfnvwWKMdP7tEGbhEXPtTZ8wwWvpOaej/r/+6ZiOgQT0qBwOAUccWU 4voGHhKI/qWd5iAXwnylCH3RlIO5i9K5UwBn4SLH+BNBPibBoMlGeJdwMFT+YQIMKiE8 BPfaxH1lPcucE+QthF/cOSVoRBWZU3coNSpdWvRT/7AOySANxuiLLGsV2KtT/vVd30nJ +oHXCBbGwtBrLgSW5erqhvNwBcxHifn41VOj2DvPm0uG2qHYH3bRw8RnyA+nTcKkS77F jRwhhLrAjaG5xgdwhVvJudK5Qmqo5Ys5weFjtuRl7+nZ210UBy2oLNalk2eNtmxgMPjv fdyQ== X-Gm-Message-State: ALQs6tDWPoIzHxyGeTkEh/NQTB2q15adZLsBXr+R9g9vwSrH9a1t6gjS BXDIHLU/awymc3VDK/PGmBpFHdR8a+o= X-Google-Smtp-Source: AIpwx4+sN2a2UGprDs/AFwL+IDl43LBrOpvJOG8MiP3SYUtx5wC/K76wq/ciPIxEOsuJDj5wa1w0XA== X-Received: by 10.55.0.144 with SMTP id t16mr24893444qkg.306.1524562164011; Tue, 24 Apr 2018 02:29:24 -0700 (PDT) Received: from localhost.localdomain.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 96sm12615184qkx.71.2018.04.24.02.29.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 02:29:23 -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 v3 08/14] mpt3sas: Allow processing of events during driver unload. Date: Tue, 24 Apr 2018 05:28:37 -0400 Message-Id: <1524562123-33229-9-git-send-email-chaitra.basappa@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1524562123-33229-1-git-send-email-chaitra.basappa@broadcom.com> References: <1524562123-33229-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 796bf33..33587a8 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)); @@ -9468,8 +9462,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);