From patchwork Fri Jan 26 19:22:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 10186899 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 9FF3E601D5 for ; Fri, 26 Jan 2018 19:23:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92BF028C2A for ; Fri, 26 Jan 2018 19:23:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87AFD29DC6; Fri, 26 Jan 2018 19:23:03 +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, FREEMAIL_FROM, 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 3426A28C2A for ; Fri, 26 Jan 2018 19:23:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752678AbeAZTXC (ORCPT ); Fri, 26 Jan 2018 14:23:02 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:39714 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752508AbeAZTW6 (ORCPT ); Fri, 26 Jan 2018 14:22:58 -0500 Received: by mail-qt0-f194.google.com with SMTP id f4so3954252qtj.6 for ; Fri, 26 Jan 2018 11:22:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mDk1F3iBVR2/G8Grt3kuStaFQ+mWovv/J+FHY+pn7Gs=; b=hAochbAyba9bbm/XUw9tRkHzWvDGBzNnTwUxD8mHmhaJbN69hlXfhymHvrfhFQX2jh FDSsYNUyooed5RroVMK3K8AIfXqF00Y3fqnQWir4A+nsVoJR/vYoaw8tPQOubS/U0hrP 9Huk13Kzj+R0pVHdmEJnHSYvsGsZp0t20I6Kufu5/kcAmlQFvX39Dp3nSB+2kEJi3Ss3 3uX34e/m7LNw3RUWjQfKkfcLWCL8cLPWeFskX/pZkfrxm3S2EOhMstywLWcHIsPvpzEr w1HWFQ9KJv5JvAKyrUhkBWkFZnRMBVzm4RRmMI6XNBWjvhRrbKz9NNN8NNmQgN4CrF7m O4xg== 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=mDk1F3iBVR2/G8Grt3kuStaFQ+mWovv/J+FHY+pn7Gs=; b=YSJGzv/l21c57jWAJMI6KpGCurMioTzEENzd8m8OpNlHvmFvhS2di60qFxymqEgqh/ 3EMEm3nAlsNdV9M6ZqdeXJHMASv4BzzhaRIdoeKsFlZIaTHuRTxJb5Cn7NgO4qIG4isO ljunaLTTfb7sDwwcpRU5to66CrXA/g1RMGxZgvImdSbKao5xUW4ARoIVWfcksJf/wAfn g+Za8jDhyIDJ+faMUVt4KHxrWquHHNuo/DbD3gyxWxhHdCnMhd+UoLY6cAMR6KmnOJwn d4y+Iyr90rJYtmB3GckIT1QOtO9zArK+2WVkzOcLX/KMkYRQYu+SLPsoi3XIfWa3+py6 Ny/g== X-Gm-Message-State: AKwxytdxoWHE0f6l/rPOCHDZBDeSrJhn+1Vw4+kh4OJmIfWKKLGGHz52 EU6J8FCaklkzpisJILvY+RDVfQ== X-Google-Smtp-Source: AH8x2263I/0Qa3cWsZe6j+PEssafzl/uaA79C6Ii4nU6qgoLzVKKEVtU+PF6FXz6N5zk8Wvor6Bbfw== X-Received: by 10.55.41.20 with SMTP id p20mr21508631qkh.5.1516994577777; Fri, 26 Jan 2018 11:22:57 -0800 (PST) Received: from pallmd1.broadcom.com ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id f129sm3811300qke.82.2018.01.26.11.22.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Jan 2018 11:22:57 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH v2 03/19] lpfc: move placement of target destroy on driver detach Date: Fri, 26 Jan 2018 11:22:23 -0800 Message-Id: <20180126192239.10727-4-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20180126192239.10727-1-jsmart2021@gmail.com> References: <20180126192239.10727-1-jsmart2021@gmail.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 Ensure nvme localports/targetports are torn down before dismantling the adapter sli interface on driver detachment. This aids leaving interfaces live while nvme may be making callbacks to abort it. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_init.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 5b96bf0d3331..851d4e889042 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -11503,13 +11503,6 @@ lpfc_pci_remove_one_s4(struct pci_dev *pdev) /* Remove FC host and then SCSI host with the physical port */ fc_remove_host(shost); scsi_remove_host(shost); - /* - * Bring down the SLI Layer. This step disables all interrupts, - * clears the rings, discards all mailbox commands, and resets - * the HBA FCoE function. - */ - lpfc_debugfs_terminate(vport); - lpfc_sli4_hba_unset(phba); /* Perform ndlp cleanup on the physical port. The nvme and nvmet * localports are destroyed after to cleanup all transport memory. @@ -11518,6 +11511,13 @@ lpfc_pci_remove_one_s4(struct pci_dev *pdev) lpfc_nvmet_destroy_targetport(phba); lpfc_nvme_destroy_localport(vport); + /* + * Bring down the SLI Layer. This step disables all interrupts, + * clears the rings, discards all mailbox commands, and resets + * the HBA FCoE function. + */ + lpfc_debugfs_terminate(vport); + lpfc_sli4_hba_unset(phba); lpfc_stop_hba_timers(phba); spin_lock_irq(&phba->hbalock);