All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] mmc: sdhci-pxav3: don't disable clocks when we might get an interrupt
       [not found] <20180514215645.17592-1-tommyhebb@gmail.com>
@ 2018-05-15  5:59 ` Adrian Hunter
  2018-05-15  6:18   ` Tom Hebb
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian Hunter @ 2018-05-15  5:59 UTC (permalink / raw)
  To: Thomas Hebb, linux-kernel
  Cc: Ulf Hansson,
	open list:SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI...)

On 15/05/18 00:56, Thomas Hebb wrote:
> Currently, runtime_suspend() unconditionally disables the clock gates
> for the controller, which means that it's unable to receive interrupts
> generated by connected SDIO cards.

We currently get / put runtime pm with enable / disable of the SDIO IRQ
(refer sdhci_enable_sdio_irq()) so are you sure this is needed?

> 
> Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
> ---
>  drivers/mmc/host/sdhci-pxav3.c | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
> index a34434166ca7..59760f3cc1d7 100644
> --- a/drivers/mmc/host/sdhci-pxav3.c
> +++ b/drivers/mmc/host/sdhci-pxav3.c
> @@ -562,9 +562,11 @@ static int sdhci_pxav3_runtime_suspend(struct device *dev)
>  	if (host->tuning_mode != SDHCI_TUNING_MODE_3)
>  		mmc_retune_needed(host->mmc);
>  
> -	clk_disable_unprepare(pxa->clk_io);
> -	if (!IS_ERR(pxa->clk_core))
> -		clk_disable_unprepare(pxa->clk_core);
> +	if (!sdhci_sdio_irq_enabled(host)) {
> +		clk_disable_unprepare(pxa->clk_io);
> +		if (!IS_ERR(pxa->clk_core))
> +			clk_disable_unprepare(pxa->clk_core);
> +	}
>  
>  	return 0;
>  }
> @@ -575,9 +577,11 @@ static int sdhci_pxav3_runtime_resume(struct device *dev)
>  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
>  	struct sdhci_pxa *pxa = sdhci_pltfm_priv(pltfm_host);
>  
> -	clk_prepare_enable(pxa->clk_io);
> -	if (!IS_ERR(pxa->clk_core))
> -		clk_prepare_enable(pxa->clk_core);
> +	if (!sdhci_sdio_irq_enabled(host)) {
> +		clk_prepare_enable(pxa->clk_io);
> +		if (!IS_ERR(pxa->clk_core))
> +			clk_prepare_enable(pxa->clk_core);
> +	}
>  
>  	return sdhci_runtime_resume_host(host);
>  }
> 

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

* Re: [PATCH] mmc: sdhci-pxav3: don't disable clocks when we might get an interrupt
  2018-05-15  5:59 ` [PATCH] mmc: sdhci-pxav3: don't disable clocks when we might get an interrupt Adrian Hunter
@ 2018-05-15  6:18   ` Tom Hebb
  2018-05-15  6:37     ` Adrian Hunter
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Hebb @ 2018-05-15  6:18 UTC (permalink / raw)
  To: Adrian Hunter, linux-kernel
  Cc: Ulf Hansson,
	open list:SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI...)

Hi,

On 05/15/2018 01:59 AM, Adrian Hunter wrote:
> On 15/05/18 00:56, Thomas Hebb wrote:
>> Currently, runtime_suspend() unconditionally disables the clock gates
>> for the controller, which means that it's unable to receive interrupts
>> generated by connected SDIO cards.
> 
> We currently get / put runtime pm with enable / disable of the SDIO IRQ
> (refer sdhci_enable_sdio_irq()) so are you sure this is needed?

You're correct; this patch is unnecessary. I wrote it before
923713b35745 ("mmc: sdhci: Disable runtime pm when the sdio_irq is
enabled"), and it was needed then. Sorry for the noise.

FYI, sdhci-esdhc-imx still checks the IRQ in its suspend/resume
functions. That's one of the things that misled me to think this patch
was still relevant.

>>
>> Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
>> ---
>>  drivers/mmc/host/sdhci-pxav3.c | 16 ++++++++++------
>>  1 file changed, 10 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
>> index a34434166ca7..59760f3cc1d7 100644
>> --- a/drivers/mmc/host/sdhci-pxav3.c
>> +++ b/drivers/mmc/host/sdhci-pxav3.c
>> @@ -562,9 +562,11 @@ static int sdhci_pxav3_runtime_suspend(struct device *dev)
>>  	if (host->tuning_mode != SDHCI_TUNING_MODE_3)
>>  		mmc_retune_needed(host->mmc);
>>  
>> -	clk_disable_unprepare(pxa->clk_io);
>> -	if (!IS_ERR(pxa->clk_core))
>> -		clk_disable_unprepare(pxa->clk_core);
>> +	if (!sdhci_sdio_irq_enabled(host)) {
>> +		clk_disable_unprepare(pxa->clk_io);
>> +		if (!IS_ERR(pxa->clk_core))
>> +			clk_disable_unprepare(pxa->clk_core);
>> +	}
>>  
>>  	return 0;
>>  }
>> @@ -575,9 +577,11 @@ static int sdhci_pxav3_runtime_resume(struct device *dev)
>>  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
>>  	struct sdhci_pxa *pxa = sdhci_pltfm_priv(pltfm_host);
>>  
>> -	clk_prepare_enable(pxa->clk_io);
>> -	if (!IS_ERR(pxa->clk_core))
>> -		clk_prepare_enable(pxa->clk_core);
>> +	if (!sdhci_sdio_irq_enabled(host)) {
>> +		clk_prepare_enable(pxa->clk_io);
>> +		if (!IS_ERR(pxa->clk_core))
>> +			clk_prepare_enable(pxa->clk_core);
>> +	}
>>  
>>  	return sdhci_runtime_resume_host(host);
>>  }
>>
> 

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

* Re: [PATCH] mmc: sdhci-pxav3: don't disable clocks when we might get an interrupt
  2018-05-15  6:18   ` Tom Hebb
@ 2018-05-15  6:37     ` Adrian Hunter
  0 siblings, 0 replies; 3+ messages in thread
From: Adrian Hunter @ 2018-05-15  6:37 UTC (permalink / raw)
  To: Tom Hebb, linux-kernel
  Cc: Ulf Hansson,
	open list:SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI...),
	Benoît Thébaudeau, Michael Trimarchi, Andrew Gabbasov

On 15/05/18 09:18, Tom Hebb wrote:
> Hi,
> 
> On 05/15/2018 01:59 AM, Adrian Hunter wrote:
>> On 15/05/18 00:56, Thomas Hebb wrote:
>>> Currently, runtime_suspend() unconditionally disables the clock gates
>>> for the controller, which means that it's unable to receive interrupts
>>> generated by connected SDIO cards.
>>
>> We currently get / put runtime pm with enable / disable of the SDIO IRQ
>> (refer sdhci_enable_sdio_irq()) so are you sure this is needed?
> 
> You're correct; this patch is unnecessary. I wrote it before
> 923713b35745 ("mmc: sdhci: Disable runtime pm when the sdio_irq is
> enabled"), and it was needed then. Sorry for the noise.
> 
> FYI, sdhci-esdhc-imx still checks the IRQ in its suspend/resume
> functions. That's one of the things that misled me to think this patch
> was still relevant.

+ a few people that have worked on sdhci-esdhc-imx

> 
>>>
>>> Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
>>> ---
>>>  drivers/mmc/host/sdhci-pxav3.c | 16 ++++++++++------
>>>  1 file changed, 10 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
>>> index a34434166ca7..59760f3cc1d7 100644
>>> --- a/drivers/mmc/host/sdhci-pxav3.c
>>> +++ b/drivers/mmc/host/sdhci-pxav3.c
>>> @@ -562,9 +562,11 @@ static int sdhci_pxav3_runtime_suspend(struct device *dev)
>>>  	if (host->tuning_mode != SDHCI_TUNING_MODE_3)
>>>  		mmc_retune_needed(host->mmc);
>>>  
>>> -	clk_disable_unprepare(pxa->clk_io);
>>> -	if (!IS_ERR(pxa->clk_core))
>>> -		clk_disable_unprepare(pxa->clk_core);
>>> +	if (!sdhci_sdio_irq_enabled(host)) {
>>> +		clk_disable_unprepare(pxa->clk_io);
>>> +		if (!IS_ERR(pxa->clk_core))
>>> +			clk_disable_unprepare(pxa->clk_core);
>>> +	}
>>>  
>>>  	return 0;
>>>  }
>>> @@ -575,9 +577,11 @@ static int sdhci_pxav3_runtime_resume(struct device *dev)
>>>  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
>>>  	struct sdhci_pxa *pxa = sdhci_pltfm_priv(pltfm_host);
>>>  
>>> -	clk_prepare_enable(pxa->clk_io);
>>> -	if (!IS_ERR(pxa->clk_core))
>>> -		clk_prepare_enable(pxa->clk_core);
>>> +	if (!sdhci_sdio_irq_enabled(host)) {
>>> +		clk_prepare_enable(pxa->clk_io);
>>> +		if (!IS_ERR(pxa->clk_core))
>>> +			clk_prepare_enable(pxa->clk_core);
>>> +	}
>>>  
>>>  	return sdhci_runtime_resume_host(host);
>>>  }
>>>
>>
> 

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

end of thread, other threads:[~2018-05-15  6:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20180514215645.17592-1-tommyhebb@gmail.com>
2018-05-15  5:59 ` [PATCH] mmc: sdhci-pxav3: don't disable clocks when we might get an interrupt Adrian Hunter
2018-05-15  6:18   ` Tom Hebb
2018-05-15  6:37     ` Adrian Hunter

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.