Re: pci_create_legacy_files() and non root bus

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

 



On Mon, 2008-11-10 at 22:07 -0800, David Miller wrote:
> From: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
> Date: Tue, 11 Nov 2008 17:04:40 +1100
> 
> > Any reason why we don't create the legacy_io/mem files for child
> > busses ?
> > 
> > The fact that they only exist for PHBs makes it tricky for userspace
> > programs to find them
> > 
> > Since they only appear in /sys/class/pci_bus/* which has no hierarchy
> > information, a user space program like in my case that gets passed a
> > sysfs path to a device, would have to walk back up the chain to find out
> > the phb in order to then find it in there.
> > 
> > I don't see why we can't call pci_create_legacy_files() in
> > pci_alloc_child_bus() too though. Any reason ? 
> 
> Actually this is a bug on systems where the host controller
> root bus doesn't even exist, as happens on several sparc64
> systems.

Hrm.. there isn't even a struct pci_bus that is root of a given domain
and created with pci_create_bus() (or indirectly by something which
calls it ?) I should look at how you create your tree, I didn't think it
was possible :-)

> Only the hierarchy under the host-controller exists in the
> Linux data structures.

Or do you mean you don't have a pci_dev that represents the host
controller ? In that case, yes, that's common and not an issue with the
legacy files, they are under the directory of the bus classdev which is
tied to the actual struct pci_bus (a slightly strange location tho, took
me some time to actually find them the first time around).

It's just that the current code only creates them for toplevel struct
pci_bus.

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