Bug 16422 - the pci device is incorrectly bound with ACPI device
Summary: the pci device is incorrectly bound with ACPI device
Status: CLOSED CODE_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: Config-Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: acpi_config-other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-20 09:05 UTC by ykzhao
Modified: 2010-09-29 03:14 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.28..2.6.34
Subsystem:
Regression: No
Bisected commit-id:


Attachments
the acpidump (179.70 KB, application/octet-stream)
2010-07-20 09:06 UTC, ykzhao
Details
lspci info (20.65 KB, application/octet-stream)
2010-07-20 09:06 UTC, ykzhao
Details

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

Note You need to log in before you can comment on or make changes to this bug.