Re: [PATCH 5/7] pci hotplug core: add check of duplicate slot name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2008-05-29 at 13:15 -0600, Matthew Wilcox wrote:
> No, I'm wrong.  This is dodgy.
> 
> Basically, we need to know, given a slot, what PCI devfn a device will
> have that's plugged into it.  There's a hint this might be possible to
> get from the OF node.  Only available on ppc32, we see:
> 
>         reg = of_get_property(node, "reg", NULL);
>         if (!reg)
>                 return -ENODEV;
>         *bus = (reg[0] >> 16) & 0xff;
>         *devfn = ((reg[0] >> 8) & 0xff);
> 
> But this is for the OF node that's for the pci_dev, not for the OF
> node
> that's for the slot.  Is there a property on the slot's OF node that
> would tell us the devfn (ok, not the 'fn' part, but YKWIM)?

There is no of node for a slot. At best you get the bridge above. So you
pretty much don't know, at least not using standard properties. There
might be a way to figure it out in a dodgy platform specific way but I
wouldn't bet on it.

In fact, you don't necessarily have the bridge either.

When you do hotplug operations on pSeries, the hypervisor feeds us with
a whole bunch of new OF nodes & properties -at the time of the
insertion-. This can include new top level host bridges, and layers of
p2p bridges finally leading to the device that was inserted.

That is at least when you move things in and out of partitions. I have
to verify what happens if you add to a partition an empty slot (if you
can) and then just perform insert/remove operations on it. I'm not the
expert in IBM PCI hotplug stuff, and when I tried to sort that out 3
weeks ago, I just didn't manage to get the bloody thing to work at all
on one of my test machines (the daemon talking to the management console
is ... fragile).

We have an LTC team that should be maintaining that whole hotplug stuff
so I'm trying to get them involved in this discussion.

Cheers,
Ben.



 

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux