bug in MTD code based on kernel 2.4.32

Vijay Sampath vsampath at gmail.com
Fri Dec 16 20:19:02 EST 2005


Hello,

I will probably get flamed for referring to ancient kernels. However
we have been using 2.4 based kernels for a while now, and do not want
to change for customer compatability issues etc. We occasionally see
board lockups on flash accesses. I have traced this down to a bug in
the 2.4 MTD code, and I see this problem even in the latest code I
could download (2.4.32).

The problem is in cfi_cmdset_0001.c, and may be present in drivers for
other chips as well. In the function cfi_intelext_sync() function
before calling add_wait_queue, the current process needs to be put to
sleep by calling set_current_state(TASK_INTERRUPTIBLE). If it is not
put to sleep, the task remains in the run queue of the kernel and if
its priority is high enough, the kernel will constantly keep
scheduling this process, the state of the chip will never change.

Adding this one line seems to make our lockups go away.

Please let me know if this is an accurate assessment. BTW we are using
Timesys Linux kernel, which is slightly different from the stock
kernel.

Thanks,

Vijay




More information about the linux-mtd mailing list