mmc: dw_mmc: Avoid accessing registers in runtime suspended state
authorShawn Lin <shawn.lin@rock-chips.com>
Fri, 23 Feb 2018 08:47:25 +0000 (16:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Mar 2018 06:41:03 +0000 (22:41 -0800)
commit4d5123a0b37cab76958bdd7d6d2c26a40ca52e7f
tree3b9129b46ce026d76b94d9fb65963a7482a7c1e7
parentcb65fc21f3877599e1c22710c5fdbefd0be010d4
mmc: dw_mmc: Avoid accessing registers in runtime suspended state

commit 5b43df8b4c1a7f0c3fbf793c9566068e6b1e570c upstream.

cat /sys/kernel/debug/mmc0/regs will hang up the system since
it's in runtime suspended state, so the genpd and biu_clk is
off. This patch fixes this problem by calling pm_runtime_get_sync
to wake it up before reading the registers.

Fixes: e9ed8835e990 ("mmc: dw_mmc: add runtime PM callback")
Cc: <stable@vger.kernel.org>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/host/dw_mmc.c