From: Pavel Machek <pavel@ucw.cz>
To: Sasha Levin <sashal@kernel.org>
Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org,
Daniel Drake <drake@endlessm.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: Re: [PATCH AUTOSEL 4.14 03/15] Input: i8042 - enable keyboard wakeups by default when s2idle is used
Date: Fri, 26 Oct 2018 11:04:52 +0200 [thread overview]
Message-ID: <20181026090452.GB20200@amd> (raw)
In-Reply-To: <20181022102026.40869-3-sashal@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 4841 bytes --]
On Mon 2018-10-22 06:20:14, Sasha Levin wrote:
> From: Daniel Drake <drake@endlessm.com>
>
> [ Upstream commit 684bec1092b6991ff2a7751e8a763898576eb5c2 ]
>
> Previously, on typical consumer laptops, pressing a key on the keyboard
> when the system is in suspend would cause it to wake up (default or
> unconditional behaviour). This happens because the EC generates a SCI
> interrupt in this scenario.
>
> That is no longer true on modern laptops based on Intel WhiskeyLake,
> including Acer Swift SF314-55G, Asus UX333FA, Asus UX433FN and Asus
> UX533FD. We confirmed with Asus EC engineers that the "Modern Standby"
> design has been modified so that the EC no longer generates a SCI
> in this case; the keyboard controller itself should be used for wakeup.
>
> In order to retain the standard behaviour of being able to use the
> keyboard to wake up the system, enable serio wakeups by default on
> platforms that are using s2idle.
Behaviour change, not a bugfix. Someone may like their laptop sleeping
after keypress, we should not change it in the middle of -stable
series.
>
> Link: https://lkml.kernel.org/r/CAB4CAwfQ0mPMqCLp95TVjw4J0r5zKPWkSvvkK4cpZUGE--w8bQ@mail.gmail.com
> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Signed-off-by: Daniel Drake <drake@endlessm.com>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
> drivers/input/serio/i8042.c | 29 ++++++++++++++++++++---------
> include/linux/suspend.h | 2 ++
> kernel/power/suspend.c | 6 ++++++
> 3 files changed, 28 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
> index 824f4c1c1f31..6462f1798fbb 100644
> --- a/drivers/input/serio/i8042.c
> +++ b/drivers/input/serio/i8042.c
> @@ -1392,15 +1392,26 @@ static void __init i8042_register_ports(void)
> for (i = 0; i < I8042_NUM_PORTS; i++) {
> struct serio *serio = i8042_ports[i].serio;
>
> - if (serio) {
> - printk(KERN_INFO "serio: %s at %#lx,%#lx irq %d\n",
> - serio->name,
> - (unsigned long) I8042_DATA_REG,
> - (unsigned long) I8042_COMMAND_REG,
> - i8042_ports[i].irq);
> - serio_register_port(serio);
> - device_set_wakeup_capable(&serio->dev, true);
> - }
> + if (!serio)
> + continue;
> +
> + printk(KERN_INFO "serio: %s at %#lx,%#lx irq %d\n",
> + serio->name,
> + (unsigned long) I8042_DATA_REG,
> + (unsigned long) I8042_COMMAND_REG,
> + i8042_ports[i].irq);
> + serio_register_port(serio);
> + device_set_wakeup_capable(&serio->dev, true);
> +
> + /*
> + * On platforms using suspend-to-idle, allow the keyboard to
> + * wake up the system from sleep by enabling keyboard wakeups
> + * by default. This is consistent with keyboard wakeup
> + * behavior on many platforms using suspend-to-RAM (ACPI S3)
> + * by default.
> + */
> + if (pm_suspend_via_s2idle() && i == I8042_KBD_PORT_NO)
> + device_set_wakeup_enable(&serio->dev, true);
> }
> }
>
> diff --git a/include/linux/suspend.h b/include/linux/suspend.h
> index 8544357d92d0..950b56d255ac 100644
> --- a/include/linux/suspend.h
> +++ b/include/linux/suspend.h
> @@ -251,6 +251,7 @@ static inline bool idle_should_enter_s2idle(void)
> return unlikely(s2idle_state == S2IDLE_STATE_ENTER);
> }
>
> +extern bool pm_suspend_via_s2idle(void);
> extern void __init pm_states_init(void);
> extern void s2idle_set_ops(const struct platform_s2idle_ops *ops);
> extern void s2idle_wake(void);
> @@ -282,6 +283,7 @@ static inline void pm_set_suspend_via_firmware(void) {}
> static inline void pm_set_resume_via_firmware(void) {}
> static inline bool pm_suspend_via_firmware(void) { return false; }
> static inline bool pm_resume_via_firmware(void) { return false; }
> +static inline bool pm_suspend_via_s2idle(void) { return false; }
>
> static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {}
> static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; }
> diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
> index c0bc2c89697a..405e80219fe4 100644
> --- a/kernel/power/suspend.c
> +++ b/kernel/power/suspend.c
> @@ -62,6 +62,12 @@ static DECLARE_WAIT_QUEUE_HEAD(s2idle_wait_head);
> enum s2idle_states __read_mostly s2idle_state;
> static DEFINE_RAW_SPINLOCK(s2idle_lock);
>
> +bool pm_suspend_via_s2idle(void)
> +{
> + return mem_sleep_current == PM_SUSPEND_TO_IDLE;
> +}
> +EXPORT_SYMBOL_GPL(pm_suspend_via_s2idle);
> +
> void s2idle_set_ops(const struct platform_s2idle_ops *ops)
> {
> lock_system_sleep();
--
(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 --]
next prev parent reply other threads:[~2018-10-26 9:04 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-22 10:20 [PATCH AUTOSEL 4.14 01/15] ARM: dts: imx53-qsb: disable 1.2GHz OPP Sasha Levin
2018-10-22 10:20 ` [PATCH AUTOSEL 4.14 02/15] s390/hibernate: fix error handling when suspend cpu != resume cpu Sasha Levin
2018-10-26 9:05 ` Pavel Machek
2018-10-26 9:22 ` Greg KH
2018-10-26 10:15 ` Pavel Machek
2018-10-26 11:09 ` Sasha Levin
2018-10-26 12:18 ` Gerald Schaefer
2018-10-22 10:20 ` [PATCH AUTOSEL 4.14 03/15] Input: i8042 - enable keyboard wakeups by default when s2idle is used Sasha Levin
2018-10-26 9:04 ` Pavel Machek [this message]
2018-10-26 10:56 ` Sasha Levin
2018-10-22 10:20 ` [PATCH AUTOSEL 4.14 04/15] Input: mousedev - add a schedule point in mousedev_write() Sasha Levin
2018-10-22 10:20 ` [PATCH AUTOSEL 4.14 05/15] perf python: Use -Wno-redundant-decls to build with PYTHON=python3 Sasha Levin
2018-10-22 10:20 ` [PATCH AUTOSEL 4.14 06/15] Input: evdev - add a schedule point in evdev_write() Sasha Levin
2018-10-22 10:20 ` [PATCH AUTOSEL 4.14 07/15] Input: uinput - add a schedule point in uinput_inject_events() Sasha Levin
2018-10-22 10:20 ` [PATCH AUTOSEL 4.14 08/15] rxrpc: Don't check RXRPC_CALL_TX_LAST after calling rxrpc_rotate_tx_window() Sasha Levin
2018-10-22 10:20 ` [PATCH AUTOSEL 4.14 09/15] rxrpc: Only take the rwind and mtu values from latest ACK Sasha Levin
2018-10-22 10:20 ` [PATCH AUTOSEL 4.14 10/15] rxrpc: Fix connection-level abort handling Sasha Levin
2018-10-22 10:20 ` [PATCH AUTOSEL 4.14 11/15] net: ena: fix warning in rmmod caused by double iounmap Sasha Levin
2018-10-22 10:20 ` [PATCH AUTOSEL 4.14 12/15] net: ena: fix NULL dereference due to untimely napi initialization Sasha Levin
2018-10-22 10:20 ` [PATCH AUTOSEL 4.14 13/15] libertas: call into generic suspend code before turning off power Sasha Levin
2018-10-22 10:20 ` [PATCH AUTOSEL 4.14 14/15] selftests: rtnetlink.sh explicitly requires bash Sasha Levin
2018-10-22 10:20 ` [PATCH AUTOSEL 4.14 15/15] fs/fat/fatent.c: add cond_resched() to fat_count_free_clusters() Sasha Levin
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=20181026090452.GB20200@amd \
--to=pavel@ucw.cz \
--cc=dmitry.torokhov@gmail.com \
--cc=drake@endlessm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sashal@kernel.org \
--cc=stable@vger.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