All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ludovic Desroches <ludovic.desroches@atmel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Ludovic Desroches <ludovic.desroches@atmel.com>,
	Nicolas Ferre <nicolas.ferre@atmel.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	linux-mmc <linux-mmc@vger.kernel.org>
Subject: Re: [PATCH] sdhci: wakeup from runtime PM
Date: Mon, 11 Apr 2016 14:09:05 +0200	[thread overview]
Message-ID: <20160411120905.GA7269@odux.rfo.atmel.com> (raw)
In-Reply-To: <CAPDyKFqJ4Q9hdsv427GaT_2qFpvv=Nn3rZQUS+P8O7FF-gKgyw@mail.gmail.com>

On Fri, Apr 08, 2016 at 10:35:00AM +0200, Ulf Hansson wrote:
> - linux-kernel list
> 
> On 7 April 2016 at 17:12, Ludovic Desroches <ludovic.desroches@atmel.com> wrote:
> > On Thu, Apr 07, 2016 at 11:11:08AM +0200, Ulf Hansson wrote:
> >> On 5 April 2016 at 14:40, Adrian Hunter <adrian.hunter@intel.com> wrote:
> >> > On 25/03/16 18:05, Ludovic Desroches wrote:
> >> >> Hi,
> >> >>
> >> >> When not using the SDHCI controller, it is logical to save power by suspending
> >> >> it. The issue is that SDHCI assumes that the controller is completely disabled.
> >> >> It means the only way to wake up on a card event is to have a gpio for the card
> >> >> detection (so two pins for the same signal). A possible workaround is to use
> >> >> polling but the controller will be resumed/suspended between each attempts.
> >> >>
> 
> From power consumption point if view we already discussed this
> particular case in an earlier thread, but let me elaborate what I
> think one more time:
> 
> Now, this is relevant for removable cards lacking GPIO card detect, as
> for other cases and non-removable cards I think we are in agreement
> that their is no issue from power consumption point of view, right!?
> 
> 1. The current solution:
> - Use MMC_CAP_NEEDS_POLL which makes the mmc core to re-schedule a
> work once every second to poll for a card (Why is it one second? Could
> we perhaps have that configurable?).
> 
> In case of no card inserted, the polling consists of runtime resuming
> the SDHCI controller and then reading a couple of registers to find
> out if there is a new card. I assume this will be a fast operation. In
> the below calculation I have neglected its impact which of course is a
> simplification.
> 
> This solution allows the driver in runtime suspend to *gate all three
> clocks* used by the SDHCI controller. In-between polling attempts it
> will thus save power.
> 
> Currently the mmc core *always* respects runtime PM autosuspend when
> putting the controller device back to runtime suspend. I suggest we
> change this in cases when the polling operation doesn't detect any
> changes.
> 
> For the sdhci-of-at91 driver case, the autosuspend timeout is set to
> 50 ms (which is a common value among mmc host drivers).
> 
> In the current code this means for a period over ~10 s, *all three
> clocks* will be ungated for 50 ms x 10 times = ~500 ms.
> 
> If we adopt to what I propose above, this time will become significant
> lesser as the autosuspend timer will not be respected.
> 
> 2. What you propose (I think):
> * Don't use MMC_CAP_NEEDS_POLL, but instead rely on the SDHCI
> controller to pick up card detect IRQs in runtime suspended state.
> 
> In case of no card inserted, the controller would then stay runtime
> suspended but with IRQs enabled to deal with card detect IRQs.
> According to what you told me earlier, this means that the controller
> requires one of the three clocks to be ungated in the runtime suspend
> state. So, only two clocks can be managed by runtime PM.
> 
> Assuming that no cards get inserted over a period of ~10 s, *one clock
> will be ungated* for ~10 s.
> 
> 
> Can you show that option 2) is better in saving power than option 1) ?

Unfortunately not. I have discussed with hardware guys. They confirmed me
that the power consumption to keep the interface enabled is very low but it
will be difficult to measure the consumption difference between the two
options because it would be minimal.

If in practice the result was almost the same, it is not useful to
continue this debate. I'll keep the polling workaround and I'll update system
PM callbacks.

[...]

Regards

Ludovic

      parent reply	other threads:[~2016-04-11 12:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-25 16:05 [PATCH] sdhci: wakeup from runtime PM Ludovic Desroches
2016-03-25 16:05 ` Ludovic Desroches
2016-03-25 16:05 ` [PATCH] DRAFT: shdci: allows custom wakeup irqs for " Ludovic Desroches
2016-03-25 16:05   ` Ludovic Desroches
2016-03-25 16:46   ` kbuild test robot
2016-03-25 16:46     ` kbuild test robot
2016-03-25 16:50   ` kbuild test robot
2016-03-25 16:50     ` kbuild test robot
2016-03-25 17:12   ` kbuild test robot
2016-03-25 17:12     ` kbuild test robot
2016-03-25 17:27   ` kbuild test robot
2016-03-25 17:27     ` kbuild test robot
2016-03-25 16:05 ` [PATCH] mmc: sdhci-of-at91: allow the use of controller card detect as wake up Ludovic Desroches
2016-03-25 16:05   ` Ludovic Desroches
2016-03-25 17:11   ` [PATCH] mmc: sdhci-of-at91: fix semicolon.cocci warnings kbuild test robot
2016-03-25 17:11     ` kbuild test robot
2016-03-25 17:11   ` [PATCH] mmc: sdhci-of-at91: allow the use of controller card detect as wake up kbuild test robot
2016-03-25 17:11     ` kbuild test robot
2016-04-05 12:40 ` [PATCH] sdhci: wakeup from runtime PM Adrian Hunter
2016-04-07  9:11   ` Ulf Hansson
2016-04-07 15:12     ` Ludovic Desroches
2016-04-08  8:35       ` Ulf Hansson
2016-04-08 15:19         ` Alan Stern
2016-04-08 20:51           ` Ulf Hansson
2016-04-11 12:09         ` Ludovic Desroches [this message]

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=20160411120905.GA7269@odux.rfo.atmel.com \
    --to=ludovic.desroches@atmel.com \
    --cc=adrian.hunter@intel.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=ulf.hansson@linaro.org \
    /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.