Bug 200363

Summary: PCI0 not found leading to no eMMC detection (Surface 3)
Product: ACPI Reporter: Bastien Nocera (bugzilla)
Component: ACPICA-CoreAssignee: Erik Kaneda (erik.kaneda)
Status: RESOLVED CODE_FIX    
Severity: normal CC: erik.kaneda, jwrdegoede
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.18.0-0.rc2.git2.32.surface3.fc29.x86_64 Subsystem:
Regression: Yes Bisected commit-id:
Attachments: kernel logs
DSDT
working kernel logs
AML Parser: ignore dispatcher error status during table load
AML Parser: ignore dispatcher error status during table load
dmesg with patch applied

Description Bastien Nocera 2018-06-29 09:58:43 UTC
Created attachment 277043 [details]
kernel logs

I can boot with an older 4.14 kernel, but not more recent ones.

Some of the errors:
[    0.226369] ACPI Error: Needed [Integer/String/Buffer], found [Device] (____ptrval____) (20180531/exresop-391)
[    0.226563] ACPI Error: Ignore error and continue table load (20180531/psobject-604)
[    0.227079] 
               3ACPI BIOS Error (bug): Could not resolve [\_SB.PCI0.UOTG._SB.PCI0], AE_NOT_FOUND (20180531/dswload2-160)
[    0.227132] ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20180531/psobject-221)
[    0.227218] ACPI Error: Ignore error and continue table load (20180531/psobject-604)
[    0.227296] ACPI Error: Skipping Scope block (20180531/psloop-532)
[    0.237492] 
               3ACPI BIOS Error (bug): Could not resolve [\_SB.PCI0.UOTG._SB.PCI0], AE_NOT_FOUND (20180531/dswload2-160)
[    0.237539] ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20180531/psobject-221)
[    0.237629] ACPI Error: Ignore error and continue table load (20180531/psobject-604)
[    0.237708] ACPI Error: Skipping Scope block (20180531/psloop-532)
[    0.240049] 
               3ACPI BIOS Error (bug): Could not resolve [\_SB.PCI0.UOTG._SB.PCI0.I2C4], AE_NOT_FOUND (20180531/dswload2-160)
[    0.240094] ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20180531/psobject-221)
[    0.240179] ACPI Error: Ignore error and continue table load (20180531/psobject-604)
[    0.240258] ACPI Error: Skipping Scope block (20180531/psloop-532)
[    0.240329] 
               3ACPI BIOS Error (bug): Could not resolve [\_SB.PCI0.UOTG._SB.GPO2], AE_NOT_FOUND (20180531/dswload2-160)
[    0.240369] ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20180531/psobject-221)
[    0.240453] ACPI Error: Ignore error and continue table load (20180531/psobject-604)
[    0.240531] ACPI Error: Skipping Scope block (20180531/psloop-532)
[    0.240947] 
               3ACPI BIOS Error (bug): Could not resolve [\_SB.PCI0.UOTG._SB.GPO1], AE_NOT_FOUND (20180531/dswload2-160)
[    0.240988] ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20180531/psobject-221)
[    0.241027] ACPI Error: Ignore error and continue table load (20180531/psobject-604)
[    0.241109] ACPI Error: Skipping Scope block (20180531/psloop-532)
[    0.241182] 
               3ACPI BIOS Error (bug): Could not resolve [\_SB.PCI0.UOTG._SB.PCI0.SPI1], AE_NOT_FOUND (20180531/dswload2-160)
[    0.241222] ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20180531/psobject-221)
[    0.241309] ACPI Error: Ignore error and continue table load (20180531/psobject-604)
[    0.241388] ACPI Error: Skipping Scope block (20180531/psloop-532)
[    0.241460] 
               3ACPI BIOS Error (bug): Could not resolve [\_SB.PCI0.UOTG._SB.PCI0.I2C1], AE_NOT_FOUND (20180531/dswload2-160)
[    0.241499] ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20180531/psobject-221)
[    0.241584] ACPI Error: Ignore error and continue table load (20180531/psobject-604)
[    0.241663] ACPI Error: Skipping Scope block (20180531/psloop-532)
[    0.288386] ACPI: 9 ACPI AML tables successfully acquired and loaded
[    0.296447] ACPI Error: Needed [Integer/String/Buffer], found [Device] (____ptrval____) (20180531/exresop-391)
[    0.296583] ACPI Error: AE_AML_OPERAND_TYPE, Could not execute arguments for [KEYS] (Region) (20180531/nsinit-433)
[    0.306785] ACPI Error: Needed [Integer/String/Buffer], found [Device] (____ptrval____) (20180531/exresop-391)
[    0.306908] ACPI Error: AE_AML_OPERAND_TYPE, Could not execute arguments for [KEYS] (Region) (20180531/nsinit-433)
[    0.353244] ACPI: Dynamic OEM Table Load:
[    0.353337] ACPI: SSDT 0xFFFF8DB579767800 00066D (v01 PmRef  Cpu0Ist  00003000 INTL 20120913)
[    0.358263] ACPI: Dynamic OEM Table Load:
[    0.358345] ACPI: SSDT 0xFFFF8DB57A0BBC00 0003A5 (v01 PmRef  Cpu0Cst  00003001 INTL 20120913)
[    0.364475] ACPI: Dynamic OEM Table Load:
[    0.364557] ACPI: SSDT 0xFFFF8DB5797EC200 00015F (v01 PmRef  ApIst    00003000 INTL 20120913)
[    0.366829] ACPI: Dynamic OEM Table Load:
[    0.366908] ACPI: SSDT 0xFFFF8DB57974A0C0 00008D (v01 PmRef  ApCst    00003000 INTL 20120913)
[    0.386877] ACPI: Interpreter enabled
[    0.387064] ACPI: (supports S0 S5)
[    0.387077] ACPI: Using IOAPIC for interrupt routing
[    0.387242] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    0.399661] 
               3ACPI BIOS Error (bug): Could not resolve [^GFX0.GSTM], AE_NOT_FOUND (20180531/psargs-330)
[    0.399742] ACPI Error: Method parse/execution failed \_SB.PCI0._CRS, AE_NOT_FOUND (20180531/psparse-516)
[    0.419355] ACPI: Power Resource [PRWF] (on)
[    0.429289] ACPI: Power Resource [USBC] (on)
[    0.435651] ACPI: Power Resource [WWPR] (off)
[    0.464217]  (null): Device [PWM1] is in always present list
[    0.480835] ACPI: Power Resource [CLK3] (on)
[    0.491716] ACPI: Power Resource [CLK0] (on)
[    0.492229] ACPI: Power Resource [CLK1] (on)
[    0.493742] ACPI: Power Resource [P28X] (off)
[    0.494276] ACPI: Power Resource [P18X] (off)
[    0.503978] ACPI: Power Resource [TCPR] (off)
[    0.518277] ACPI Error: Cannot assign type [Device] to [BufferField] (must be type Int/Str/Buf) (20180531/exstoren-93)
[    0.518421] ACPI Error: Method parse/execution failed \_SB.PCI0.UOTG._CRS, AE_AML_OPERAND_TYPE (20180531/psparse-516)
[    0.518591] ACPI Error: Method execution failed \_SB.PCI0.UOTG._CRS, AE_AML_OPERAND_TYPE (20180531/uteval-69)
[    0.548068]  (null): Device [GPED] is in always present list
[    0.590294] 
               3ACPI BIOS Error (bug): Could not resolve [^GFX0.GSTM], AE_NOT_FOUND (20180531/psargs-330)
[    0.590367] ACPI Error: Method parse/execution failed \_SB.PCI0._CRS, AE_NOT_FOUND (20180531/psparse-516)
[    0.590612] acpi PNP0A08:00: [Firmware Bug]: no secondary bus range in _CRS
[    0.590796] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[    0.590832] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI]
[    0.594933] acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug SHPCHotplug PME AER PCIeCapability LTR]
[    0.595115] acpi PNP0A08:00: [Firmware Info]: MMCONFIG for domain 0000 [bus 00-3f] only partially covers this bridge
[    0.596920] 
               3ACPI BIOS Error (bug): Could not resolve [^GFX0.GSTM], AE_NOT_FOUND (20180531/psargs-330)
[    0.596975] ACPI Error: Method parse/execution failed \_SB.PCI0._CRS, AE_NOT_FOUND (20180531/psparse-516)
[    0.597143] acpi PNP0A08:00: failed to parse _CRS method, error code -5
[    0.597159] acpi PNP0A08:00: Bus 0000:00 not present in PCI namespace
[    0.598781] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.599786] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.600773] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.601762] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.602767] ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.603749] ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.604735] ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.605713] ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.617289] 
               3ACPI BIOS Error (bug): Could not resolve [^^PCI0.SPI1.NTRG], AE_NOT_FOUND (20180531/psargs-330)
[    0.617377] ACPI Error: Method parse/execution failed \_SB.GPO0._E4C, AE_NOT_FOUND (20180531/psparse-516)
[    0.639842] vgaarb: loaded
[    0.641389] SCSI subsystem initialized
[    0.641779] libata version 3.00 loaded.
[    0.642107] ACPI: bus type USB registered
[    0.642386] usbcore: registered new interface driver usbfs
[    0.642519] usbcore: registered new interface driver hub
[    0.642759] usbcore: registered new device driver usb
[    0.647242] 
               3ACPI BIOS Error (bug): Could not resolve [^GFX0.GSTM], AE_NOT_FOUND (20180531/psargs-330)
[    0.647315] ACPI Error: Method parse/execution failed \_SB.PCI0._CRS, AE_NOT_FOUND (20180531/psparse-516)
[    0.686726] 
               3ACPI BIOS Error (bug): Could not resolve [^GFX0.GSTM], AE_NOT_FOUND (20180531/psargs-330)
[    0.686797] ACPI Error: Method parse/execution failed \_SB.PCI0._CRS, AE_NOT_FOUND (20180531/psparse-516)
Comment 1 Bastien Nocera 2018-06-29 09:59:23 UTC
Created attachment 277045 [details]
DSDT
Comment 2 Erik Kaneda 2018-06-29 23:26:52 UTC
Could you post the dmesg for an earlier kernel that works?
Comment 3 Bastien Nocera 2018-06-30 10:24:53 UTC
Created attachment 277081 [details]
working kernel logs
Comment 4 Erik Kaneda 2018-07-03 20:57:26 UTC
Could you also post the ACPI dump for this machine? Thanks.
Comment 5 Bastien Nocera 2018-07-03 21:02:39 UTC
(In reply to Erik Schmauss from comment #4)
> Could you also post the ACPI dump for this machine? Thanks.

What ACPI dump? You want all the tables? The DSDT is already available as attachment 277045 [details].
Comment 6 Erik Kaneda 2018-07-03 21:32:53 UTC
(In reply to Bastien Nocera from comment #5)
> (In reply to Erik Schmauss from comment #4)
> > Could you also post the ACPI dump for this machine? Thanks.
> 
> What ACPI dump? You want all the tables? The DSDT is already available as
> attachment 277045 [details].
Can I get the ssdt's as well? You can use acpidump utility (available via apt or yum) or build your own from this project: https://github.com/acpica/acpica/
Comment 7 Bastien Nocera 2018-07-04 00:42:44 UTC
I've uploaded everything here, too many to upload by hand:
https://fedorapeople.org/~hadess/ACPI-tables/

Just tested a kernel based off Fedora's v4.18-rc3-107-gd0fbad0aec1d, and it still doesn't boot.
Comment 8 Erik Kaneda 2018-07-05 21:56:32 UTC
Thanks, I was able to trace this error

[    0.226369] ACPI Error: Needed [Integer/String/Buffer], found [Device] (____ptrval____) (20180531/exresop-391)
[    0.226563] ACPI Error: Ignore error and continue table load (20180531/psobject-604)
[    0.227079] ACPI BIOS Error (bug): Could not resolve [\_SB.PCI0.UOTG._SB.PCI0], AE_NOT_FOUND (20180531/dswload2-160)
^^^ Bug here

to this code snippet here. 

DefinitionBlock ("", "DSDT", 2, "ALASKA", "A M I ", 0x01072009)
{
    Name (OTG1, 0x0)

    Scope (_SB)
    {
        Device (PCI0)
        {
            Device (OTG1)
            {
            }
    
            Device (UOTG)
            {
                OperationRegion (KEYS, SystemMemory, OTG1, 0x0100)
                Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
                {
                    PSAT,   32
                }
            }
        }
    }

    Scope (_SB.PCI0)
    {
    }
}

I'm working on a fix now. I will post a patch when it's ready.
Comment 9 Erik Kaneda 2018-07-06 17:22:53 UTC
(In reply to Erik Schmauss from comment #8)
> [    0.226369] ACPI Error: Needed [Integer/String/Buffer], found [Device]
> (____ptrval____) (20180531/exresop-391)
> [    0.226563] ACPI Error: Ignore error and continue table load
> (20180531/psobject-604)
> [    0.227079] ACPI BIOS Error (bug): Could not resolve
> [\_SB.PCI0.UOTG._SB.PCI0], AE_NOT_FOUND (20180531/dswload2-160)

I've been looking at this error and I think this error may not be the reason why your system isn't booting. We've made a big ACPICA change in 4.17 kernel and you're saying that you can't boot 4.14 or later. Please bisect this so that we know the root cause of your boot issues.
Comment 10 Erik Kaneda 2018-07-10 23:05:38 UTC
Created attachment 277317 [details]
AML Parser: ignore dispatcher error status during table load

Please try this patch. It might fix some of the issues that you're seeing on the dmesg
Comment 11 Erik Kaneda 2018-07-10 23:45:50 UTC
Created attachment 277319 [details]
AML Parser: ignore dispatcher error status during table load

Please try this one instead. Thanks.
Comment 12 Erik Kaneda 2018-07-13 17:18:29 UTC
Friendly ping: does this patch work for you? It would be nice if you could test this before it gets included in upstream. It solves a few more problems for us but it would be great if you could test it as well.
Comment 13 Bastien Nocera 2018-07-14 10:38:33 UTC
Created attachment 277351 [details]
dmesg with patch applied
Comment 14 Bastien Nocera 2018-07-14 10:47:02 UTC
(In reply to Erik Schmauss from comment #12)
> Friendly ping: does this patch work for you? It would be nice if you could
> test this before it gets included in upstream. It solves a few more problems
> for us but it would be great if you could test it as well.

I was travelling with the Surface 3 as my only computer, which made bisecting or even compiling a new kernel a very difficult task. I got a kernel compiled yesterday, and tested it today, and it boots!
Comment 15 Erik Kaneda 2018-07-16 16:42:48 UTC
(In reply to Bastien Nocera from comment #14)
> (In reply to Erik Schmauss from comment #12)
> > Friendly ping: does this patch work for you? It would be nice if you could
> > test this before it gets included in upstream. It solves a few more
> problems
> > for us but it would be great if you could test it as well.
> 
> I was travelling with the Surface 3 as my only computer, which made
> bisecting or even compiling a new kernel a very difficult task. I got a
> kernel compiled yesterday, and tested it today, and it boots!

Great! I will add these changes to the next ACPICA release and send it out in the ACPI mailing list. Thanks for testing. Closing.
Comment 16 Bastien Nocera 2018-07-16 17:27:40 UTC
(In reply to Erik Schmauss from comment #15)
> (In reply to Bastien Nocera from comment #14)
> > (In reply to Erik Schmauss from comment #12)
> > > Friendly ping: does this patch work for you? It would be nice if you
> could
> > > test this before it gets included in upstream. It solves a few more
> > problems
> > > for us but it would be great if you could test it as well.
> > 
> > I was travelling with the Surface 3 as my only computer, which made
> > bisecting or even compiling a new kernel a very difficult task. I got a
> > kernel compiled yesterday, and tested it today, and it boots!
> 
> Great! I will add these changes to the next ACPICA release and send it out
> in the ACPI mailing list. Thanks for testing. Closing.

Feel free to CC: me and add me to your tested-by list on that patch. I'm in the MAINTAINERS file for the address to use.
Comment 17 Erik Kaneda 2018-07-16 17:34:39 UTC
thanks for mentioning that. I'll be sure to get your address from the MAINTAINERS file.