Commits
Mugunthan V N committed c1dac2dfcc2
mmc: host: omap_hsmmc: add software timer when timeout greater than hardware capablility DRA7 Errata No i834: When using high speed HS200 and SDR104 cards, the functional clock for MMC module will be 192MHz. At this frequency, the maximum obtainable timeout (DTO =0xE) in hardware is (1/192MHz)*2^27 = 700ms. Commands taking longer than 700ms will be affected by this small window frame and will be timing out frequently even without a genune timeout from the card. Workarround for this errata is use a software timer instead of hardware timer to provide the delay requested by the upper layer So adding a software timer as a work around for the errata. Instead of using software timeout only for larger delays requested when using HS200/SDR104 cards which results in hardware and software timer race conditions, so move all the timeout request to use software timer when HS200/SDR104 card is connected and use hardware timer when other type cards are connected. Also start the software timer after queueing to DMA to ensure we are more likely to expire within correct limits. To be ever more sure that we won't expire this soft timer too early, we're adding a 1000000ns slack to the data timeout requested by the upper layer. [rk@ti.com: fix compiler warning in sw timeout function and use sw timeout for busy timeout] Signed-off-by: Ravikumar Kattekola <rk@ti.com> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> [kishon@ti.com: Fix the timeout value to account for the entire transfer to complete here.] Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>