summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/raw/denali.c
diff options
context:
space:
mode:
authorMartin Devera <devik@eaxlabs.cz>2020-01-16 14:54:31 +0100
committerMiquel Raynal <miquel.raynal@bootlin.com>2020-03-09 14:49:14 +0100
commit43d8b6362378913bafbc54690474131568458c42 (patch)
tree284b52f9002d7631a47120030448f8ccde49fbad /drivers/mtd/nand/raw/denali.c
parent98d54f81e36ba3bf92172791eba5ca5bd813989b (diff)
downloadlinux-43d8b6362378913bafbc54690474131568458c42.tar.bz2
mtd: rawnand: Ensure nand_soft_waitrdy wait period is enough
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@eaxlabs.cz> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200116135431.17480-1-devik@eaxlabs.cz
Diffstat (limited to 'drivers/mtd/nand/raw/denali.c')
0 files changed, 0 insertions, 0 deletions