Bug 32602

Summary: intel_acpi call _DSM with wrong parameter
Product: Drivers Reporter: Alex Williamson (alex.williamson)
Component: Video(DRI - Intel)Assignee: intel-gfx-bugs (intel-gfx-bugs)
Status: RESOLVED CODE_FIX    
Severity: normal CC: alan, daniel, intel-gfx-bugs, lv.zheng, rui.zhang
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.38 Subsystem:
Regression: No Bisected commit-id:
Attachments: pass correct ACPI arg to _DSM

Description Alex Williamson 2011-04-04 03:37:29 UTC
Both drivers/gpu/drm/i915/intel_acpi.c and drivers/gpu/drm/nouveau/nouveau_acpi.c call _DSM methods with parameters of _DSM(Buffer, Integer, Integer, Integer).  The ACPI spec defines the parameters to be _DSM(Buffer, Integer, Integer, Package).  On a UL30VT, the AML preforms operations on Arg3 which are not valid for an Integer data type, resulting in ACPI faults.  Excerpt of DSDT:

Method (_DSM, 4, NotSerialized)
{
    If (LEqual (Arg0, Buffer (0x10)
            {
                /* 0000 */    0xA0, 0xA0, 0x95, 0x9D, 0x60, 0x00, 0x48, 0x4D,
                /* 0008 */    0xB3, 0x4D, 0x7E, 0x5F, 0xEA, 0x12, 0x9F, 0xD4
            }))
    {
        Store (Zero, Local0)
        Store (ShiftLeft (DerefOf (Index (Arg3, 0x03)), 0x18), Local0)
        Add (ShiftLeft (DerefOf (Index (Arg3, 0x02)), 0x10), Local0, Local0)
        Add (ShiftLeft (DerefOf (Index (Arg3, One)), 0x08), Local0, Local0)
        Add (ShiftLeft (DerefOf (Index (Arg3, Zero)), Zero), Local0, Local0)
        ...

The Index operation is only valid on a Buffer, String, or Package, which is perfectly reasonable given the definition of the _DSM call.
Comment 1 Daniel Vetter 2012-11-13 11:49:54 UTC
Created attachment 86301 [details]
pass correct ACPI arg to _DSM

Sorry for the eternal delay in looking at this. Is this patch the right thing to do? I'm a complete ACPI-noob ...
Comment 2 Daniel Vetter 2012-11-13 11:50:51 UTC
Also I'll restrict this to intel-only, please file a separate bug for nouveau, thanks.
Comment 3 Daniel Vetter 2013-08-05 07:20:12 UTC
Fix merged to drm-intel-next-queued:

commit 44a258c9fa89435d9ec2b6bcee6260b94bd11ebd
Author: Peter Wu <lekensteyn@gmail.com>
Date:   Thu Aug 1 18:21:28 2013 +0200

    i915: fix ACPI _DSM warning