summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorHaibo Chen <haibo.chen@nxp.com>2017-04-17 17:43:00 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:26:20 +0800
commita6d7c9e3d49fec1d111ced36e2c4d9c8af079a3e (patch)
treed4faf94bf02a1b84d8d7c025e8c86813bb971a70 /drivers/mmc
parentfd77d57c39d72d36f37cf3ca5a228aa6f8c45ce7 (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')
-rw-r--r--drivers/mmc/core/debugfs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
index 0f4a7d7b2626..c97311174d31 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;
}