All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] improve the SDHCI wakeup support.
@ 2010-11-10 15:28 Giuseppe CAVALLARO
  2010-11-10 15:28 ` Giuseppe CAVALLARO
  2010-11-15 14:52 ` [RFC] improve the SDHCI wakeup support Peppe CAVALLARO
  0 siblings, 2 replies; 17+ messages in thread
From: Giuseppe CAVALLARO @ 2010-11-10 15:28 UTC (permalink / raw)
  To: linux-mmc

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.

Regards
Giuseppe

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2010-11-15 14:52 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [RFC] improve the SDHCI wakeup support Peppe CAVALLARO

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.