Bug 99831 - Regression 3.10.80 vs. 3.10.79: ACPI change creates resource conflict with ahci
Summary: Regression 3.10.80 vs. 3.10.79: ACPI change creates resource conflict with ahci
Status: CLOSED CODE_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: ACPICA-Core (show other bugs)
Hardware: Intel Linux
: P1 normal
Assignee: acpi_acpica-core@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-11 19:01 UTC by Roland Dreier
Modified: 2015-07-14 19:01 UTC (History)
1 user (show)

See Also:
Kernel Version: 3.10.80
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
acpidump from affected system (1.16 MB, application/octet-stream)
2015-06-11 19:01 UTC, Roland Dreier
Details

Description Roland Dreier 2015-06-11 19:01:04 UTC
Created attachment 179671 [details]
acpidump from affected system

Hi, I recently updated from 3.10.79 to 3.10.80, and my system wouldn't
boot any more.  I tracked this down to commit 92c934b10ec3 ("ACPI /
init: Fix the ordering of acpi_reserve_resources()").  With that
commit reverted, my system is OK again.

What happens is that ahci fails to initialize because
pcim_iomap_regions_request_all() fails with EBUSY, due to a resource
conflict on the first IO region of the ahci device.  Since my root
device is on ahci, that's the end of that.  I'm sure this is due to a
BIOS / ACPI table bug on my particular platform, but that's scant
comfort when the system won't boot :)

I patched 3.10.80 so that ahci continues to initialize after the
EBUSY, and relevant parts of the kernel log seem to be:

[    3.836643,26] system 00:06: [io  0x0400-0x047f] could not be reserved
...
[    3.844112,26] pci 0000:00:1f.2: BAR 0: assigned [io  0x0410-0x0417]
...
[    6.020040,00] ahci 0000:00:1f.2: BAR 0: can't reserve [io  0x0410-0x0417]

and /proc/ioports shows

    0410-0415 : ACPI CPU throttle

So if I'm understanding properly, for some reason we discover but fail
to reserve the region with the ACPI resources, then PCI decides to
assign ahci IO ports into that range, then ACPI loads and reserves
0x0410-0x0415, and then ahci fails to load.

If I fully revert the patch, then I see

[    3.853857,08] system 00:06: [io  0x0400-0x047f] has been reserved
...
[    3.861806,08] pci 0000:00:1f.2: BAR 0: assigned [io  0x0820-0x0827]

We're able to reserve the range, and then PCI assigns ahci into a
non-conflicting range.

From the link order, drivers/acpi init wll be called before
drivers/pnp init, right?  In my case, the acpi resources ("ACPI
PM1a_EVT_BLK") etc are under a pnp bus.  But if acpi requests the
resources first, then pnp can't request the enclosing range.



Attaching acpidump from the system in question.
Comment 1 Rafael J. Wysocki 2015-06-16 14:26:56 UTC
Patch posted: https://patchwork.kernel.org/patch/6601821/
Comment 2 Rafael J. Wysocki 2015-07-14 19:01:45 UTC
Fixed by commit 0294112ee313 (ACPI / PNP: Reserve ACPI resources at the fs_initcall_sync stage).

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