mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Dmitry Torokhov <dtor@chromium.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Benson Leung <bleung@chromium.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ACPI: do not fail suspend if unable to configure wakeup
Date: Wed, 19 Nov 2014 02:01:35 +0100	[thread overview]
Message-ID: <4442123.5JIyjOW8pr@vostro.rjw.lan> (raw)
In-Reply-To: <CAE_wzQ_keT0zm0iV=S3gM9r94bM73E5kFpbWX85AckRVcC6KSQ@mail.gmail.com>

On Tuesday, November 18, 2014 04:14:49 PM Dmitry Torokhov wrote:
> On Tue, Nov 18, 2014 at 4:20 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > It goes again below with a changelog, but since technically it is a regression
> > fix, I'd like to push it for "stable" too.  I suppose that the commit that
> > things stopped working after is a76e9bd89ae7 (i2c: attach/detach I2C client
> > device to the ACPI power domain).  Is that correct?
> 
> Yes.

OK

> > --
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > Subject: ACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up
> >
> > As reported by Dmitry, on some Chromebooks there are devices with
> > corresponding ACPI objects and with unusual system wakeup
> > configuration.  Namely, they technically are wakeup-capable, but the
> > wakeup is handled via a platform-specific out-of-band mechanism
> > rather than by standard ACPI means.
> 
> I think they are using standard ACPI wakeup methods, but in a very perverted
> way: there is "shadow" ACPI sleep button corresponding to the GPIO assigned
> to the trackpad or touchscreen; it is just not tied to touchpad/touchscreen
> device in DSDT.

OK

This:

---
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Subject: ACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up

As reported by Dmitry, on some Chromebooks there are devices with
corresponding ACPI objects and with unusual system wakeup
configuration.  Namely, they technically are wakeup-capable, but the
wakeup is handled via a platform-specific out-of-band mechanism and
the ACPI PM layer has no information on the wakeup capability.  As
a result, device_may_wakeup(dev) called from acpi_dev_suspend_late()
returns 'true' for those devices, but the wakeup.flags.valid flag is
unset for the corresponding ACPI device objects, so acpi_device_wakeup()
reproducibly fails for them causing acpi_dev_suspend_late() to return
an error code.  The entire system suspend is then aborted and the
machines in question cannot suspend at all.

Address the problem by ignoring the device_may_wakeup(dev) return
value in acpi_dev_suspend_late() if the ACPI companion of the device
being handled has wakeup.flags.valid unset (in which case it is clear
that the wakeup is supposed to be handled by other means).

This fixes a regression introduced by commit a76e9bd89ae7 (i2c:
attach/detach I2C client device to the ACPI power domain) as the
affected systems could suspend and resume successfully before that
commit.

Fixes: a76e9bd89ae7 (i2c: attach/detach I2C client device to the ACPI power domain)
Reported-by: Dmitry Torokhov <dtor@chromium.org>
Cc: 3.13+ <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/device_pm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-pm/drivers/acpi/device_pm.c
===================================================================
--- linux-pm.orig/drivers/acpi/device_pm.c
+++ linux-pm/drivers/acpi/device_pm.c
@@ -878,7 +878,7 @@ int acpi_dev_suspend_late(struct device
 		return 0;
 
 	target_state = acpi_target_system_state();
-	wakeup = device_may_wakeup(dev);
+	wakeup = device_may_wakeup(dev) && acpi_device_can_wakeup(adev);
 	error = acpi_device_wakeup(adev, target_state, wakeup);
 	if (wakeup && error)
 		return error;


  reply	other threads:[~2014-11-19  0:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15 22:56 Dmitry Torokhov
2014-10-16  8:10 ` Rafael J. Wysocki
2014-10-16 16:05   ` Dmitry Torokhov
2014-11-18 18:00     ` Dmitry Torokhov
2014-11-18 23:43       ` Rafael J. Wysocki
2014-11-18 23:31         ` Dmitry Torokhov
2014-11-19  0:00           ` Rafael J. Wysocki
2014-11-19  0:20             ` Rafael J. Wysocki
2014-11-19  0:14               ` Dmitry Torokhov
2014-11-19  1:01                 ` Rafael J. Wysocki [this message]
2014-11-19  0:48                   ` Dmitry Torokhov

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=4442123.5JIyjOW8pr@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=bleung@chromium.org \
    --cc=dtor@chromium.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@kernel.org \
    /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

all inboxes | Powered by JetHome®