lkml.org 
[lkml]   [2009]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 08/12] PCI: Introduce /sys/bus/pci/devices/.../remove
* Trent Piepho <xyzzy@speakeasy.org>:
> On Thu, 19 Mar 2009, Alex Chiang wrote:
> > * Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>:
> > >> + pci_remove_bus_device(pdev);
> > >> + if (bridge && list_empty(&pdev->bus->devices))
> > >> + pci_remove_bus(pdev->bus);
> > >
> > > I cannot understand the above two lines. Could you explain
> > > what it intend?
> >
> > If the user says:
> >
> > echo 1 > /sys/bus/pci/devices/.../remove
> >
> > And that device is a bridge, then we need to specifically call
> > pci_remove_bus as well, to actually remove the bus itself.
> > Without it, pci_bus_remove_device() will remove all of its
> > children (and subordinate buses) in a depth-first manner, but we
> > will never actually remove the bus that the user specified.
>
> Did this end up being the source of the pci resource assignment warnings
> that were produced when re-adding a bridge that was removed?

I think that was one reason. I found that it was necessary during
multiple remove/rescan cycles; after the 2nd rescan, we had a
stale pci_bus hanging around that was manifesting itself as a
sysfs issue.

The other thing that Kenji found was in pci_setup_bridge(), where
we don't want to initialize the BARs if the bridge has already
been added.

Thanks.

/ac



\
 
 \ /
  Last update: 2009-03-19 21:49    [W:0.078 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site