[PATCH] cfi: Fixup of write errors on XIP
Alexey, Korolev
alexey.korolev at intel.com
Thu Mar 2 11:35:31 EST 2006
Nicolas
> Please don't just yet.
>
> > The scenario of the issue is following:
> >
> > 1. do_write_buffer
> > 2. Waiting for write complete in xip_udelay
> > 3. System Interrupt
> > 4. Write suspend
> > 5. Rescheduling
> > 6. Block erasing by other process. ( This operation typically took
> > rather long time )
> > 7. Complete, rescheduling
> > 8. Return to write (write is not complete due to suspend ).
> > 9. Check timeout. Time is up.
> > 10. Error.
>
> This should not happen. And if it does then the bug is in xip_udelay()
> and therefore should be fixed there.
>
> The fact is, xip_udelay() should not return until either the flash
> status is 0x80 (done) or the delay expired. The code looks like:
>
This is absolutelly correct.
But delay may expire sometimes before chip get ready even if chip has
not been suspended.
Buffer programming time for chip may vary.
For example timeout has expired couple usecs before status get ready.
(the such variations are absolutely ok).
You go up to do_write_buffer, and get the described scenario if chips
has been suspended at the very begging of waiting in xip_uddelay.
I thought about possibility to make fix in xip_udelay, but I didn't find
a good solution here.
Thanks a lot,
Alexey
More information about the linux-mtd
mailing list