lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240103003355.747335-1-kai.heng.feng@canonical.com>
Date: Wed,  3 Jan 2024 08:33:53 +0800
From: Kai-Heng Feng <kai.heng.feng@...onical.com>
To: jikos@...nel.org,
	benjamin.tissoires@...hat.com
Cc: Kai-Heng Feng <kai.heng.feng@...onical.com>,
	Douglas Anderson <dianders@...omium.org>,
	Maxime Ripard <mripard@...nel.org>,
	Thomas Weißschuh <linux@...ssschuh.net>,
	Johan Hovold <johan+linaro@...nel.org>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	linux-input@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] HID: i2c-hid: Remove SET_POWER SLEEP on system suspend

There's a Cirque touchpad that wakes system up without anything touched
the touchpad. The input report is empty when this happens.
The reason is stated in HID over I2C spec, 7.2.8.2:
"If the DEVICE wishes to wake the HOST from its low power state, it can
issue a wake by asserting the interrupt."

This is fine if OS can put system back to suspend by identifying input
wakeup count stays the same on resume, like Chrome OS Dark Resume [0].
But for regular distro such policy is lacking.

According to commit d9f448e3d71f ("HID: i2c-hid: set power sleep before
shutdown"), SLEEP is required for shutdown, in addition to that, commit
67b18dfb8cfc ("HID: i2c-hid: Remove runtime power management") didn't
notice any power comsumption reduction from SET_POWER SLEEP, so also
remove that to avoid the device asserting the interrupt.

[0] https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/power_manager/docs/dark_resume.md

Signed-off-by: Kai-Heng Feng <kai.heng.feng@...onical.com>
---
 drivers/hid/i2c-hid/i2c-hid-core.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
index 2735cd585af0..dd513dc75cb9 100644
--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -957,9 +957,6 @@ static int i2c_hid_core_suspend(struct i2c_hid *ihid, bool force_poweroff)
 	if (ret < 0)
 		return ret;
 
-	/* Save some power */
-	i2c_hid_set_power(ihid, I2C_HID_PWR_SLEEP);
-
 	disable_irq(client->irq);
 
 	if (force_poweroff || !device_may_wakeup(&client->dev))
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ