linux-kernel.vger.kernel.org archive mirror
 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>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Nicolas Ferre <nicolas.ferre@atmel.com>,
	<linux-pm@vger.kernel.org>, <rjw@rjwysocki.net>,
	<khilman@kernel.org>
Subject: Re: [PATCH] mmc: sdhci-of-at91: fix wakeup issue when using runtime pm
Date: Wed, 9 Mar 2016 17:38:09 +0100	[thread overview]
Message-ID: <20160309163809.GM2690@odux.rfo.atmel.com> (raw)
In-Reply-To: <CAPDyKFpDHooacBrTXQzinO4U10SeoedybN5HZ5y1bwbO-F04ug@mail.gmail.com>

+ PM mailing list since the discussion is mixing PM and sdhci

On Tue, Mar 08, 2016 at 10:56:31PM +0100, Ulf Hansson wrote:
> +Ludovic
> 
> On 8 March 2016 at 22:54, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> > On 4 March 2016 at 14:48, Ludovic Desroches <ludovic.desroches@atmel.com> wrote:

[snip]

> >>
> >> Coming back to the initial discussion and patch which were motivated by
> >> the fact that after runtime suspend I can't wake-up on card detect event,
> >> I have the feeling we don't have the same assumption about runtime PM.
> >>
> >> From what you and Adrian told me, I should not use runtime PM if I have
> >> no way to wake-up. In your minds, the way to wake-up is to use an
> >> externel GPIO because the controller will be 'totally' disabled, isn't it?
> >
> > I agree to the first part here.
> >
> > Although, as you also have the option to use polling for card detect,
> > this actually means you don't really *need* to have a wakeup
> > configured. Especially in the case where you don't have GPIO card
> > detect.
> >
> > In that way, *all* the clocks can gated in between the polling
> > attempts, thus you will save power even in the polling mode
> > configuration and when runtime PM is enabled.
> >

As you said, I can gate all the clocks but only between attempts.
Regularly, I will resume and suspend my controller to perform the card
detection. I don't know if it is a better solution than keeping one
clock enabled and waiting for an interrupt to enable the other ones.

> >>
> >> On my side, runtime PM allows me to save power when the sdhci controller
> >> is not used. If I can disable two clocks out of three, I should use
> >> runtime PM. Do you agree?
> >>
> >> If not, tell me how I can convince you :) Otherwise, next step is to rework
> >> my patch but I think I have no other solution that not calling
> >> sdhci_runtime_suspend_host if I expect to use the card detect irq of the
> >> controller.
> >
> > So, to summarize.
> >
> > I think the best fix is to add a clever check in ->probe() and then
> > enable polling when you can't rely on GPIO card detect IRQ.
> >
> > Moreover, to have a robust solution, you also need to clear
> > SDHCI_QUIRK_BROKEN_CARD_DETECTION for your sdhci variant, as otherwise
> > the "broken-cd" DT binding could wrongly be used for this variant.
> >
> > Does that make sense?


Well I don't agree totally because I have the feeling to use a
workaround because if sdhci_runtime_suspend_host has been called the
controlled is considered as 'disabled' then we won't deal with its IRQs.

I would like to move forward on this issue so it could be a trade-off.

Since the sdhci layer is going to be reworked, maybe it could be
interesting to have another approach of runtime PM to get more
flexibility.


Regards

Ludovic

  reply	other threads:[~2016-03-09 16:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-11 13:48 [PATCH] mmc: sdhci-of-at91: fix card detect when using runtime PM Ludovic Desroches
2016-02-11 15:10 ` Ulf Hansson
2016-02-12  8:38   ` Ludovic Desroches
2016-02-12 11:01     ` Ulf Hansson
2016-02-12 12:04       ` Ludovic Desroches
2016-02-13  9:56         ` [PATCH] mmc: sdhci-of-at91: fix wakeup issue when using runtime pm Ludovic Desroches
2016-02-16 14:38           ` Ulf Hansson
2016-02-16 15:22             ` Ludovic Desroches
2016-02-17 10:35               ` Ludovic Desroches
2016-03-04  9:09                 ` Ulf Hansson
2016-03-04  9:12                   ` Ulf Hansson
2016-03-04 13:48                   ` Ludovic Desroches
2016-03-08 21:54                     ` Ulf Hansson
2016-03-08 21:56                       ` Ulf Hansson
2016-03-09 16:38                         ` Ludovic Desroches [this message]
2016-03-10 10:30                           ` Ludovic Desroches
2016-03-11 15:55                             ` Ludovic Desroches
2016-03-16 11:04                             ` Ulf Hansson
2016-02-25  9:49           ` Ludovic Desroches

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=20160309163809.GM2690@odux.rfo.atmel.com \
    --to=ludovic.desroches@atmel.com \
    --cc=adrian.hunter@intel.com \
    --cc=khilman@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=rjw@rjwysocki.net \
    --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 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).