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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 9 Mar 2016 20:56:38 +0100
From:	Benjamin Tissoires <benjamin.tissoires@...hat.com>
To:	Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Jiri Kosina <jikos@...nel.org>,
	Andrew Duggan <aduggan@...aptics.com>,
	Benson Leung <bleung@...omium.org>,
	Dan Carpenter <dan.carpenter@...cle.com>,
	Gabriele Mazzotta <gabriele.mzt@...il.com>,
	Doug Anderson <dianders@...omium.org>,
	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
	"Rafael J. Wysocki" <rjw@...ysocki.net>
Subject: Re: [PATCH v3] HID: i2c-hid: Fix suspend/resume when already runtime
 suspended

On Mar 09 2016 or thereabouts, Mika Westerberg wrote:
> On Tue, Mar 08, 2016 at 03:03:23PM -0800, Dmitry Torokhov wrote:
> > On ACPI-based systems ACPI power domain code runtime resumes device before
> > calling suspend method, which ensures that i2c-hid suspend code starts with
> > device not in low-power state and with interrupts enabled.
> > 
> > On other systems, especially if device is not a part of any power domain,
> > we may end up calling driver's system-level suspend routine while the
> > device is runtime-suspended (with controller in presumably low power state
> > and interrupts disabled). This will result in interrupts being essentially
> > disabled twice, and we will only re-enable them after both system resume
> > and runtime resume methods complete. Unfortunately i2c_hid_resume() calls
> > i2c_hid_hwreset() and that only works properly if interrupts are enabled.
> > 
> > Also if device is runtime-suspended driver's suspend code may fail if it
> > tries to issue I/O requests.
> > 
> > Let's fix it by runtime-resuming the device if we need to run HID driver's
> > suspend code and also disabling interrupts only if device is not already
> > runtime-suspended. Also on resume we mark the device as running at full
> > power (since that is what resetting will do to it).
> > 
> > Signed-off-by: Doug Anderson <dianders@...omium.org>
> > Signed-off-by: Dmitry Torokhov <dtor@...omium.org>
> 
> Tested on a couple of Intel Skylake and Baytrail based systems and power
> management of I2C connected HID devices still seems to work just fine.
> 
> Tested-by: Mika Westerberg <mika.westerberg@...ux.intel.com>

Well, I have completely no way of testing this myself, and I blindly
trust Mika, Dmitry and the others for doing the right thing :).

Acked-by: Benjamin Tissoires <benjamin.tissoires@...hat.com>

Cheers,
Benjamin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ