mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-03-16 23:07:00 +00:00
mmc: tmio: Always check for errors after receiving an IRQ
Unconditionally check for errors even after successful reception of IRQ flag, since the hardware may set both an IRQ completion flag and an error flag at the same time. This mode of failure happens in case of an error during transfer, in which case the hardware may set the expected IRQ completion flag as well as error flags. The later is currently not checked by the driver and such an error is not detected. Improve the error detection. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Tested-by: Thuan Nguyen Hong <thuan.nguyen-hong@banvien.com.vn>
This commit is contained in:
parent
0fb6cd6aa4
commit
631dbe0c08
1 changed files with 4 additions and 1 deletions
|
@ -122,7 +122,10 @@ static int tmio_sd_wait_for_irq(struct udevice *dev, struct mmc_cmd *cmd,
|
|||
long wait = 1000000;
|
||||
int ret;
|
||||
|
||||
while (!(tmio_sd_readl(priv, reg) & flag)) {
|
||||
while (true) {
|
||||
if (tmio_sd_readl(priv, reg) & flag)
|
||||
return tmio_sd_check_error(dev, cmd);
|
||||
|
||||
if (wait-- < 0) {
|
||||
dev_err(dev, "timeout\n");
|
||||
return -ETIMEDOUT;
|
||||
|
|
Loading…
Add table
Reference in a new issue