mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Tejun Heo <tj@kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linux PCI <linux-pci@vger.kernel.org>
Subject: Re: [PATCH] PCI: Move device_del() from pci_stop_dev() to pci_destroy_dev()
Date: Mon, 25 Nov 2013 23:19:03 +0100	[thread overview]
Message-ID: <2101601.XbDHenBU6p@vostro.rjw.lan> (raw)
In-Reply-To: <CAErSpo7LOVoSzOO1DbAhU6naq8YXKEd4A=Ls7DbaEt9jX8SBDg@mail.gmail.com>

On Monday, November 25, 2013 02:59:44 PM Bjorn Helgaas wrote:
> On Sat, Nov 23, 2013 at 5:17 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >
> > After commit bcdde7e221a8 (sysfs: make __sysfs_remove_dir() recursive)
> > I'm seeing traces analogous to the one below in Thunderbolt testing:

[...]

> > (Mika Westerberg sees them too in his tests).
> >
> > Some investigation documented in kernel bug #65281 lead me to the
> > conclusion that the source of the problem is the device_del() in
> > pci_stop_dev() as it now causes the sysfs directory of the device
> > to be removed recursively along with all of its subdirectories.
> > That includes the sysfs directory of the device's subordinate
> > bus (dev->subordinate) and its "power" group.
> >
> > Consequently, when pci_remove_bus() is called for dev->subordinate
> > in pci_remove_bus_device(), it calls device_unregister(&bus->dev),
> > but at this point the sysfs directory of bus->dev doesn't exist any
> > more and its "power" group doesn't exist either.  Thus, when
> > dpm_sysfs_remove() called from device_del() tries to remove that
> > group, it triggers the above warning.
> >
> > That indicates a logical mistake in the design of
> > pci_stop_and_remove_bus_device(), which causes bus device objects
> > to be left behind their parents (bridge device objects) and can be
> > fixed by moving the device_del() from pci_stop_dev() into
> > pci_destroy_dev(), so pci_remove_bus() can be called for the
> > device's subordinate bus before the device itself is unregistered
> > from the hierarchy.  Still, the driver, if any, should be detached
> > from the device in pci_stop_dev(), so use device_release_driver()
> > directly from there.
> >
> > References: https://bugzilla.kernel.org/show_bug.cgi?id=65281#c6
> > Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Applied to for-linus for v3.13.  Thanks a lot for all your work on this issue!

Thanks, and no problem! :-)

Rafael


  reply	other threads:[~2013-11-25 22:06 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-19 13:09 [PATCH] sysfs: handle duplicate removal attempts in sysfs_remove_group() Mika Westerberg
2013-11-19 13:28 ` Rafael J. Wysocki
2013-11-20  6:18 ` Tejun Heo
2013-11-20  9:56   ` [PATCH v2] " Mika Westerberg
2013-11-22 15:43   ` [PATCH] " Bjorn Helgaas
2013-11-22 16:02     ` Tejun Heo
2013-11-25 10:29       ` James Bottomley
2013-11-25 12:43         ` Rafael J. Wysocki
2013-11-22 22:43     ` Rafael J. Wysocki
2013-11-23 22:56     ` Rafael J. Wysocki
2013-11-23 22:53       ` Greg Kroah-Hartman
2013-11-23 23:12         ` Rafael J. Wysocki
2013-11-23 23:07           ` Greg Kroah-Hartman
2013-11-23 23:36             ` Rafael J. Wysocki
2013-11-24  1:09               ` Rafael J. Wysocki
2013-11-24 15:05                 ` Tejun Heo
2013-11-25 10:11                 ` Mika Westerberg
2013-11-25 10:41                   ` Rafael J. Wysocki
2013-11-25 23:51                     ` Gwendal Grignou
2013-11-25 12:19                   ` [PATCH] ATA: Fix port removal ordering Rafael J. Wysocki
2013-11-27  1:58                     ` Rafael J. Wysocki
2013-11-27  4:34                     ` Jingoo Han
2013-11-27 18:56                     ` Tejun Heo
2013-11-24  0:17             ` [PATCH] PCI: Move device_del() from pci_stop_dev() to pci_destroy_dev() Rafael J. Wysocki
2013-11-25  4:54               ` Yinghai Lu
2013-11-25  4:58                 ` Yinghai Lu
2013-11-25 11:23                   ` Rafael J. Wysocki
2013-11-25 19:48                     ` Yinghai Lu
2013-11-25 11:22                 ` Rafael J. Wysocki
2013-11-25 19:45                   ` Yinghai Lu
2013-11-25 20:57                     ` Rafael J. Wysocki
2013-11-25  9:47               ` Mika Westerberg
2013-11-25 11:24                 ` Rafael J. Wysocki
2013-11-25 21:59               ` Bjorn Helgaas
2013-11-25 22:19                 ` Rafael J. Wysocki [this message]
2013-11-28  0:41                 ` Jingoo Han

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=2101601.XbDHenBU6p@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=bhelgaas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=tj@kernel.org \
    /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

all inboxes | Powered by JetHome®