Bug 94221

Summary: Regressions caused by malformed ACPI resource descriptors
Product: ACPI Reporter: Jiang Liu (jiang.liu)
Component: Config-TablesAssignee: Jiang Liu (jiang.liu)
Status: CLOSED CODE_FIX    
Severity: normal CC: aaron.lu, adf.lists, bjorn, rui.zhang
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: v4.0-rc1 Subsystem:
Regression: No Bisected commit-id:
Attachments: ACPI DSDT table with malformed ACPI resource descriptor
DSDT from Asrock-Q1900B-ITX
DSDT from Abit A-S78H
DSDT from Gigabyte GA-MA785G-UD3H(Hudd <hedede.l@gmail.com>)
An acpi dump from PC Engines APU.1C

Description Jiang Liu 2015-03-04 08:39:51 UTC
Created attachment 168851 [details]
ACPI DSDT table with malformed ACPI resource descriptor

Commit 593669c2ac0f (x86/PCI/ACPI: Use common ACPI resource interfaces
to simplify implementation) causes regression to several platforms,
which is caused by stricter checks in new ACPI resource parsing code
and BIOSes report incorrect ACPI resource descriptors. This issue has
appeared several times as below:
3162b6f0c5e1 ("PNPACPI: truncate _CRS windows with _LEN > _MAX - _MIN + 1")
d558b483d5a7 ("x86/PCI: truncate _CRS windows with _LEN > _MAX - _MIN + 1")
f238b414a74a ("PNPACPI: compute Address Space length rather than using _LEN")
48728e077480 ("x86/PCI: compute Address Space length rather than using _LEN")

The root cause is that BIOS reports incorrect 'length' for ACPI address space descriptors as in attached DSDT table.
DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
             0x00000000,         // Granularity
             0x00100000,         // Range Minimum
             0xFEBFFFFF,         // Range Maximum
             0x00000000,         // Translation Offset
             0xFFF00000,         // Length
             ,, _Y00, AddressRangeMemory, TypeStatic)
Comment 1 Bjorn Helgaas 2015-03-04 15:42:36 UTC
Created attachment 169001 [details]
DSDT from Asrock-Q1900B-ITX

Attachment #168851 [details] is from Dave Airlie's AMD RS780 box (http://lkml.kernel.org/r/CAPM=9twcQ18WcVajY2X7xKzZu9O4U9n7yFhzOOPQ3V9uyAGKVw@mail.gmail.com)

This DSDT is from Thomas Voegtle's Asrock-Q1900B-ITX mainboard (http://lkml.kernel.org/r/alpine.LSU.2.11.1503041225150.2556@er-systems.de)
Comment 2 Bjorn Helgaas 2015-03-04 16:15:23 UTC
Created attachment 169021 [details]
DSDT from Abit A-S78H

This DSDT is from Prakash Punnoor's Abit A-S78H (http://lkml.kernel.org/r/54F72D44.7020709@punnoor.de).
Comment 3 Jiang Liu 2015-03-05 03:02:54 UTC
Created attachment 169091 [details]
DSDT from Gigabyte GA-MA785G-UD3H(Hudd <hedede.l@gmail.com>)
Comment 4 Jiang Liu 2015-03-23 04:45:53 UTC
Created attachment 171701 [details]
An acpi dump from PC Engines APU.1C

An acpi table from PC Engines APU.1C, which defines MMIO for PCI host bridge with Memory32Fixed() operator. 
            Name (CRES, ResourceTemplate ()
            {
                IO (Decode16,
                    0x0CF8,             // Range Minimum
                    0x0CF8,             // Range Maximum
                    0x01,               // Alignment
                    0x08,               // Length
                    )
                WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode,
EntireRange,
                    0x0000,             // Granularity
                    0x0000,             // Range Minimum
                    0x0CF7,             // Range Maximum
                    0x0000,             // Translation Offset
                    0x0CF8,             // Length
                    ,, , TypeStatic)
                WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode,
EntireRange,
                    0x0000,             // Granularity
                    0x0D00,             // Range Minimum
                    0xFFFF,             // Range Maximum
                    0x0000,             // Translation Offset
                    0xF300,             // Length
                    ,, , TypeStatic)
                Memory32Fixed (ReadOnly,
                    0x000A0000,         // Address Base
                    0x00020000,         // Address Length
                    )
                Memory32Fixed (ReadOnly,
                    0x00000000,         // Address Base
                    0x00000000,         // Address Length
                    _Y00)
            })
Comment 5 Aaron Lu 2015-09-01 03:02:31 UTC
Hi Jiang,

What's the status of this bug, I saw a commit mentioned it:

commit 2c62e8492ed7358bbe7da51666c7e0f6da9474ee
Author: Jiang Liu <jiang.liu@linux.intel.com>
Date:   Thu Apr 30 12:41:28 2015 +0800

    x86/PCI/ACPI: Make all resources except [io 0xcf8-0xcff] available on PCI bus

Is the bug fixed by the above commit? Thanks.
Comment 6 Jiang Liu 2015-09-16 03:06:14 UTC
Yes, it fixes the bug.