public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Peppe CAVALLARO <peppe.cavallaro@st.com>
To: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
	Wolfram Sang <w.sang@pengutronix.de>,
	"nico@fluxnic.net" <nico@fluxnic.net>
Subject: Re: [RFC] improve the SDHCI wakeup support.
Date: Mon, 15 Nov 2010 15:52:19 +0100	[thread overview]
Message-ID: <4CE14923.4090305@st.com> (raw)
In-Reply-To: <1289402889-14160-1-git-send-email-peppe.cavallaro@st.com>

Hello

On 11/10/2010 4:28 PM, Giuseppe CAVALLARO wrote:
>
> Hello.
>
> The following patches, currently built against an ST Kernel
> "2.6.32", show how to improve the wakeup support in the SDHCI
> device driver.
>
> Note:
> I'm going to rework them, for example, against the mmc-next
> after performing the review process and, obviously, if you
> think that they can be actually useful.
>
> Indeed, on a STB, it can be nice to have the capability to
> wake-up the system when a card is inserted ;-).
>
> This work allows the SDHCI to wake up the system
> on the following events:
>  1) Card Interrupts.
>  2) Card Insertion.
>  3) Card Removal.
>
> To do that the sdhci has to perform some operations
> described in the patch named:
>   "mmc_sdhci: improve the wake-up support"
>
> A new parameter has been also added to select which wakeup
> event has to be used. At any rate, a device based on
> the sdchi, e.g. sdhci-pci, can use a default mode (that
> can be modified at run-time as well).
> In case of the sdhci-pci the "Card Interrupt event" has not
> been modified according to the logic behind the recent commit:
>   5f619704d18b93869d045abc49e09cdba109b04b
>
> The define MMC_PM_KEEP_POWER has been used to notify that
> a device driver (e.g. sdhci-pltfm) want to wakeup the system.
> In any case, the logic for programming the HC register is
> embedded in the suspend and it's self contained.
>
> In the sdhci-pltfm, it has been also introduced another fix:
> see patch named:
>  "mmc: sdhci-pltfm calls the sdhci_alloc_host with pdev->dev"
> The driver calls the sdhci_alloc_host passing as device pointer
> the parent.
> Note: parent name is "platform" and dev name is "sdhci.0".
> IMO it makes sense to pass the pdev->dev pointer instead of the
> parent. This also helps when invoke the device_set_wakeup_capable etc.
>
> This is a piece of output on our ST platforms:
>
>  bash-3.00# echo 2 > /sys/module/sdhci/parameters/wakeup
>  bash-3.00# echo standby > /sys/power/state
>
>  PM: Syncing filesystems ... done.
>  Freezing user space processes ... (elapsed 0.00 seconds) done.
>  Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.
>  [STM][PM] Analyzing the wakeup devices
>  [STM][PM] -> device sdhci.0 can wakeup
>  [STM][PM] -> device stm-asc.0 can wakeup
>
> [snip]
>
> As shown above, to modify at run time the wakeup event we can do:
>  bash-3.00 echo X > /sys/module/sdhci/parameters/wakeup
>
> where X can be:
>  0: no wakeup
>  1: Card Interrupts
>  2: Card Insertion
>  3: Card Removal
>
> Hmm, maybe it's worth having more parameters instead of the
> wakeup. I mean, something like this (welcome feedback):
>  wake_on_card_int
>  wake_on_card_ins
>  wake_on_card_rem
>
> Welcome advice and feedback as usual.
>

I've reworked the patches, I sent the mailing list last week, now built
against the mmc-next Git repository.
I've removed some piece of the code commented by yourself (in this first
thread of emails) and re-generated a single path (marked as V2).

Many thanks for your advice and welcome feedback on the new patch.

Regards
Peppe

      parent reply	other threads:[~2010-11-15 14:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-10 15:28 [RFC] improve the SDHCI wakeup support Giuseppe CAVALLARO
2010-11-10 15:28 ` Giuseppe CAVALLARO
2010-11-10 15:28   ` [PATCH (1/5)] mmc: sdhci-pltfm calls the sdhci_alloc_host with pdev->dev Giuseppe CAVALLARO
2010-11-10 15:28     ` [PATCH 2/5] mmc: do not clear the host->pm_flags when suspend Giuseppe CAVALLARO
2010-11-10 15:28       ` [PATCH 3/5] mmc_sdhci: improve the wake-up support Giuseppe CAVALLARO
2010-11-10 15:28         ` [PATCH 4/5] mmc: sdhci-pci invokes the sdhci_enable_irq_wakeups with SDHCI_WAKE_ON_INT Giuseppe CAVALLARO
2010-11-10 15:28           ` [PATCH 5/5] mmc: sdhci-pltfm can wake up Giuseppe CAVALLARO
2010-11-10 20:28       ` [PATCH 2/5] mmc: do not clear the host->pm_flags when suspend Ohad Ben-Cohen
2010-11-11  7:24         ` Peppe CAVALLARO
2010-11-11 23:45           ` Ohad Ben-Cohen
2010-11-12  8:06             ` Peppe CAVALLARO
2010-11-12  4:37       ` Nicolas Pitre
2010-11-10 15:43     ` [PATCH (1/5)] mmc: sdhci-pltfm calls the sdhci_alloc_host with pdev->dev Wolfram Sang
2010-11-11  7:16       ` Peppe CAVALLARO
2010-11-11  7:48         ` Wolfram Sang
2010-11-11 10:58           ` Peppe CAVALLARO
2010-11-15 14:52 ` Peppe CAVALLARO [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=4CE14923.4090305@st.com \
    --to=peppe.cavallaro@st.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=nico@fluxnic.net \
    --cc=ohad@wizery.com \
    --cc=w.sang@pengutronix.de \
    /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