On Thu, 2020-01-16 at 13:54:31 UTC, Martin Devera wrote: > The used way to compute jiffies timeout brokes when > jiffie difference is 1. > Assume that nand_soft_waitrdy is called with timeout_ms==1. > Jiffies are 1000 for example (assume something more like 1000.99 > - just before incrementing to 1001). > We compute timeout_ms = 1000+msecs_to_jiffies(1) = 1001. > nand_read_data_op is called for the first time and returns 0. > During the call jiffies changes to 1001 thus "while loop" ends > here (wrongly). Notice that routine was called with expected timeout > 1ms but actual timeout used was something between 0...1ms. > > Fixes STM32MP1 FMC2 NAND controller which sometimes failed > exactly in this way. > > Signed-off-by: Martin Devera <devik@xxxxxxxxxx> Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks. Miquel ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/