flash write, erase & timeouts
Hi All.
Could anyone please explain the following thing which I see in cfi_cmdset_0001.c.
After writing a Program command and data we are do udelay(chip->word_write_time), but when erasing a sector we instead call schedule_timeout(HZ) as the Erase command is written. Is it just ocassionally or there is a point in doing that way?
Thanks, Nick.
To unsubscribe, send "unsubscribe mtd" to [email protected]
Quoted 7 lines · [email protected] said:
Could anyone please explain the following thing which I see in
cfi_cmdset_0001.c.After writing a Program command and data we are do
udelay(chip-> word_write_time), but when erasing a sector we instead callschedule_timeout(HZ)as the Erase command is written. Is it just ocassionally or there is a point in doing that way?
We expect the Program command to take around 128 µs, and we don't want to schedule() for that period of time because we wouldn't get the CPU back quickly enough - so we just drop all the locks and use udelay().
What you're looking at is roughly the form of the final implementation of the Program command.
The Erase command, on the other hand, is expected to take around a second, so we're happy to schedule() and wait for it. In fact, the intention is that the erase() function call should return immediately, and that the completion should be detected by a timer call, which calls the callback function in the erase instruction structure.
--
dwmw2
To unsubscribe, send "unsubscribe mtd" to [email protected]