[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1370579036.4021.68.camel@deadeye.wl.decadent.org.uk>
Date: Fri, 07 Jun 2013 05:23:56 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: Willy Tarreau <w@....eu>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [ 061/184] PCI/PM: Clean up PME state when removing a device
On Tue, 2013-06-04 at 19:22 +0200, Willy Tarreau wrote:
> 2.6.32-longterm review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: "Rafael J. Wysocki" <rjw@...k.pl>
>
> commit 249bfb83cf8ba658955f0245ac3981d941f746ee upstream.
>
> Devices are added to pci_pme_list when drivers use pci_enable_wake()
> or pci_wake_from_d3(), but they aren't removed from the list unless
> the driver explicitly disables wakeup. Many drivers never disable
> wakeup, so their devices remain on the list even after they are
> removed, e.g., via hotplug. A subsequent PME poll will oops when
> it tries to touch the device.
>
> This patch disables PME# on a device before removing it, which removes
> the device from pci_pme_list. This is safe even if the device never
> had PME# enabled.
There's no such list in 2.6.32, so I don't think this is needed.
Ben.
> This oops can be triggered by unplugging a Thunderbolt ethernet adapter
> on a Macbook Pro, as reported by Daniel below.
>
> [bhelgaas: changelog]
> Reference: http://lkml.kernel.org/r/CAMVG2svG21yiM1wkH4_2pen2n+cr2-Zv7TbH3Gj+8MwevZjDbw@mail.gmail.com
> Reported-and-tested-by: Daniel J Blueman <daniel@...ra.org>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Signed-off-by: Willy Tarreau <w@....eu>
> ---
> drivers/pci/remove.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
> index 176615e..27ae1f9 100644
> --- a/drivers/pci/remove.c
> +++ b/drivers/pci/remove.c
> @@ -19,6 +19,8 @@ static void pci_free_resources(struct pci_dev *dev)
>
> static void pci_stop_dev(struct pci_dev *dev)
> {
> + pci_pme_active(dev, false);
> +
> if (dev->is_added) {
> pci_proc_detach_device(dev);
> pci_remove_sysfs_dev_files(dev);
--
Ben Hutchings
Theory and practice are closer in theory than in practice.
- John Levine, moderator of comp.compilers
Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)
Powered by blists - more mailing lists