mtd: nand: pxa3xx-nand: fix random command timeouts
mtd: nand: pxa3xx-nand: fix random command timeouts

When 2 commands are submitted in a row, and the second is very quick,
the completion of the second command might never come. This happens
especially if the second command is quick, such as a status read after
an erase.

The issue is that in the interrupt handler, the status bits are cleared
after the new command is issued. There is a small temporal window where
this happens :
 - the previous command has set the command done bit
 - the ready for a command bit is set
 - the handler submits the next command
   - just then, the command completes, and the command done bit is still
     set
 - the handler clears the "previous" command done bit
 - the handler exits

In this flow, the "command done" of the next command will never trigger
a new interrupt to finish the status command, as it was cleared for both
commands.

Fix this by clearing the status bit before submitting a new command.

Signed-off-by: Robert Jarzmik <94b2a0a74cb42a2dd0cf1b763601af7f13907aa9@free.fr>
Acked-by: Ezequiel Garcia <eb6a2f962bb597f98b2c2b9c4698da19710ddfa3@vanguardiasur.com.ar>
Tested-by: Ezequiel Garcia <eb6a2f962bb597f98b2c2b9c4698da19710ddfa3@vanguardiasur.com.ar>
Signed-off-by: Brian Norris <ac73eed4b8a8c9127255a2696c52b2e7503720b8@gmail.com>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs