lkml.org 
[lkml]   [2012]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/7] PCI: Make sriov work with hotplug remove
From
Date
On Mon, 2012-01-23 at 11:34 -0800, Linus Torvalds wrote:
> On Mon, Jan 23, 2012 at 10:45 AM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > Why isn't this magically true in this case? If some *other* random
> > entry than the one that is being iterated over can magically be
> > removed, then the whole thing is just pure and utter crap, and no
> > amount of list maintenance can ever fix it.
> >
> > So explain.
>
> Ahh. I finally understand what's going on. The virtual device attached
> to a physical device can go away, and it's on the same damn list.
>
> That's broken. Virtual devices set up by a physical device should be
> *children* of the physical device, not "siblings". But that's
> apparently not what the broken virtual PCI layer does.

Thank the PCI SIG for that ... they are sibling functions (or even
devices in some case) of the PF :-(

> So I think that there are two possible solutions:
>
> (a) fix the virtual devices that are attached to physical devices to
> really be children of the physical device, with the physical device as
> a "bridge" to that virtual bus.

This will confuse various other aspects of the PCI code since they are
really siblings from an addressing standpoint (ie bus/dev/fn)

Cheers,
Ben.

> I think this is the correct solution from any sane standpoint (now the
> topology of the device tree actually matches the logical
> relationship), which is why I think this is the RightThing(tm) to do.
> And it should automatically fix this insane issue where removing a
> device from a bus can remove *multiple* devices from the same list.
>
> (b) if that isn't an option, and the virtual devices make a mess, at
> least don't make the code uglier, just do something like:
>
> while (!list_empty(&bus->devices)) {
> struct pci_dev *dev = list_first_entry(struct pci_dev, bus_list);
>
> pci_stop_bus_device(dev);
> }
>
> which at least isn't butt ugly. Add a large comment about how
> pci_stop_bus_device() can remove multiple devices due to the virtual
> devices having been done badly.
>
> Who is in charge of the whole 'is_virtfn' mess? How realistic is it to
> fix that crud?
>
> Linus
> --
> 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




\
 
 \ /
  Last update: 2012-01-24 05:37    [W:0.422 / U:0.224 seconds]
©2003-2011 Jasper Spaans. Advertise on this site