From: Seth Forshee <seth.forshee@canonical.com>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Len Brown <lenb@kernel.org>,
Azael Avalos <coproscefalo@gmail.com>,
Thomas Renninger <trenn@suse.de>,
platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/4] toshiba_acpi: Add blacklist for models with hotkey problems
Date: Thu, 5 Jan 2012 13:32:28 -0600 [thread overview]
Message-ID: <20120105193228.GB25386@ubuntu-macmini> (raw)
In-Reply-To: <20120105182627.GE24242@srcf.ucam.org>
On Thu, Jan 05, 2012 at 06:26:27PM +0000, Matthew Garrett wrote:
> On Tue, Jan 03, 2012 at 01:02:38PM -0600, Seth Forshee wrote:
> > Several Satellite models have a buggy implementation of the INFO method
> > that causes ACPI exceptions when executed:
> >
> > ACPI Error: Result stack is empty! State=ffff88012d70f800 (20110413/dswstate-98)
> > ACPI Exception: AE_AML_NO_RETURN_VALUE, Missing or null operand (20110413/dsutils-646)
> > ACPI Exception: AE_AML_NO_RETURN_VALUE, While creating Arg 0 (20110413/dsutils-763)
> > ACPI Error: Method parse/execution failed [\_SB_.VALZ.GETE] (Node ffff880131175eb0), AE_AML_NO_RETURN_VALUE (20110413/psparse-536)
> > ACPI Error: Method parse/execution failed [\_SB_.VALZ.INFO] (Node ffff880131175ed8), AE_AML_NO_RETURN_VALUE (20110413/psparse-536)
> > toshiba_acpi: ACPI INFO method execution failed
> > toshiba_acpi: Failed to query hotkey event
>
> Ugh, in several ways. The hotkeys on these machines are presumably
> supposed to work - do we have any idea what we should be doing?
Here's a run-down of why this happens. First, the relevant sections of
the DSDT:
Name (EVCD, Package (0x64) {})
Name (EVCT, 0x00)
Method (PUTE, 1, Serialized)
{
<snip>
If (LLess (EVCT, 0x64))
{
Store (Arg0, Index (EVCD, EVCT))
Increment (EVCT)
}
<snip>
Notify (VALZ, 0x80)
Sleep (0x64)
Return (0x00)
}
Method (GETE, 0, Serialized)
{
<snip>
If (LEqual (EVCT, 0x00))
{
Release (MUEV)
Return (0x00)
}
Store (DerefOf (Index (EVCD, 0x00)), Local0)
Store (0x00, Local1)
While (LLess (Local1, Subtract (0x64, 0x01)))
{
Store (DerefOf (Index (EVCD, Add (Local1, 0x01))), Index (
EVCD, Local1))
Increment (Local1)
}
Decrement (EVCT)
Release (MUEV)
If (LNotEqual (EVCT, 0x00))
{
And (HKEV, 0x02, Local0)
If (LEqual (Local0, 0x02))
{
Return (0x00)
}
Notify (VALZ, 0x80)
Sleep (0x64)
}
Return (Local0)
}
Method (INFO, 0, Serialized)
{
Store (GETE (), Local0)
Return (Local0)
}
So EVCD is a queue of events, and EVCT is the number of events in the
queue. NTFY calls PUTE, which puts an event in the queue. INFO calls
GETE to read an event from the queue. Reading an event consists of
copying out the first object out of EVCD, then copying each subsequent
object to the previous element in EVCD. Inefficient, but it should work.
Except for that fact that EVCD will initially contain uninitialized
objects. So until/unless PUTE writes every element in EVCD that copy
loop is going to dereference unintialized objects, which causes the
exceptions.
GETE/PUTE are the only methods which write to EVCD, so there's not some
initialization method or something like that which we're forgetting to
call. We could do something like call PUTE 64 times during
initialization, but that's relying on a BIOS implementation detail which
just seems like a bad idea.
My only guess is that Windows is more permissive about this sort of
thing than ACPICA is, but by my reading of the spec throwing a fatal
error is what's supposed to happen.
Also a side note of interest: The machines that suffer from this all
also have a WMI interface with code to support hotkeys, and that code
shouldn't suffer from this problem. Unfortunately these models are the
only ones I've seen with this WMI interface, and the code to generate
the hotkey events isn't executed if the OS reports itself as Vista or
newer.
next prev parent reply other threads:[~2012-01-05 19:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-03 19:02 [PATCH v2 0/4] toshiba_acpi: Expanded hotkey support Seth Forshee
2012-01-03 19:02 ` [PATCH v2 1/4] ACPI: EC: Add ec_get_handle() Seth Forshee
2012-01-05 18:22 ` Matthew Garrett
[not found] ` <CAPbh3ruqMQ8UFSehm7vX5i8YWzRFwF5=TX_f4n4dVkvmQa9Njw@mail.gmail.com>
2012-01-05 19:34 ` Seth Forshee
2012-01-07 20:55 ` Konrad Rzeszutek Wilk
2012-01-07 21:26 ` Matthew Garrett
2012-01-03 19:02 ` [PATCH v2 2/4] toshiba_acpi: Support alternate hotkey interfaces Seth Forshee
2012-01-05 18:25 ` Matthew Garrett
2012-01-05 19:43 ` Seth Forshee
2012-01-05 19:47 ` Matthew Garrett
2012-01-03 19:02 ` [PATCH v2 3/4] toshiba_acpi: Support additional hotkey scancodes Seth Forshee
2012-01-03 19:02 ` [PATCH v2 4/4] toshiba_acpi: Add blacklist for models with hotkey problems Seth Forshee
2012-01-05 18:26 ` Matthew Garrett
2012-01-05 19:32 ` Seth Forshee [this message]
2012-01-05 19:34 ` Matthew Garrett
2012-01-05 20:04 ` Seth Forshee
2012-01-05 20:09 ` Matthew Garrett
2012-01-05 20:24 ` Seth Forshee
2012-01-05 20:46 ` Moore, Robert
2012-01-05 20:58 ` Seth Forshee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120105193228.GB25386@ubuntu-macmini \
--to=seth.forshee@canonical.com \
--cc=coproscefalo@gmail.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=trenn@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).