linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Hans de Goede <hdegoede@redhat.com>
Cc: "Chen, Hu" <hu1.chen@intel.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] ACPI / PM: Propagate KEY_POWER to user space when resume
Date: Fri, 29 Mar 2019 13:32:44 +0100	[thread overview]
Message-ID: <20190329123244.GA20104@amd> (raw)
In-Reply-To: <23bc59ef-fc25-440b-ab1c-c5db6b5cf6d2@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2317 bytes --]

On Fri 2019-03-29 12:38:39, Hans de Goede wrote:
> Hi,
> 
> On 3/29/19 11:25 AM, Pavel Machek wrote:
> >>I run Android on x86 PC (it's a NUC). Everytime I press the power button
> >>to wake the system, it suspends right away. After some debug, I find
> >>that Android wants to see KEY_POWER at resume. Otherwise, its
> >>opportunistic suspend will kick in shortly.
> >>
> >>However, other OS such as Ubuntu doesn't like KEY_POWER at resume. So
> >>add a knob "/sys/module/button/parameters/key_power_at_resume" for users
> >>to select.
> >>
> >>Signed-off-by: Chen, Hu <hu1.chen@intel.com>
> >
> >NAK.
> >
> >Fix android, lets not break kernel.
> 
> It is not that simple, as I explained in my other reply to this
> patch, we alreayd have inconsistent behavior here inside the kernel.
> 
> When KEY_POWER is handled by the gpio-keys driver it does explicitly
> send a KET_POWER press event when the system is woken up through the
> power-button.

Which may be okay.

> Arguably that is more consistent, e.g. some systems can also be woken
> up through a home-button press and in that case we do want the KEY_HOMEPAGE
> to be propagated to userspace after the wakeup so that we not only wake
> but also switch to the homescreen (whatever that might be).

Which may also be okay.

> Note I'm not saying that I'm happy with any of this, but simply NACK-ing
> this patch is IMHO not the answer.

Well, to add a knob
"/sys/module/button/parameters/key_power_at_resume" is really not
acceptable. Android does not know that it needs to set it, so it will
not set it, and the problem remains. Plus, we get a great mess in
future.

But yes, we might want userland to know why the system woke up. And it
would be good if everything also worked with wake-on-lan. Hmm.

It is also possible that PC's ACPI power button should generate
something else than KEY_POWER. Power button on my USB keyboard
generates that, and that is really quite different button the one on
the box.

I'm not saying I know what the solution is. But we should have one
solution, not a knob to select between different solutions.

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

      reply	other threads:[~2019-03-29 12:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-04  3:00 [PATCH] ACPI / PM: Propagate KEY_POWER wakeup events to user space Chen, Hu
2019-03-26 21:49 ` Rafael J. Wysocki
2019-03-28 10:34   ` [PATCH v2] ACPI / PM: Propagate KEY_POWER to user space when resume Chen, Hu
2019-03-28 13:31     ` Hans de Goede
2019-03-29 10:25     ` Pavel Machek
2019-03-29 11:38       ` Hans de Goede
2019-03-29 12:32         ` Pavel Machek [this message]

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=20190329123244.GA20104@amd \
    --to=pavel@ucw.cz \
    --cc=hdegoede@redhat.com \
    --cc=hu1.chen@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@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 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).