All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Lambley <linux@davel.me.uk>
To: linux-acpi@vger.kernel.org
Cc: Dave Lambley <linux@davel.me.uk>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>
Subject: [PATCH v2] Lenovo Yoga 300 battery support
Date: Wed,  2 Nov 2016 18:37:26 +0000	[thread overview]
Message-ID: <1478111847-14653-1-git-send-email-linux@davel.me.uk> (raw)
In-Reply-To: <1474153002-13904-1-git-send-email-linux@davel.me.uk>

This patch allows Linux to detect the battery in the Lenovo Yoga 300
laptop. It does this by tolerating a bug in the firmware which breaks the
_BIX method but not _BIF. Without this patch, the battery is not presented
to userland.

On a system with non-buggy firmware, the behaviour should be unchanged.

With the patch, something like this gets logged,

[ 3004.858993] ACPI Exception: AE_AML_PACKAGE_LIMIT, Index (0x000000010) is beyond end of object (length 0xD) (20160831/exoparg2-427)
[ 3004.859015] ACPI Error: Method parse/execution failed [\_SB.PCI0.LPCB.H_EC.BAT1._BIX] (Node ffff955bbb0b32d0), AE_AML_PACKAGE_LIMIT (20160831/psparse-543)
[ 3004.859038] ACPI Exception: AE_AML_PACKAGE_LIMIT, Evaluating _BIX (20160831/battery-493)
[ 3004.873413] [Firmware Bug]: The _BIX method is broken, using _BIF.

v1 -> v2
	- Log when falling back to _BIF method.
	- Rebased against v4.9-rc2.

Signed-off-by: Dave Lambley <linux@davel.me.uk>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Len Brown <lenb@kernel.org>

Dave Lambley (1):
  If _BIX fails, retry with _BIF.

 drivers/acpi/battery.c | 72 +++++++++++++++++++++++++++++++++-----------------
 1 file changed, 48 insertions(+), 24 deletions(-)

-- 
2.7.4


  reply	other threads:[~2016-11-02 18:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14  8:40 [PATCH] Avoid _BIX ACPI method on Lenovo Yoga 300 Dave Lambley
2016-09-14 10:34 ` Zheng, Lv
2016-09-17 22:56   ` [PATCH] If _BIX fails, retry with _BIF Dave Lambley
2016-11-02 18:37     ` Dave Lambley [this message]
2016-11-02 18:37       ` [PATCH v2] " Dave Lambley
2016-11-02 23:26         ` Henrique de Moraes Holschuh
2016-11-03  8:33           ` Dave Lambley
2016-11-03 22:38             ` Henrique de Moraes Holschuh
2016-11-04  1:05               ` [PATCH v3 0/1] Lenovo Yoga 300 battery support Dave Lambley
2016-11-04  1:05                 ` [PATCH v3 1/1] If _BIX fails, retry with _BIF Dave Lambley
2016-11-24  1:25                   ` Rafael J. Wysocki

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=1478111847-14653-1-git-send-email-linux@davel.me.uk \
    --to=linux@davel.me.uk \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rjw@rjwysocki.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.