From patchwork Mon Apr 9 10:04:55 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: 10330953 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 114666053B for ; Mon, 9 Apr 2018 10:05:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B93A28897 for ; Mon, 9 Apr 2018 10:05:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F192427816; Mon, 9 Apr 2018 10:05: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 68FD427816 for ; Mon, 9 Apr 2018 10:05:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751702AbeDIKFl (ORCPT ); Mon, 9 Apr 2018 06:05:41 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:46375 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751608AbeDIKFl (ORCPT ); Mon, 9 Apr 2018 06:05:41 -0400 Received: by mail-qt0-f196.google.com with SMTP id h4so8465484qtn.13 for ; Mon, 09 Apr 2018 03:05:41 -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=IY86R2Iqf4V65AL9fEE+y5fS00CrizY6mK9/r5FCLe+i5QJ7nzOg3op2VLCGZ1An4R KQMTQQ/F/t+cdroUg6NvnSD7GpzaU44r69mlARFUEY3JXOpqWQPSjzB31w98gG9nEvwV OGx3orbXruTgk44yDMy7m4oX8lCm1xAl7LE/8= 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=U/D4ZGO3n6LcQVEHwA6JekJokN3xxO4lt2sxwaVIHSy94x6rNM8L6nhAAoDa8WMovY hrZgilfq1dr8G8ULCpCfJJwtMiIIISl7UjsuMNDZm2Gm7jrnLO2Fp9kWQATa0BZ/k0KI 02nlHvxsV+u31Uu20IuwLFFH/+Lc6Z7aNF6YdTiU9BLUYAjwAwk/FBabBeSp8TJBTfuz EZZwKQOYhaT8lRUKtIr952b5vnEm8twpU9YOvbmYZxqLdbvC+oRXv9doaY75mxOmNEyx lcHYs5/WXLT1f55dHJTGztgcLyP1HbQUKCQ9jz08uCemDBBowdbrm2Fht7vIHB3H4M7M wuMg== X-Gm-Message-State: ALQs6tBaP9RDvzaLlPD3FtY5uuqY3q2cb4QnbgfBMg1Fd0AHNkVN+4I2 TBz6Pvv9GZUoooCpuegcXuTKuAcFBH0= X-Google-Smtp-Source: AIpwx49Nk7D9ikmA+Qmok/Z7ATNhQoRp0FMSfT3rsPhmZwBECyofyfT861eFz1Y1dgJVxzCiF3ufww== X-Received: by 10.200.67.78 with SMTP id a14mr50990243qtn.18.1523268340347; Mon, 09 Apr 2018 03:05:40 -0700 (PDT) Received: from localhost.localdomain.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l52sm13856884qtc.45.2018.04.09.03.05.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 03:05:39 -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 v2 08/14] mpt3sas: Allow processing of events during driver unload. Date: Mon, 9 Apr 2018 06:04:55 -0400 Message-Id: <1523268301-14453-9-git-send-email-chaitra.basappa@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1523268301-14453-1-git-send-email-chaitra.basappa@broadcom.com> References: <1523268301-14453-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);