public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Bolle <pebolle@tiscali.nl>
To: Shaohua Li <shaohua.li@intel.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>
Cc: Rubin Abdi <rubin@starset.net>,
	linux-acpi@vger.kernel.org, linux-thinkpad@linux-thinkpad.org
Subject: ACPI / dock: ThinkPad X220: \_SB_.PCI0.LPC_.EC__.BAT1: Unable to dock!
Date: Tue, 29 Jul 2014 23:46:14 +0200	[thread overview]
Message-ID: <1406670374.2406.27.camel@x220> (raw)

0) A ThinkPad X220 I use prints this error at the _first_ resume from
suspend (to ram):
    ACPI: \_SB_.PCI0.LPC_.EC__.BAT1: Unable to dock!

1) BAT1 is apparently a "battery bay". Rubin suggested that it is a
"slice" battery. I do not use a "slice" battery. (There are two other
possible docks according to the ACPI printks is get. An "ata bay" and a
"dock station". I don't use those either, but the kernel at least prints
no errors about them.)

2) I've peeked a bit at the DSDT of this machine. Its _WAK method
contains this line:
    \_SB.PCI0.LPC.EC.BATW (Arg0)

That BATW method is about 12 lines long. (Can I quote that in full?) It
ends with this snippet:
    If (XOr (Local0, Local1))
    {
        Store (Local1, [...])
        Notify (\_SB.PCI0.LPC.EC.BAT1, 0x01) // Device Check
    }

3) That ACPI_NOTIFY_DEVICE_CHECK for BAT1 apparently triggers this call
chain:
    acpi_bus_notify()
        acpi_hotplug_schedule()
            acpi_hotplug_work_fn()
                acpi_device_hotplug()
                    dock_notify()

4) Perhaps Lenovo needs to update the ACPI part of this laptop's
firmware. (I'm running the latest firmware.) Does Lenovo listen to
suggestions to update its firmware?

5) A workaround in the kernel _might_ be something utterly untested like
this:

diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index d9339b442a4e..9e5856a6adfb 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -333,7 +333,7 @@ static void dock_event(struct dock_station *ds, u32 event, int num)
  *
  * Execute the _DCK method in response to an acpi event
  */
-static void handle_dock(struct dock_station *ds, int dock)
+static acpi_status handle_dock(struct dock_station *ds, int dock)
 {
 	acpi_status status;
 	struct acpi_object_list arg_list;
@@ -351,11 +351,12 @@ static void handle_dock(struct dock_station *ds, int dock)
 	if (ACPI_FAILURE(status) && status != AE_NOT_FOUND)
 		acpi_handle_err(ds->handle, "Failed to execute _DCK (0x%x)\n",
 				status);
+	return status;
 }
 
-static inline void dock(struct dock_station *ds)
+static inline acpi_status dock(struct dock_station *ds)
 {
-	handle_dock(ds, 1);
+	return handle_dock(ds, 1);
 }
 
 static inline void undock(struct dock_station *ds)
@@ -471,8 +472,12 @@ int dock_notify(struct acpi_device *adev, u32 event)
 	case ACPI_NOTIFY_BUS_CHECK:
 	case ACPI_NOTIFY_DEVICE_CHECK:
 		if (!dock_in_progress(ds) && !acpi_device_enumerated(adev)) {
+			acpi_status status;
+
 			begin_dock(ds);
-			dock(ds);
+			status = dock(ds);
+			if (status == AE_NOT_FOUND)
+				break;
 			if (!dock_present(ds)) {
 				acpi_handle_err(handle, "Unable to dock!\n");
 				complete_dock(ds);

Please note that BAT1 does have a _EJ0 method but doesn't have a _DCK
method.

6) Any suggestions?


Paul Bolle


             reply	other threads:[~2014-07-29 21:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-29 21:46 Paul Bolle [this message]
2014-07-29 22:02 ` ACPI / dock: ThinkPad X220: \_SB_.PCI0.LPC_.EC__.BAT1: Unable to dock! 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
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=1406670374.2406.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 \
    --cc=shaohua.li@intel.com \
    /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