From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Mark Brown <broonie@kernel.org>,
linux-kernel@vger.kernel.org, Eric Miao <eric.y.miao@gmail.com>,
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 14:02:44 +0300 [thread overview]
Message-ID: <20130619110244.GH11878@intel.com> (raw)
In-Reply-To: <20130619100515.GK2718@n2100.arm.linux.org.uk>
On Wed, Jun 19, 2013 at 11:05:15AM +0100, Russell King - ARM Linux wrote:
> On Wed, Jun 19, 2013 at 10:39:38AM +0100, Mark Brown wrote:
> > On Wed, Jun 19, 2013 at 10:25:08AM +0100, Russell King - ARM Linux wrote:
> > > On Tue, Jun 18, 2013 at 07:09:48PM +0100, Mark Brown wrote:
> >
> > > > 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?
> >
> > > It's always been something that has been recommended to be dealt with
> > > by the driver. If reading the interrupt status you read ~0, then it
> > > likely is because the device is powered down or removed from the system.
> >
> > > PCMCIA drivers have done this for years.
> >
> > I know, some PCI devices too. It's not just an issue for memory mapped
> > devices, the same thing happens with devices on other buses - there's a
> > whole bunch of issues around moving out of the various suspend states
> > and getting interrupts (things like getting an interrupt controller
> > waking up and delivering interrupts before the control bus for a device
> > connected to it has woken up).
> >
> > The driver does need to be the one deciding what to do about being in
> > suspend but we really ought to be able to do something without having to
> > interact with the hardware partly just for neatness but more because on
> > general buses the error handling is too painful.
>
> And that's why doing it by "read the ISR and check its value" is the
> best way, and not doing the "what state does the kernel think this
> device is in".
This sounds the simplest thing that solves the problem with the Lynxpoint
SPI controller driver. Then I don't need to add any new flags to the
private structure but just check that if reading the status register
returns ~0 and bail out in that case.
next prev parent reply other threads:[~2013-06-19 10:58 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
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 [this message]
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=20130619110244.GH11878@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).