Qiang Li - Mpu Se

The iMX51/53 Linux NAND flash driver hangup bug when system is busy (Such as many interrupts) -blog archive

Discussion created by Qiang Li - Mpu Se Employee on Aug 1, 2012
Latest reply on Mar 26, 2013 by Qiang Li - Mpu Se

    For iMX51/53 Linux BSP, such as L2.6.35_11.09.01_ER, Android R10.4 BSP, there is a timeout issue in NAND flash driver.

In the driver file "drivers\mtd\nand\mxc_nd2.c", function wait_op_done().

    After a NAND command was send to NAND chip, this function will call wait_event_timeout() to wait the interrupt, and it will set timeout time to 1 second (TROP_US_DELAY), after NAND complete interrupt happens, the interrupt thread mxc_nfc_irq() will call wake_up(&irq_waitq); to notify the wait thread. In normal case it is OK. But when system is busy with many hardware interrupts, such as SDMMC card read/write, there is chance that the time maybe will be more than 1 second from "wake_up(&irq_waitq);" was called to wait_event_timeout() receive it. In this case, the function wait_op_done() will return fail with timeout. And the complete status bit in register REG_NFC_OPS_STAT will not be cleared, then system will hangup.

 

    The followed is the updated code for this issue, the modified code was marked with flag "qiang_debug".

Original Attachment has been moved to: mxc_nd2.c.zip

Outcomes