From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Doug Anderson <dianders@chromium.org>
Cc: Jiri Kosina <jkosina@suse.cz>,
Andrew Duggan <aduggan@synaptics.com>,
Vincent Huang <vincent.huang@tw.synaptics.com>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
jmaneyrol@invensense.com, borneo.antonio@gmail.com,
seth.forshee@canonical.com, archana.patni@linux.intel.com,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] HID: i2c-hid: Fix suspend/resume when already runtime suspended
Date: Tue, 10 Mar 2015 14:23:07 +0200 [thread overview]
Message-ID: <20150310122307.GM1563@lahna.fi.intel.com> (raw)
In-Reply-To: <1425930287-4615-1-git-send-email-dianders@chromium.org>
On Mon, Mar 09, 2015 at 12:44:47PM -0700, Doug Anderson wrote:
> If the i2c-hid device was runtime suspended and then the system
> suspended itself we'd end up disabling interrupts twice (in
> i2c_hid_runtime_suspend and i2c_hid_suspend) and not reenabling them
> until later when the i2c-hid device was runtime resumed.
> Unfortunately the i2c_hid_resume() calls i2c_hid_hwreset() and that
> only works properly if interrupts are enabled.
>
> We can fix this by taking the advice from "runtime_pm.txt".
> Specifically we'll change i2c-hid to always resume to full power.
> This only works if our parents are also resumed to full power, but
> given the suggestion in "runtime_pm.txt" this seems a reasonable
> assumption.
>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> ---
> Note that this was tested on a 3.14 kernel with backports. Any
> testing that folks can do on ToT is appreciated.
>
> Changes in v2:
> - Move pm_runtime_enable() higher in resume
Hmm, I tried on one machine with Atmel touch panel. I modified i2c-hid.c
a bit to print out when it is running suspend/resume hooks. Here is what
I got:
[ 7.506455] i2c_hid i2c-ATML1000:00: PM: i2c-hid runtime suspend
This is the initialization and after that the device is runtime
suspended.
Now I put the machine to system sleep (using echo mem >
/sys/power/state):
[ 26.988867] i2c_hid i2c-ATML1000:00: PM: i2c-hid runtime resume
[ 27.002957] i2c_hid i2c-ATML1000:00: PM: i2c-hid suspend
So the PM core will kick the device out of runtime suspend before it
suspends it again.
Pressing power button will resume the device:
[ 28.238934] i2c_hid i2c-ATML1000:00: PM: i2c-hid resume
[ 29.941579] i2c_hid i2c-ATML1000:00: PM: i2c-hid runtime suspend
and since the device is not being used, it will runtime suspend itself.
In other words, I'm not sure if this patch is needed. It would be good
if you could do similar testing using mainline kernel (if possible at
all).
next prev parent reply other threads:[~2015-03-10 12:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-09 19:44 [PATCH v2] HID: i2c-hid: Fix suspend/resume when already runtime suspended Doug Anderson
2015-03-10 12:23 ` Mika Westerberg [this message]
2015-03-10 16:12 ` Doug Anderson
2015-03-11 11:20 ` Mika Westerberg
2015-03-11 15:06 ` Doug Anderson
2015-03-12 9:10 ` Mika Westerberg
2015-03-12 11:19 ` Mika Westerberg
2015-03-12 15:24 ` Doug Anderson
2015-03-12 15:28 ` Mika Westerberg
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=20150310122307.GM1563@lahna.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=aduggan@synaptics.com \
--cc=archana.patni@linux.intel.com \
--cc=benjamin.tissoires@redhat.com \
--cc=borneo.antonio@gmail.com \
--cc=dianders@chromium.org \
--cc=dmitry.torokhov@gmail.com \
--cc=jkosina@suse.cz \
--cc=jmaneyrol@invensense.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=seth.forshee@canonical.com \
--cc=vincent.huang@tw.synaptics.com \
/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