linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Magnus Damm <magnus.damm@gmail.com>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	linux-mmc@vger.kernel.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH] mmc: tmio: Don't access hardware registers after stopping clocks
Date: Thu, 14 Jun 2012 21:48:44 +0000	[thread overview]
Message-ID: <201206142348.44804.rjw@sisk.pl> (raw)
In-Reply-To: <1786480.seckEUc993@avalon>

On Thursday, June 14, 2012, Laurent Pinchart wrote:
> Hi Rafael,
> 
> On Thursday 14 June 2012 21:37:26 Rafael J. Wysocki wrote:
> > On Thursday, June 14, 2012, Laurent Pinchart wrote:
> > > On Thursday 14 June 2012 20:12:33 Magnus Damm wrote:
> > > > On Tue, Jun 12, 2012 at 9:57 PM, Laurent Pinchart wrote:
> > > > > The tmio_mmc_set_ios() function configures the MMC power, clock and
> > > > > bus width. When the MMC controller gets powered off, runtime PM
> > > > > switches the MSTP clock off. Writing to to CTL_SD_MEM_CARD_OPT
> > > > > register afterwards fails and prints an error message to the kernel
> > > > > log.
> > > > > 
> > > > > As configuring the bus width is pointless when the interface gets
> > > > > powered down, skip the operation when power is off.
> > > > > 
> > > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > > 
> > > > First of all, thanks for reporting this issue and coming up with a fix!
> > > 
> > > You're welcome. You can expect more of them ;-)
> > > 
> > > > Can you please explain a bit more about when this triggers? Is this
> > > > related to suspend-to-ram perhaps? Which hardware platform? Is
> > > > CONFIG_PM_RUNTIME=y set?
> > > 
> > > I've noticed the problem on the Armadillo board with CONFIG_PM_RUNTIME=y.
> > > The driver spits out "timeout waiting for SD bus idle" error messages
> > > more or less continuously.
> > > 
> > > > I suspect that this may be a side effect of the current PM code used
> > > > on the A1 SoC (which is hooked up on the armadillo board).
> > > > 
> > > > In short, the A1 SoC does not yet make use of PM domains, but AP4 and
> > > > the mackerel board (sh7372 based) is using PM domains.
> > > 
> > > Does this mean that runtime PM is a no-op on A1 ? That would surprise me,
> > > as turning CONFIG_PM_RUNTIME off gets rid of the problem, so runtime PM
> > > is somehow involved. Even if the power domain does not get turned off,
> > > can't the MSTP clock be turned off ?
> > 
> > The problem is, most likely, that with CONFIG_PM_RUNTIME set the code in
> > drivers/sh/pm_runtime.c triggers and that causes default_pm_domain to be
> > used.
> > 
> > So, I don't really think we need to "fix" every driver in turn,
> > default_pm_domain seems to be what needs fixing.  I'm not exactly sure
> > how to fix it at the moment, though.
> 
> But isn't there still an issue in the driver itself ? If my understanding is 
> correct, calling pm_runtime_put() essentially means "I won't need to touch the 
> device from now on, it can be suspended it 
> needed/useful/appropriate/whatever". The runtime PM core is then free to turn 
> the power domain and/or clock off synchronously or with a delay, or do 
> nothing. After signaling that it won't need to touch the device, the driver 
> should really avoid touching the device until the next pm_runtime_get_sync() 
> call.

That's correct, the hardware shouldn't be touched after runtime suspend.

Thanks,
Rafael

  reply	other threads:[~2012-06-14 21:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-12 12:57 [PATCH] mmc: tmio: Don't access hardware registers after stopping clocks Laurent Pinchart
2012-06-12 13:31 ` Guennadi Liakhovetski
2012-06-12 21:28   ` Laurent Pinchart
2012-06-14 11:12 ` Magnus Damm
2012-06-14 19:12   ` Laurent Pinchart
2012-06-14 19:37     ` Rafael J. Wysocki
2012-06-14 20:34       ` Laurent Pinchart
2012-06-14 21:48         ` Rafael J. Wysocki [this message]
2012-06-15 10:03           ` Rafael J. Wysocki
2012-06-15 10:17             ` Laurent Pinchart
2012-06-15 19:08               ` Rafael J. Wysocki
2012-06-15  0:47     ` Magnus Damm
2012-06-15  7:09       ` Guennadi Liakhovetski
2012-06-19  6:53         ` Magnus Damm
2012-06-19  9:34           ` Laurent Pinchart

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=201206142348.44804.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=g.liakhovetski@gmx.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.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;
as well as URLs for NNTP newsgroup(s).