From patchwork Tue May 22 17:58:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10419309 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 498BD60224 for ; Tue, 22 May 2018 18:00:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 396E128F42 for ; Tue, 22 May 2018 18:00:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3800428FAC; Tue, 22 May 2018 18:00: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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AB70328F42 for ; Tue, 22 May 2018 18:00:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=lCJSlCqRgZLgYLv8omI7i0BsgfPrGrrP4etIk2QFe8o=; b=GclpcM+gvHa2Zw ktR8zJUjVQGYv9KBXV7tnaGjl7DJEN5KiZA1dT404gKJp6ziUZ1ApRU7RmpTXCePFj8OtS6j9OA8E QoTkLW8wF+TIEZNkcTeuRD0H9LeADs/PQeiUFA6QEqVpCcq1wbMFiSrMR6AlSeaQ4cVDZ9LKeKSM4 zJX8i+XkupdIr7+GSeIKi0dfCDM8HXEmtxAMt4l5I1TZbg7tYmYLE/s0dfwsRT1Nw4rGVotOrM/mQ PSWAPsFG9p6n0CgL1Ubd4N75pXacrT6YfFWuGehJGQG3GM59jMrBmsi3bMqJiqqcRQR8BPSjTy+5L TxaKMHdk1d+iq8BWwJPg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLBaP-00076K-Qt; Tue, 22 May 2018 18:00:37 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLBYU-0004vN-TQ for linux-arm-kernel@lists.infradead.org; Tue, 22 May 2018 17:58:48 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id EE82460C65; Tue, 22 May 2018 17:58:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527011907; bh=+4Z+JhWRFyzm7ComnweVCXUSk4ID/A68UaCXPp9xm1g=; h=From:To:Cc:Subject:Date:From; b=nymtImTkm1IjUhCZ+XTYybg2CJv6VkDuLYglouAdmqEpQm3xLUQRkdbv8uXpfXkWN NSkdZNJAoDevIMyFWmdlInHfLYQ4jjTA6BrNONfOfID7of8ZpTOPEfK2ehtN9lpqwj aYr2XHWknF/NRKU/TM18F0C3rTJJi6jVv/HRoM7U= Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 74E4760314; Tue, 22 May 2018 17:58:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527011906; bh=+4Z+JhWRFyzm7ComnweVCXUSk4ID/A68UaCXPp9xm1g=; h=From:To:Cc:Subject:Date:From; b=fS4158Ga0WpWeZRLK9Ugx+MTtjmEznz/lHJuaJKIg3mk+QPn1fqmJNtk/1gS72d0g sP2p1sbPtvll/unXU9upxv44kXQiOiB6xHmEY2jIwItMWK1j5rfYMgxJYMenGRSugS 7fFG2fr6By47BkhfZojADC2jdsnxAVVRpcefRSp0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 74E4760314 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: linux-pci@vger.kernel.org, timur@codeaurora.org Subject: [PATCH] PCI/portdrv: do not disable device on remove() Date: Tue, 22 May 2018 13:58:00 -0400 Message-Id: <1527011883-21320-1-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180522_105839_021981_A83A74CB X-CRM114-Status: GOOD ( 11.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ryan@finnie.org, Keith Busch , Gabriele Paoloni , Frederick Lawler , linux-arm-msm@vger.kernel.org, "Rafael J. Wysocki" , open list , stable@vger.kernel.org, Sinan Kaya , Dongdong Liu , Bjorn Helgaas , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 'Commit cc27b735ad3a ("PCI/portdrv: Turn off PCIe services during shutdown")' has been added to kernel to shutdown pending PCIe port service interrupts during reboot so that a newly started kexec kernel wouldn't observe pending interrupts. pcie_port_device_remove() is disabling the root port and switches by calling pci_disable_device() after all PCIe service drivers are shutdown. pci_disable_device() has a much wider impact then port service itself and it prevents all inbound transactions to reach to the system and impacts the entire PCI traffic behind the bridge. Issue is that pcie_port_device_remove() doesn't maintain any coordination with the rest of the PCI device drivers in the system before clearing the bus master bit. This has been found to cause crashes on HP DL360 Gen9 machines during reboot. Besides, kexec is already clearing the bus master bit in pci_device_shutdown() after all PCI drivers are removed. Just remove the extra clear here. Signed-off-by: Sinan Kaya Link: https://bugzilla.kernel.org/show_bug.cgi?id=199779 Fixes: cc27b735ad3a ("PCI/portdrv: Turn off PCIe services during shutdown") Cc: stable@vger.kernel.org Reported-by: Ryan Finnie Tested-by: Ryan Finnie --- drivers/pci/pcie/portdrv_core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index c9c0663..d22a95d 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -409,7 +409,6 @@ void pcie_port_device_remove(struct pci_dev *dev) { device_for_each_child(&dev->dev, NULL, remove_iter); pci_free_irq_vectors(dev); - pci_disable_device(dev); } /**