From patchwork Mon Jun 11 22:29:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 10458927 X-Patchwork-Delegate: bhelgaas@google.com 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 B8C99602C8 for ; Mon, 11 Jun 2018 22:26:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91DBD285E0 for ; Mon, 11 Jun 2018 22:26:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84736285EA; Mon, 11 Jun 2018 22:26:28 +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.9 required=2.0 tests=BAYES_00, 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 10E13285E0 for ; Mon, 11 Jun 2018 22:26:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752641AbeFKW00 (ORCPT ); Mon, 11 Jun 2018 18:26:26 -0400 Received: from mga07.intel.com ([134.134.136.100]:21422 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751234AbeFKW00 (ORCPT ); Mon, 11 Jun 2018 18:26:26 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jun 2018 15:26:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,212,1526367600"; d="scan'208";a="62301660" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.44]) by fmsmga004.fm.intel.com with ESMTP; 11 Jun 2018 15:26:24 -0700 From: Keith Busch To: Linux PCI , Bjorn Helgaas Cc: Keith Busch , Oza Pawandeep Subject: [PATCH] PCI/AER: Prevent runtime power management during recovery Date: Mon, 11 Jun 2018 16:29:18 -0600 Message-Id: <20180611222918.1708-1-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A bridge that supports D3 but not hotplug will be subject to runtime power management placing it in a non-operation power state if it doesn't have any devices attached. This patch will prevent this power management during error recovery so that the rescan at the end may be successful. Cc: Oza Pawandeep Signed-off-by: Keith Busch Reviewed-by: Oza Pawandeep --- drivers/pci/pcie/err.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c index f7ce0cb0b0b7..247b6ce14f0d 100644 --- a/drivers/pci/pcie/err.c +++ b/drivers/pci/pcie/err.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "portdrv.h" #include "../pci.h" @@ -294,6 +295,7 @@ void pcie_do_fatal_recovery(struct pci_dev *dev, u32 service) udev = dev->bus->self; parent = udev->subordinate; + pm_runtime_forbid(&udev->dev); pci_lock_rescan_remove(); list_for_each_entry_safe_reverse(pdev, temp, &parent->devices, bus_list) { @@ -329,6 +331,7 @@ void pcie_do_fatal_recovery(struct pci_dev *dev, u32 service) } pci_unlock_rescan_remove(); + pm_runtime_allow(&udev->dev); } /**