From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org, Eric Miao <eric.y.miao@gmail.com>,
Russell King <linux@arm.linux.org.uk>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Grant Likely <grant.likely@linaro.org>
Subject: Re: [PATCH 2/2] spi/pxa2xx: use a flag to check if the device is runtime suspended
Date: Wed, 19 Jun 2013 10:44:37 +0300 [thread overview]
Message-ID: <20130619074437.GF11878@intel.com> (raw)
In-Reply-To: <20130618180948.GP1403@sirena.org.uk>
On Tue, Jun 18, 2013 at 07:09:48PM +0100, Mark Brown wrote:
> On Tue, Jun 18, 2013 at 05:29:45PM +0300, Mika Westerberg wrote:
> > Current code calls pm_runtime_suspended() in the interrupt handler to check
> > if the device is suspended or not. However, runtime PM status of the device
> > is only set to suspended once all PM runtime suspend hooks have executed.
>
> > In our case we have the device bound to the ACPI power domain and its
> > runtime suspend hook will put the device to D3hot (or D3cold if possible).
> > This effectively means that the device is powered off before its state is
> > set to runtime suspended. During this time, it might get an interrupt that
> > is meant for another device (as the interrupt line is shared), and because
> > the device is powered off accessing its registers will return 0xffffffff
> > that the driver misinterprets as an invalid state. When this happens user
> > will see messages like below on the console:
>
> This sounds like a problem which will affect a lot of devices and hence
> ought to be handled better by the PM core or at least frameworks in
> general. Is it really device specific?
No, it's not device specific. However, I've seen it only happen with the
SPI controller on Lynxpoint.
I agree that it is better handled outside of the driver (or provide some
API for drivers). One thing that immediately came to mind is
adding pm_runtime_suspending() that could be used here like:
ssp_int()
{
if (pm_runtime_suspending(dev) || pm_runtime_suspending(dev))
return IRQ_NONE;
...
or something like that?
next prev parent reply other threads:[~2013-06-19 7:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-18 14:29 [PATCH 1/2] spi/pxa2xx: use GFP_ATOMIC in sg table allocation Mika Westerberg
2013-06-18 14:29 ` [PATCH 2/2] spi/pxa2xx: use a flag to check if the device is runtime suspended Mika Westerberg
2013-06-18 18:09 ` Mark Brown
2013-06-19 7:44 ` Mika Westerberg [this message]
2013-06-19 9:23 ` Mark Brown
2013-06-19 9:25 ` Russell King - ARM Linux
2013-06-19 9:39 ` Mark Brown
2013-06-19 10:05 ` Russell King - ARM Linux
2013-06-19 11:02 ` Mika Westerberg
2013-06-19 13:59 ` Mark Brown
2013-06-18 18:11 ` [PATCH 1/2] spi/pxa2xx: use GFP_ATOMIC in sg table allocation Mark Brown
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=20130619074437.GF11878@intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=broonie@kernel.org \
--cc=eric.y.miao@gmail.com \
--cc=grant.likely@linaro.org \
--cc=haojian.zhuang@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.