public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Bolle <pebolle@tiscali.nl>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Len Brown <lenb@kernel.org>, Rubin Abdi <rubin@starset.net>,
	linux-acpi@vger.kernel.org, linux-thinkpad@linux-thinkpad.org
Subject: Re: ACPI / dock: ThinkPad X220: \_SB_.PCI0.LPC_.EC__.BAT1: Unable to dock!
Date: Wed, 13 Aug 2014 11:48:55 +0200	[thread overview]
Message-ID: <1407923335.2121.27.camel@x220> (raw)
In-Reply-To: <1589104.UMXrnXY9GI@vostro.rjw.lan>

On Wed, 2014-07-30 at 00:23 +0200, Rafael J. Wysocki wrote:
> Can you send me the output of acpidump from the machine in question, please?

0) That I've done some time ago. In the mean time I've decompiled the
dsdt.dat that acpidump generates. Here are my (rather verbose) notes,
that I mostly post to archive them somewhere public.

1) The interesting parts of dsdt.dsl are:
DefinitionBlock ("dsdt.aml", "DSDT", 1, "LENOVO", "TP-8D   ", 0x00001390)
{
    [...]
    Scope (\_SB)
    {
        Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            [...]
            If (LGreaterEqual (\_REV, 0x02))
            {
                Store (0x01, \H8DR)
            }
            [...]
        }
        [...]
        Device (PCI0)
        {
            [...]
            Device (LPC)
            {
                [...]
                Device (EC)
                {
                    [...]
                    Field (ECOR, ByteAcc, NoLock, Preserve)
                    {
                        [...]
                        HB1A,   1, 
                        [...]
                    }
                    [...]
                    Method (BATW, 1, NotSerialized)
                    {
                        Store (\_SB.PCI0.LPC.EC.BAT1.XB1S, Local0)
                        If (\H8DR)
                        {
                            Store (HB1A, Local1)
                        }
                        Else
                        {
                            [...]
                        }

                        If (XOr (Local0, Local1))
                        {
                            Store (Local1, \_SB.PCI0.LPC.EC.BAT1.XB1S)
                            Notify (\_SB.PCI0.LPC.EC.BAT1, 0x01) // Device Check
                        }
                    }
                    [...]
                    Device (BAT1)
                    {
                        [...]
                        Name (XB1S, 0x01)
                        [...]
                        Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
                        {
                            If (Arg0)
                            {
                                [...]
                                Store (0x00, XB1S) /* \_SB_.PCI0.LPC_.EC__.BAT1.XB1S */
                            }
                        }
                    }
                    [...]
                }
            }
            [...]
        }
        [...]
    }
    [...]
    Method (\_WAK, 1, NotSerialized)  // _WAK: Wake
    {
        [...]
        \_SB.PCI0.LPC.EC.BATW (Arg0)
        [...]
    }
    [...]
    Name (H8DR, 0x00)
    [...]
}

2) Some guesswork:
- HB1A is always 1;
- H8DR will be 0x01 (because Linux currently sets _REV at 5);
- XB1S is apparently 0x00 at first resume (I don't know how that
  happens);
- so "XOr ([HB1A], [XB1S])" evaluates to 1 at the first "Wake" and XB1S
  will then be set to 1 and a "Device Check" event is fired;
- it's this "Device Check" event that triggers the error I reported;
- because HB1A and XB1S are equal after the BATW method has run at first
  resume we will not get a "Device Check" event at subsequent resumes.


Paul Bolle


  parent reply	other threads:[~2014-08-13  9:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-29 21:46 ACPI / dock: ThinkPad X220: \_SB_.PCI0.LPC_.EC__.BAT1: Unable to dock! Paul Bolle
2014-07-29 22:02 ` Paul Bolle
2014-07-29 22:23 ` Rafael J. Wysocki
2014-07-29 22:09   ` Paul Bolle
2014-07-29 22:36     ` Rafael J. Wysocki
2014-08-13  9:48   ` Paul Bolle [this message]
2014-08-13 11:49     ` Paul Bolle
2014-07-29 23:39 ` Henrique de Moraes Holschuh

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=1407923335.2121.27.camel@x220 \
    --to=pebolle@tiscali.nl \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-thinkpad@linux-thinkpad.org \
    --cc=rjw@rjwysocki.net \
    --cc=rubin@starset.net \
    /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