Re: [PATCH] mmc: debugfs: add runtime pm when cat ios or clock file node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24/04/17 10:03, Haibo Chen wrote:
> MMC core code add 'MMC_CAP_RUNTIME_RESUME', postpone the real card
> resume operation from bus_resume to bus_runtime_resume. So after
> system resume, for non-removable-card, it still not really resume.
> At this point, if user cat the ios or clock node, only can get zero
> data although the mmc/sd card is still present.

If you ask me, getting zero is correct.

> 
> This patch add mmc_get_card() to make sure card really resume back
> when user cat ios or clock debugfs file node, then user can get the
> correct information.

Can't the user runtime resume the card / host controller and then look at ios?

> 
> Signed-off-by: Haibo Chen <haibo.chen@xxxxxxx>
> ---
>  drivers/mmc/core/debugfs.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
> index a1fba57..23ec9d3 100644
> --- a/drivers/mmc/core/debugfs.c
> +++ b/drivers/mmc/core/debugfs.c
> @@ -58,6 +58,9 @@ static int mmc_ios_show(struct seq_file *s, void *data)
>  	struct mmc_ios	*ios = &host->ios;
>  	const char *str;
>  
> +	if (host->card)
> +		mmc_get_card(host->card);
> +
>  	seq_printf(s, "clock:\t\t%u Hz\n", ios->clock);
>  	if (host->actual_clock)
>  		seq_printf(s, "actual clock:\t%u Hz\n", host->actual_clock);
> @@ -194,6 +197,9 @@ static int mmc_ios_show(struct seq_file *s, void *data)
>  	}
>  	seq_printf(s, "driver type:\t%u (%s)\n", ios->drv_type, str);
>  
> +	if (host->card)
> +		mmc_put_card(host->card);
> +
>  	return 0;
>  }
>  
> @@ -213,7 +219,11 @@ static int mmc_clock_opt_get(void *data, u64 *val)
>  {
>  	struct mmc_host *host = data;
>  
> +	if (host->card)
> +		mmc_get_card(host->card);
>  	*val = host->ios.clock;
> +	if (host->card)
> +		mmc_put_card(host->card);
>  
>  	return 0;
>  }
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux