Thread (7 messages) read the whole thread 7 messages, 2 authors, 2018-01-03

Re: [PATCH] mmc: sdhci-esdhc-imx: Enable/Disable mmc clock during runtime suspend

From: Michael Nazzareno Trimarchi <michael@amarulasolutions.com>
Date: 2018-01-03 16:58:18

Hi

On Wed, Jan 3, 2018 at 5:56 PM, Ulf Hansson [off-list ref] wrote:
On 3 January 2018 at 17:38, Michael Nazzareno Trimarchi
[off-list ref] wrote:
quoted
Hi

On Wed, Jan 3, 2018 at 5:26 PM, Ulf Hansson [off-list ref] wrote:
quoted
On 21 December 2017 at 14:22, Michael Trimarchi
[off-list ref] wrote:
quoted
mmc clock can be stopped during runtime suspend and restart during runtime
resume. This let us know to not have any clock running and this reduce
the EMI of the device when the bus is not in use

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
---
 drivers/mmc/host/sdhci-esdhc-imx.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 7123ef9..9a5e96f 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -196,6 +196,7 @@ struct pltfm_imx_data {
        struct clk *clk_ipg;
        struct clk *clk_ahb;
        struct clk *clk_per;
+       unsigned int actual_clock;
        enum {
                NO_CMD_PENDING,      /* no multiblock command pending*/
                MULTIBLK_IN_PROCESS, /* exact multiblock cmd in process */
@@ -1346,6 +1347,9 @@ static int sdhci_esdhc_runtime_suspend(struct device *dev)

        ret = sdhci_runtime_suspend_host(host);

+       imx_data->actual_clock = host->mmc->actual_clock;
+       esdhc_pltfm_set_clock(host, 0);
I guess want the clock to stay on "if sdhci_sdio_irq_enabled(host)".
So you should probably move the above inside the below if statement.
Well I'm not quite sure about it. Some wifi chipset has the wakeup
interrupt on external gpio
and someone wakeup from DAT1. Why clock should be required?
The clock should not be needed when using external GPIO (also
described as an out-band IRQ/wakeup), but from DAT1.
Ok, I will re-post new patches
When sdhci_sdio_irq_enabled() returns true, that *should* indicate
that DAT1 is used. Although, there may be reasons to re-visit this
later, because the hole SDIO irq thing around wakeups for sdhci, is
being reworked by Adrian [1].
I will take a look on this post

Regards

Michael
quoted
Anyway I should even rebalance resume.
Yes.

[...]

Kind regards
Uffe

[1]
https://www.spinics.net/lists/linux-mmc/msg47512.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help