Skip to content

Commit 6f2a6a5

Browse files
Wolfram Sangdedekind
authored andcommitted
mtd: nand: gpmi: reset BCH earlier, too, to avoid NAND startup problems
It could happen (1 out of 100 times) that NAND did not start up correctly after warm rebooting, so the kernel could not find the UBI or DMA timed out due to a stalled BCH. When resetting BCH together with GPMI, the issue could not be observed anymore (after 10000+ reboots). We probably need the consistent state already before sending any command to NAND, even when no ECC is needed. I chose to keep the extra reset for BCH when changing the flash layout to be on the safe side. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Huang Shijie <b32955@freescale.com> Cc: stable@vger.kernel.org Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
1 parent 3c9c6d6 commit 6f2a6a5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,15 @@ int gpmi_init(struct gpmi_nand_data *this)
165165
if (ret)
166166
goto err_out;
167167

168+
/*
169+
* Reset BCH here, too. We got failures otherwise :(
170+
* See later BCH reset for explanation of MX23 handling
171+
*/
172+
ret = gpmi_reset_block(r->bch_regs, GPMI_IS_MX23(this));
173+
if (ret)
174+
goto err_out;
175+
176+
168177
/* Choose NAND mode. */
169178
writel(BM_GPMI_CTRL1_GPMI_MODE, r->gpmi_regs + HW_GPMI_CTRL1_CLR);
170179

0 commit comments

Comments
 (0)