From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 18 Sep 2018 16:38:13 -0500 From: Bjorn Helgaas To: Mika Westerberg Cc: Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown , Lukas Wunner , Keith Busch , Ashok Raj , Mario.Limonciello@dell.com, Anthony Wong , Linus Walleij , Sakari Ailus , linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH RESEND v2 01/10] PCI: Do not skip power managed bridges in pci_enable_wake() Message-ID: <20180918213813.GF13616@bhelgaas-glaptop.roam.corp.google.com> References: <153688100.j3IOAyprJL@aspire.rjw.lan> <20180914083134.27217-1-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20180914083134.27217-1-mika.westerberg@linux.intel.com> Sender: linux-acpi-owner@vger.kernel.org List-ID: On Fri, Sep 14, 2018 at 11:31:34AM +0300, Mika Westerberg wrote: > Commit baecc470d5fd ("PCI / PM: Skip bridges in pci_enable_wake()") > changed pci_enable_wake() so that all bridges are skipped when wakeup is > enabled (or disabled) with the reasoning that bridges can only signal > wakeup on behalf of their subordinate devices. > > However, there are bridges that can signal wakeup itself. For example > PCIe downstream and root ports supporting hotplug may signal wakeup upon > hotplug event. > > For this reason change pci_enable_wake() so that it skips all bridges > except those that we power manage (->bridge_d3 is set). Those are the > ones that can go into low power states and may need to signal wakeup. > > Signed-off-by: Mika Westerberg > Reviewed-by: Rafael J. Wysocki Applied to pci/enumeration for v4.20, thanks! > --- > Resending this because for some reason it did not hit the mailing lists. > Added tag from Rafael as well. > > drivers/pci/pci.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > index 29ff9619b5fa..1af6f1887986 100644 > --- a/drivers/pci/pci.c > +++ b/drivers/pci/pci.c > @@ -2133,10 +2133,13 @@ static int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable > int ret = 0; > > /* > - * Bridges can only signal wakeup on behalf of subordinate devices, > - * but that is set up elsewhere, so skip them. > + * Bridges that are not power-manageable directly only signal > + * wakeup on behalf of subordinate devices which is set up > + * elsewhere, so skip them. However, bridges that are > + * power-manageable may signal wakeup for themselves (for example, > + * on a hotplug event) and they need to be covered here. > */ > - if (pci_has_subordinate(dev)) > + if (!pci_power_manageable(dev)) > return 0; > > /* Don't do the same thing twice in a row for one device. */ > -- > 2.18.0 >