Bug 105321 - AE_AML_MUTEX_ORDER on Thinkpad Yoga 12, when method auto-serialization is enabled
Summary: AE_AML_MUTEX_ORDER on Thinkpad Yoga 12, when method auto-serialization is ena...
Status: CLOSED MOVED
Alias: None
Product: ACPI
Classification: Unclassified
Component: ACPICA-Core (show other bugs)
Hardware: Intel Linux
: P1 normal
Assignee: David Box
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-01 22:22 UTC by Peter Clifton
Modified: 2015-12-29 03:02 UTC (History)
3 users (show)

See Also:
Kernel Version: 3.19.0
Subsystem:
Regression: No
Bisected commit-id:


Attachments
DSDT from affected system (576.76 KB, text/x-dsl)
2015-10-01 22:25 UTC, Peter Clifton
Details

Description Peter Clifton 2015-10-01 22:22:59 UTC
Dmesg shows various ACPI issues related to Mutex ordering when auto-serialzation is enabled, such as:

[ 2222.365750] ACPI Error: Cannot release Mutex [MWGS], SyncLevel mismatch: mutex 7 current 0 (20141107/exmutex-415)
[ 2222.365754] ACPI Error: Method parse/execution failed [\_SB_.PCI0.LPCB.EC0_.HKEY.WTGP] (Node ffff8802250cae88), AE_AML_MUTEX_ORDER (20141107/psparse-536)
[ 2222.365757] ACPI Error: Method parse/execution failed [\_SB_.PCI0.LPCB.EC0_.HKEY.SWBO] (Node ffff8802250cae10), AE_AML_MUTEX_ORDER (20141107/psparse-536)
[ 2222.365759] ACPI Error: Method parse/execution failed [\_SB_.PCI0.LPCB.EC0_.HKEY.BPWC] (Node ffff8802250cad70), AE_AML_MUTEX_ORDER (20141107/psparse-536)
[ 2222.365761] ACPI Error: Method parse/execution failed [\_SB_.PCI0.LPCB.EC0_.HKEY.WGWK] (Node ffff8802250cade8), AE_AML_MUTEX_ORDER (20141107/psparse-536)
[ 2222.365763] ACPI Error: Method parse/execution failed [\WAKH] (Node ffff8802250caf00), AE_AML_MUTEX_ORDER (20141107/psparse-536)
[ 2222.365765] ACPI Error: Method parse/execution failed [\_WAK] (Node ffff8802250bcb90), AE_AML_MUTEX_ORDER (20141107/psparse-536)
[ 2222.365767] ACPI Exception: AE_AML_MUTEX_ORDER, While executing method \_WAK (20141107/hwesleep-83)


Tracing through the DSDT with acpiexec shows the same, unless auto-serialisation is disabled.

This bug / patch seems relevant, although relates to synclevels on methods I think - not mutex:

https://bugzilla.kernel.org/show_bug.cgi?id=52191
http://www.spinics.net/lists/linux-acpi/msg49548.html
Comment 1 Peter Clifton 2015-10-01 22:25:38 UTC
Created attachment 189221 [details]
DSDT from affected system
Comment 2 Robert Moore 2015-10-02 15:12:04 UTC
We were able to reproduce the problem with the code below. It appears to be a problem with the interaction of the Mutex SyncLevel and the OperationRegion:

    Mutex (MWGS, 0x07) // Was 0x07

    Method (WTGP, 0, NotSerialized)
    {
        Acquire (MWGS, 0xFFFF)
        Local0 = 0x100
        OperationRegion (LGPI, SystemIO, Local0, 0x04)
        Release (MWGS)
    }

    Method (SWBO, 0, NotSerialized)
    {
        Acquire (MWGS, 0xFFFF)
        WTGP ()
        Release (MWGS)
    }
Comment 3 Robert Moore 2015-10-02 17:27:48 UTC
We have figured out the problem, but the fix will take some design work.

BTW, an easy workaround is to just set the mutex sync level to zero (although it may not help you unless you override the DSDT).

    Mutex (MWGS, 0x00) // Was 0x07
Comment 4 Peter Clifton 2015-10-02 20:34:01 UTC
Thanks - the "// Was 0x07" comment was one I added when trying 0x00 out as an alternative in acpiexec. I set it back to 0x00 before uploading.


I'm actually trying to track down a really hard to reproduce, persists across reboots (ec register probably) fan failure on this laptop, so having other things run correctly is a bonus.

The fan failure is seen by people running Windows too, so I'm guessing it is unlikely to be down to this particular bug unless windows 7 + 8 also react badly to this AML in a similar way.

One for another bug (once I've triaged it a bit more), is this laptop also rejects the _OSC method for power control on the PCIe bus device, complaining of an incorrect UUID, similar to this bug:

https://bugzilla.kernel.org/show_bug.cgi?id=16028

(Interesting to see similar AML triggering that above bug between the Thinkpad here and the Dell XPS... I believe both actually share Compal as their ODM).
Comment 5 Lv Zheng 2015-10-10 05:44:54 UTC
Hi,

Can this be fixed by this ACPICA commit?
https://github.com/acpica/acpica/commit/253e3c0

Thanks and best regards
-Lv
Comment 6 Lv Zheng 2015-10-10 05:50:47 UTC
Any way the MWGS looks like a leaf lock held for opregion accesses, and set its SyncLevel to 0x07 is thus reasonable. Which may also means the method should not be serialized...

Thanks and best regards
-Lv
Comment 7 Zhang Rui 2015-12-28 08:40:00 UTC
Anyway, this is an ACPICA problem, please track this issue at CA bugzilla.
Bug in kernel bugzilla closed.
Lv,
please update the CA bugzilla link after bug report created.
Comment 8 Lv Zheng 2015-12-29 03:02:29 UTC
OK, the case is recorded on ACPICA bugzilla:
http://bugs.acpica.org/show_bug.cgi?id=1234

Thanks
-Lv

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