public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: Ulf Hansson <ulf.hansson@stericsson.com>
Cc: linux-mmc@vger.kernel.org, eliad@wizery.com, nico@fluxnic.net
Subject: Re: [Query] mmc: core "MMC_PM_KEEP_POWER"
Date: Tue, 22 Nov 2011 08:53:37 -0500	[thread overview]
Message-ID: <87ty5w2rha.fsf@laptop.org> (raw)
In-Reply-To: <4ECBA3B1.1010808@stericsson.com> (Ulf Hansson's message of "Tue, 22 Nov 2011 14:29:21 +0100")

Hi,

On Tue, Nov 22 2011, Ulf Hansson wrote:
> Hi,
>
> In mmc_resume_host we clear the MMC_PM_KEEP_POWER flag from the
> pm_flags bitfield. This is done by a patch from Eliad Peller a while
> ago, "mmc: clear MMC_PM_KEEP_POWER flag on resume"
>
> I would like to understand if there are any reason to why we want to
> clear this flag after we done a resume. I think it will add complexity
> to an sdio function driver since it must update this flag for after
> each suspend/resume sequence. Should it not just be enough to do this
> during the initialization of the sdio func driver.

The sdio function driver should just call sdio_set_host_pm_flags() in
its suspend function, if it wants to stay awake at the next suspend.
It's just one line of code, so I don't think it's overly complex.

We clear the flag because that's how the API is defined --
sdio_set_host_pm_flags() says "This must be called, if needed, each
time the suspend method of the function driver is called".

There's a separate question of "Why is the API this way, and should
we change it?".  I think the API ended up this way because it was
created for a wifi device where a suspend would usually happen while
you're unassociated, so you don't need to preserve power (because
nothing interesting can happen to wake you up), but will sometimes
happen while you're associated, in which case you do.  It sounds like
you're considering a device that *always* wants to stay awake, which
is different to the rest of the users of this API.

But it's just the difference between (your proposal) having
sdio_set_host_pm_flags() be called during init, and (the API) having
sdio_set_host_pm_flags() be called during suspend.  It's the same
line of code either way, so I don't see why it's annoying this way.

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

  parent reply	other threads:[~2011-11-22 13:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-22 13:29 [Query] mmc: core "MMC_PM_KEEP_POWER" Ulf Hansson
2011-11-22 13:44 ` Eliad Peller
2011-11-22 13:52   ` Nicolas Pitre
2011-11-22 13:53 ` Chris Ball [this message]
2011-11-22 15:33   ` Ulf Hansson
2011-11-22 15:50     ` Chris Ball
2011-11-23  8:53       ` Ulf Hansson

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=87ty5w2rha.fsf@laptop.org \
    --to=cjb@laptop.org \
    --cc=eliad@wizery.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=nico@fluxnic.net \
    --cc=ulf.hansson@stericsson.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