Skip to content

Commit 5bc6bb6

Browse files
esbenmiquelraynal
authored andcommitted
mtd: rawnand: gpmi: Fix suspend/resume problem
On system resume, the gpmi clock must be enabled before accessing gpmi block. Without this, resume causes something like [ 661.348790] gpmi_reset_block(5cbb0f7e): module reset timeout [ 661.348889] gpmi-nand 1806000.gpmi-nand: Error setting GPMI : -110 [ 661.348928] PM: dpm_run_callback(): platform_pm_resume+0x0/0x44 returns -110 [ 661.348961] PM: Device 1806000.gpmi-nand failed to resume: error -110 Fixes: ef347c0 ("mtd: rawnand: gpmi: Implement exec_op") Cc: [email protected] Signed-off-by: Esben Haabendal <[email protected]> Acked-by: Han Xu <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
1 parent da2ef81 commit 5bc6bb6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_data *this)
148148
struct resources *r = &this->resources;
149149
int ret;
150150

151+
ret = pm_runtime_get_sync(this->dev);
152+
if (ret < 0)
153+
return ret;
154+
151155
ret = gpmi_reset_block(r->gpmi_regs, false);
152156
if (ret)
153157
goto err_out;
@@ -179,8 +183,9 @@ static int gpmi_init(struct gpmi_nand_data *this)
179183
*/
180184
writel(BM_GPMI_CTRL1_DECOUPLE_CS, r->gpmi_regs + HW_GPMI_CTRL1_SET);
181185

182-
return 0;
183186
err_out:
187+
pm_runtime_mark_last_busy(this->dev);
188+
pm_runtime_put_autosuspend(this->dev);
184189
return ret;
185190
}
186191

0 commit comments

Comments
 (0)