From: Bjorn Helgaas <helgaas@kernel.org>
To: Lukas Wunner <lukas@wunner.de>
Cc: linux-pci@vger.kernel.org,
Mika Westerberg <mika.westerberg@linux.intel.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH] PCI: Fix bridge_d3 update on device removal
Date: Tue, 13 Sep 2016 16:02:31 -0500 [thread overview]
Message-ID: <20160913210231.GG4138@localhost> (raw)
In-Reply-To: <9bc855a01d0f29cc8425cf50dce9812062309cfb.1473135221.git.lukas@wunner.de>
On Tue, Sep 06, 2016 at 06:20:46AM +0200, Lukas Wunner wrote:
> Starting with v4.8, we allow a PCIe port to runtime suspend to D3hot if
> the port itself and its children satisfy a number of conditions. Once a
> child is removed, we recheck those conditions in case the removed device
> was blocking the port from suspending.
>
> The rechecking needs to happen *after* the device has been removed from
> the bus it resides on. Otherwise when walking the port's subordinate
> bus in pci_bridge_d3_update(), the device being removed would
> erroneously still be taken into account.
>
> However the device is removed from the bus_list in pci_destroy_dev() and
> we currently recheck *before* that. Fix it.
>
> Fixes: 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend")
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
9d26d3a8f1b0 appeared in v4.8-rc1, so I assume this fix should be merged
before v4.8, right?
I applied it to for-linus with Mika's reviewed-by and Rafael's acked-by on
that assumption.
> ---
> drivers/pci/remove.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
> index d1ef7ac..f9357e0 100644
> --- a/drivers/pci/remove.c
> +++ b/drivers/pci/remove.c
> @@ -40,6 +40,7 @@ static void pci_destroy_dev(struct pci_dev *dev)
> list_del(&dev->bus_list);
> up_write(&pci_bus_sem);
>
> + pci_bridge_d3_device_removed(dev);
> pci_free_resources(dev);
> put_device(&dev->dev);
> }
> @@ -96,8 +97,6 @@ static void pci_remove_bus_device(struct pci_dev *dev)
> dev->subordinate = NULL;
> }
>
> - pci_bridge_d3_device_removed(dev);
> -
> pci_destroy_dev(dev);
> }
>
> --
> 2.9.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-09-13 21:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-06 4:20 [PATCH] PCI: Fix bridge_d3 update on device removal Lukas Wunner
2016-09-07 15:47 ` Mika Westerberg
2016-09-07 16:07 ` Rafael J. Wysocki
2016-09-13 21:02 ` Bjorn Helgaas [this message]
2016-09-13 21:03 ` Rafael J. Wysocki
2016-09-13 21:13 ` Lukas Wunner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160913210231.GG4138@localhost \
--to=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=mika.westerberg@linux.intel.com \
--cc=rafael.j.wysocki@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox