omap_hsmmc: print and abort if mmc controller reports other error/status
authorH. Nikolaus Schaller <hns@goldelico.com>
Fri, 29 Jan 2016 17:48:48 +0000 (18:48 +0100)
committernotaz <notasas@gmail.com>
Sun, 14 Aug 2016 13:43:31 +0000 (16:43 +0300)
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
drivers/mmc/omap_hsmmc.c

index 5b6cd60..b81b5b0 100644 (file)
@@ -467,7 +467,6 @@ static int mmc_read_data(struct hsmmc *mmc_base, char *buf, unsigned int size)
                                return TIMEOUT;
                        }
                } while (mmc_stat == 0);
-
                if ((mmc_stat & (IE_DTO | IE_DCRC | IE_DEB)) != 0)
                        mmc_reset_controller_fsm(mmc_base, SYSCTL_SRD);
 
@@ -495,6 +494,10 @@ static int mmc_read_data(struct hsmmc *mmc_base, char *buf, unsigned int size)
                                &mmc_base->stat);
                        break;
                }
+               if (mmc_stat & ~(IE_DTO | IE_DCRC | IE_DEB | ERRI_MASK | BRR_MASK | BWR_MASK | TC_MASK)) {
+                       printf("%s: unhandled mmc_stat = %x\n", __func__, mmc_stat);
+                       return 1;
+               }
        }
        return 0;
 }