Bug 16422

Summary: the pci device is incorrectly bound with ACPI device
Product: ACPI Reporter: ykzhao (yakui.zhao)
Component: Config-OtherAssignee: acpi_config-other
Status: CLOSED CODE_FIX    
Severity: normal CC: acpi-bugzilla, lenb, rui.zhang
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.28..2.6.34 Subsystem:
Regression: No Bisected commit-id:
Attachments: the acpidump
lspci info

Description ykzhao 2010-07-20 09:05:10 UTC
On one machine there is no ACPI device for the 0000:00:00.0 pci device. But in course of adding 0000:00:00.0 pci device, it is incorrectly bound with the ACPI device. 
   ls -l /sys/devices/pci0000:00/0000:00:00.0/firmware_node 
And we will get
    /sys/devices/pci0000:00/0000:00:00.0/firmware_node -> ../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/PNP0C02:02

    In fact the PNP0C02:02 is not one PCI device.
Comment 1 ykzhao 2010-07-20 09:06:02 UTC
Created attachment 27165 [details]
the acpidump
Comment 2 ykzhao 2010-07-20 09:06:49 UTC
Created attachment 27166 [details]
lspci info
Comment 3 ykzhao 2010-07-21 02:17:32 UTC
     After some debugging and test, it seems that it is related with the incorrect conditional judgement when finding the ACPI device for the PCI device. 
     In course of finding ACPI handle for the corresponding PCI device, we will firstly try to evaluate the _ADR object and then compare the two addresses to
see whether it is the target ACPI device. If there is no _ADR object for ACPI device, it is assumed that the address is zero. But for one PCI device(0000:00:00.0) under the PCI root bridge, the corresponding address will be constructed as zero.In such case maybe the ACPI device without _ADR object will be misdetected and then be used to create the relationship between PCI device and ACPI device.


If we add the check of _ADR flag, we can avoid the incorrect binding about PCI device and ACPI device.
   >https://patchwork.kernel.org/patch/111654/

Thanks.
Comment 4 Zhang Rui 2010-07-26 00:51:23 UTC
Yakui,
please attach the patch or the url of the patch and close this bug.
Comment 5 Len Brown 2010-07-27 02:31:09 UTC
applied to acpi-test
Comment 6 Len Brown 2010-09-29 03:14:21 UTC
commit 108029ff84fcad8f9199d2d2e2583ae2747d45a4
Author: Zhao Yakui <yakui.zhao@intel.com>
Date:   Tue Jul 13 03:36:08 2010 +0000

    ACPI: Add the check of ADR flag in course of finding ACPI handle for PCI dev
    
shipped in v2.6.36-rc1
closed