tech-kern archive

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

Re: Missing ACPI PCI devices in acpi_pcidev_scan

> Hi Christoph,
> >> As AcpiWalkNamespace performs a DFS (with both pre and post order 
> >> visitor callbacks), the parent-child information could be stored 
> >> during the ACPI walk done by acpi_build_tree (in acpi.c), provided 
> >> that struct acpi_devnode is modified to contain that information. 
> >> What do you think?
> > 
> > I appreciate it very much if you get acpi bus scanning done.
> With the attached patch, all PCI devices in the ACPI namespace should be
> detected by acpi_pcidev_scan().  This was more complex than I thought:
> the _BBN only applies to the PCI bus segment of the PCI host bridge.
> For PCI devices that are behind PCI-to-PCI bridges, getting the bus
> segment number is more tricky.  By the way, I could not test that part
> since there are no PCI devices behind PCI-to-PCI bridges in the ACPI
> namespace of the two boxes that I use for testing.
> The file acpica/OsdHardware.c already contained PCI bus scanning code
> for ACPI.  The function AcpiOsDerivePciId() in that file is supposed to
> do just that.  There was a bug in this function (the PCI address in the
> returned PCI address is the address of the parent PCI-to-PCI bridge),
> and moreover the interface has changed in recent ACPICA.  So I adapted
> the implementation to make it easily compatible with the latest ACPICA,
> as well as directly usable by acpi_pcidev_scan().  The main function
> doing the PCI bus scan has been moved from acpica/OsdHardware.c to
> acpi_pci.c.
> Since AcpiOsDerivePciId() is supposed to be called at ACPI's PCI_Config
> region initialization, there is surely a way to obtain the PCI id
> directly from ACPI (instead of re-executing AcpiOsDerivePciId()), but I
> do not know how to do that.
> I should also mention that AcpiOsReadPciConfiguration() is used to read
> the PCI configuration space, but this function does not take the segment
> group (aka PCI domain) into account.

First of all, thanks for doing the great work.
The patch looks really good to me. I will test it as soon as

> > The way you propose sounds right to me.
> This was about storing the parent-child relationships in acpi_devnode.
> The AcpiWalkNamespace function in -current does not have the new
> interface with both pre-order and post-order callbacks.  According to
> ACPICA's changelog [1], this was added in november 2009.  I tried using
> a stack (SLIST) to do it with the old interface, but the code was
> becoming ugly, whereas it would be trivial with the new interface, so I
> guess it's not worth it.


*Adding jmcneill to CC*

Jared: Can you update acpica to latest version, please?


> [1]

Home | Main Index | Thread Index | Old Index