Bug 195159

Summary: nouveau incorrect ACPI usgage results in ACPI Error : AE_AML_PACKAGE_LIMIT
Product: Drivers Reporter: Urgau (lolo.branstett)
Component: Video(DRI - non Intel)Assignee: drivers_video-dri
Status: RESOLVED WILL_NOT_FIX    
Severity: normal CC: joerg.kadau, lenb, lolo.branstett, peter, pooh, Robert.Moore
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: >4.9.6 Subsystem:
Regression: No Bisected commit-id:
Attachments: Acpidump
dmesg

Description Urgau 2017-03-30 16:33:52 UTC
Hello,

since the kernel 4.9.6 I have this error when I booting :

[   16.855486] ACPI Exception: AE_AML_PACKAGE_LIMIT, Index (0x000000003) is beyond end of object (length 0x0) (20160930/exoparg2-427)
[   16.855566] ACPI Error: Method parse/execution failed [\_SB.PCI0.GFX0._DSM] (Node ffff8801c84b9848), AE_AML_PACKAGE_LIMIT (20160930/psparse-543)
[   16.855636] ACPI: \_SB_.PCI0.GFX0: failed to evaluate _DSM (0x300b)
[   16.855641] ACPI Warning: \_SB.PCI0.GFX0._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20160930/nsarguments-95)
[   16.855714] ACPI Warning: \_SB.PCI0.GFX0._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20160930/nsarguments-95)
[   16.855791] i915 0000:00:02.0: optimus capabilities: enabled, status dynamic power, 
[   16.855820] ACPI Exception: AE_AML_PACKAGE_LIMIT, Index (0x000000003) is beyond end of object (length 0x0) (20160930/exoparg2-427)
[   16.855879] ACPI Error: Method parse/execution failed [\_SB.PCI0.GFX0._DSM] (Node ffff8801c84b9848), AE_AML_PACKAGE_LIMIT (20160930/psparse-543)
[   16.855942] ACPI Error: Method parse/execution failed [\_SB.PCI0.PEG0.GFX0._DSM] (Node ffff8801c84ce168), AE_AML_PACKAGE_LIMIT (20160930/psparse-543)
[   16.856014] ACPI: \_SB_.PCI0.PEG0.GFX0: failed to evaluate _DSM (0x300b)
[   16.856017] ACPI Warning: \_SB.PCI0.PEG0.GFX0._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20160930/nsarguments-95)
[   16.856088] ACPI Warning: \_SB.PCI0.PEG0.GFX0._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20160930/nsarguments-95)

and my principal screen is black, but the second work and when I enter my password with lightdm my screen is power on. If i have one screen it works. 
For your information I have Asus K73SD with Optimus and nouveau driver and I'm on Archlinux.
Comment 1 tagorereddy 2017-03-30 18:47:03 UTC
Please attach acpidump from the affected machine.
Comment 2 Urgau 2017-03-31 16:10:24 UTC
Created attachment 255665 [details]
Acpidump

This is the acpidump.
Comment 3 Robert Moore 2017-03-31 19:38:19 UTC
First of all, it looks like the caller of _DSM is incorrectly passing in a buffer object instead of the required package object.

We can run some small test cases to get more info.
Comment 4 tagorereddy 2017-03-31 22:08:43 UTC
(In reply to lolo.branstett from comment #2)
> Created attachment 255665 [details]
> Acpidump
> 
> This is the acpidump.

Also attach full DMESG
Comment 5 tagorereddy 2017-03-31 23:10:46 UTC
This issue is harmless in most cases. This occurs when GPU driver pass buffer as 4th Argument to _DSM method instead of package. NVIDIA drivers are known to do this (on both Linux and MS Windows). Even though its violating ACPI specifications, its know to happen more often in practice. I don't think Linux will fix this in ACPIA, given its not a bug technically. 

If you attach full DMESG, we can see if this is having any harmful effect.

Thanks,
Tagore
Comment 6 tagorereddy 2017-03-31 23:25:46 UTC
This issue has already been referenced on acpica.
https://bugs.acpica.org/show_bug.cgi?id=1333

It appears to be work in progress.
Comment 7 Urgau 2017-04-01 10:18:59 UTC
Created attachment 255679 [details]
dmesg

This is the full dmesg.
Comment 8 Urgau 2017-04-01 10:21:23 UTC
(In reply to tagorereddy from comment #5)
> This issue is harmless in most cases. This occurs when GPU driver pass
> buffer as 4th Argument to _DSM method instead of package. NVIDIA drivers are
> known to do this (on both Linux and MS Windows). Even though its violating
> ACPI specifications, its know to happen more often in practice. I don't
> think Linux will fix this in ACPIA, given its not a bug technically. 
> 
> If you attach full DMESG, we can see if this is having any harmful effect.
> 
> Thanks,
> Tagore

Okay, but I don't use the NVIDIA drivers. I use the nouveau driver (https://wiki.archlinux.org/index.php/Nouveau).
Comment 9 Urgau 2018-06-20 11:07:33 UTC
Any update ?

The problem is still here with the kernel 4.17.x
Comment 10 Peter Wu 2018-09-08 11:18:44 UTC
The affected code is likely:

    If ((Arg0 == ToUUID ("a486d8f8-0bda-471b-a72b-6042a6b5bee0")))
    {
        Local0 = Zero
        Local0 = (DerefOf (Arg3 [0x03]) << 0x18)
        Local0 += (DerefOf (Arg3 [0x02]) << 0x10)
        Local0 += (DerefOf (Arg3 [One]) << 0x08)
        Local0 += (DerefOf (Arg3 [Zero]) << Zero)

The reason a Buffer is passed by nouveau instead of a Package is presumably due to an issue with the Windows driver that did the wrong thing, and firmware authors adapting that.

I am quite puzzled though with this behavior:

[   13.439026] ACPI Exception: AE_AML_PACKAGE_LIMIT, Index (0x000000003) is beyond end of object (length 0x0) (20160930/exoparg2-427)
[   13.439088] ACPI Error: Method parse/execution failed [\_SB.PCI0.GFX0._DSM] (Node ffff8801c84b9780), AE_AML_PACKAGE_LIMIT (20160930/psparse-543)
[   13.439153] ACPI Error: Method parse/execution failed [\_SB.PCI0.PEG0.GFX0._DSM] (Node ffff8801c84ce7a8), AE_AML_PACKAGE_LIMIT (20160930/psparse-543)
[   13.439222] ACPI: \_SB_.PCI0.PEG0.GFX0: failed to evaluate _DSM (0x300b)
[   13.439383] pci 0000:01:00.0: optimus capabilities: enabled, status dynamic power, 
[   13.439388] VGA switcheroo: detected Optimus DSM method \_SB_.PCI0.PEG0.GFX0 handle

In both cases, the method invocation failed, and I would expect nouveau_optimus_dsm to set 0 as result:

    static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
    {
        ...
        *result = 0;
        obj = acpi_evaluate_dsm_typed(handle, &nouveau_op_dsm_muid, 0x00000100,
                func, &argv4, ACPI_TYPE_BUFFER);
        if (!obj) {
            acpi_handle_info(handle, "failed to evaluate _DSM\n");
            return AE_ERROR;
        }

and I would expect "optimus capabilities: disabled, status " since "

    uint32_t result;
    nouveau_optimus_dsm(dhandle, NOUVEAU_DSM_OPTIMUS_CAPS, 0,
            &result);
    dev_info(&pdev->dev, "optimus capabilities: %s, status %s%s\n",
            (result & OPTIMUS_ENABLED) ? "enabled" : "disabled",
            (result & OPTIMUS_DYNAMIC_PWR_CAP) ? "dynamic power, " : "",
            (result & OPTIMUS_HDA_CODEC_MASK) ? "hda bios codec supported" : "");

However that does not seem to be the case, so either the Linux ACPI module does some kind of fallback, or there is some other kind of memory issue.

Since you reported an issue "since 4.9.6", there was presumably a working version. Can you do a git bisect?
Comment 11 linux4all 2020-05-13 08:00:25 UTC
for me 5.4.8 is working
Comment 12 linux4all 2020-05-13 08:02:46 UTC
on a HP ZBook 17 G4
17: PCI 100.0: 0300 VGA compatible controller (VGA)             
  [Created at pci.386]
  Unique ID: VCu0.mCEkXGSxUXA
  Parent ID: vSkL.fBtNDRZZiP3
  SysFS ID: /devices/pci0000:00/0000:00:01.0/0000:01:00.0
  SysFS BusID: 0000:01:00.0
  Hardware Class: graphics card
  Model: "nVidia GP104GLM [Quadro P4000 Mobile]"
  Vendor: pci 0x10de "nVidia Corporation"
  Device: pci 0x1bb7 "GP104GLM [Quadro P4000 Mobile]"
  SubVendor: pci 0x103c "Hewlett-Packard Company"
  SubDevice: pci 0x8272 
  Revision: 0xa1
  Driver: "nvidia"
  Driver Modules: "nvidia"
  Memory Range: 0xe3000000-0xe3ffffff (rw,non-prefetchable)
  Memory Range: 0xa0000000-0xafffffff (ro,non-prefetchable)
  Memory Range: 0xb0000000-0xb1ffffff (ro,non-prefetchable)
  I/O Ports: 0x5000-0x5fff (rw)
  Memory Range: 0xe4080000-0xe40fffff (ro,non-prefetchable,disabled)
  IRQ: 173 (41186 events)
  Module Alias: "pci:v000010DEd00001BB7sv0000103Csd00008272bc03sc00i00"
  Driver Info #0:
    Driver Status: nouveau is not active
    Driver Activation Cmd: "modprobe nouveau"
  Driver Info #1:
    Driver Status: nvidia_drm is active
    Driver Activation Cmd: "modprobe nvidia_drm"
  Driver Info #2:
    Driver Status: nvidia is active
    Driver Activation Cmd: "modprobe nvidia"
  Config Status: cfg=no, avail=yes, need=no, active=unknown
  Attached to: #13 (PCI bridge)

Primary display adapter: #17
Comment 13 Yury Puchalski 2024-09-09 18:17:33 UTC
I think it's the right place to discuss:)
Using gentoo, kernel 6.6.38, and 5.15.41 had it the same.

It's Dell Precision M4800, integrated intel card, and additional nvidia. I'm using nouveau driver, nvidia setup as primaryGPU for X.

The usual line is there.
[    4.295646] ACPI Warning: \_SB.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20230628/nsarguments-61)

But then, what's very bad, I get temporary freezes regularly. Sometimes it's every 10-15 seconds, sometimes it doesn't happen for prolonged time.

Sep  9 20:00:05 dell kernel: ACPI: \x5c_SB_.PCI0.PEG0.PEGP: failed to evaluate _DSM
Sep  9 20:00:40 dell kernel: ACPI: \x5c_SB_.PCI0.PEG0.PEGP: failed to evaluate _DSM
Sep  9 20:01:10 dell kernel: ACPI: \x5c_SB_.PCI0.PEG0.PEGP: failed to evaluate _DSM
Sep  9 20:01:32 dell kernel: ACPI: \x5c_SB_.PCI0.PEG0.PEGP: failed to evaluate _DSM
Sep  9 20:03:52 dell kernel: ACPI: \x5c_SB_.PCI0.PEG0.PEGP: failed to evaluate _DSM
Sep  9 20:04:22 dell kernel: ACPI: \x5c_SB_.PCI0.PEG0.PEGP: failed to evaluate _DSM
Sep  9 20:04:56 dell kernel: ACPI: \x5c_SB_.PCI0.PEG0.PEGP: failed to evaluate _DSM
Sep  9 20:06:35 dell kernel: ACPI: \x5c_SB_.PCI0.PEG0.PEGP: failed to evaluate _DSM
Sep  9 20:09:55 dell kernel: ACPI: \x5c_SB_.PCI0.PEG0.PEGP: failed to evaluate _DSM
Sep  9 20:10:34 dell kernel: ACPI: \x5c_SB_.PCI0.PEG0.PEGP: failed to evaluate _DSM

Every such message is followed by:
Sep  9 20:12:43 dell kernel: nouveau 0000:01:00.0: Enabling HDA controller

These freezes result in music hiccups, mouse pointer not moving for 2-3 seconds. What can I do to sweep them under the carpet? acpi=off?
Comment 14 Artem S. Tashkinov 2024-09-10 21:07:11 UTC
The nouveau project is severely underfunded and understaffed, so don't expect this bug report to be fixed any time soon or ever.

Also, it makes sense to file it where it should belong: https://gitlab.freedesktop.org/drm/nouveau/-/issues/