]> git.baikalelectronics.ru Git - uboot.git/commit
mmc: mtk-sd: fix possible incomplete read ops
authorFabien Parent <fparent@baylibre.com>
Thu, 17 Jan 2019 17:06:00 +0000 (18:06 +0100)
committerTom Rini <trini@konsulko.com>
Sat, 26 Jan 2019 13:13:54 +0000 (08:13 -0500)
commit2aa570dc8afc394238dc3d0148e157bb98d02978
tree0c5f868bd2b0f69dda04add44770a971c0457c9c
parent083a8b2ad0f310f49cb0a99adf86cf571d9ef03c
mmc: mtk-sd: fix possible incomplete read ops

The code is checking for incomplete read when it see the INT_XFER_COMPL
flag, but it forget to first check whether there is anything left in the
FIFO to copy to the RX buffer. This means that sometimes we will get
errors because of erroneous incomplete read operation.

This commit fixes the driver re-ordering the code so that we first
check for data inside the RX fifo and only after check the status
of the INT_XFER_COMPL flag.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
drivers/mmc/mtk-sd.c