diff options
author | Haibo Chen <haibo.chen@nxp.com> | 2017-04-17 17:43:00 +0800 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | daa04d745e71230cc224e9dc3673fa883c1f610a (patch) | |
tree | a1cad70cb90b21a3efdefc76d69be494cef5c1fa /drivers/mmc/core/debugfs.c | |
parent | f23d254803c0085487d36307cb36bfe88319c720 (diff) |
MLK-14662 mmc: debugfs: add runtime pm when cat ios or clock file node
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 get zero
data although the mmc/sd card is still present.
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.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Diffstat (limited to 'drivers/mmc/core/debugfs.c')
-rw-r--r-- | drivers/mmc/core/debugfs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c index c8451ce557ae..01b35c0d0d36 100644 --- a/drivers/mmc/core/debugfs.c +++ b/drivers/mmc/core/debugfs.c @@ -56,6 +56,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); @@ -192,6 +195,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; } @@ -211,7 +217,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; } |