summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe.Li <Ye.Li@freescale.com>2015-07-10 19:13:53 +0800
committerYe.Li <B37916@freescale.com>2015-07-23 17:38:41 +0800
commit754d0090f7cdc33a4dd54bc606a568b4cb3abc8d (patch)
tree55c38cf7852c33825fcdc87d931403ca1d692495
parentf0241a65d5b31f02446b4fb4f6e4826a1dd79309 (diff)
MLK-11236 mtd: gpmi-nand: Fix nand runtime PM issue
Because of the delay of auto suspend, the nand clocks are delayed to disable when calling the clk_set_rate. This causes the clk_set_rate failed on some platforms like 6q/6qp, and finally lead the NAND not working. Signed-off-by: Ye.Li <Ye.Li@freescale.com> (cherry picked from commit 1334dd236d4401d6635accb6c8472d8a5ed088b5)
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-lib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
index 1fa46a25e88a..b8ce97690426 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
@@ -959,9 +959,14 @@ static int enable_edo_mode(struct gpmi_nand_data *this, int mode)
nand->select_chip(mtd, -1);
+ pm_runtime_get_sync(this->dev);
+ clk_disable_unprepare(r->clock[0]);
/* [3] set the main IO clock, 100MHz for mode 5, 80MHz for mode 4. */
rate = (mode == 5) ? 100000000 : 80000000;
clk_set_rate(r->clock[0], rate);
+ clk_prepare_enable(r->clock[0]);
+ pm_runtime_mark_last_busy(this->dev);
+ pm_runtime_put_autosuspend(this->dev);
/* Let the gpmi_begin() re-compute the timing again. */
this->flags &= ~GPMI_TIMING_INIT_OK;