{
void __iomem *base = host->base;
+ if (status & err_msk) {
+ /* Stop any ongoing busy detection if an error occurs */
+ writel(host->variant->busy_detect_mask, base + MMCICLEAR);
+ writel(readl(base + MMCIMASK0) &
+ ~host->variant->busy_detect_mask, base + MMCIMASK0);
+ host->busy_status = 0;
+ return true;
+ }
+
/*
* Before unmasking for the busy end IRQ, confirm that the
* command was sent successfully. To keep track of having a
* while, to allow it to be set, but tests indicates that it
* isn't needed.
*/
- if (!host->busy_status && !(status & err_msk)) {
+ if (!host->busy_status) {
status = readl(base + MMCISTATUS);
if (status & host->variant->busy_detect_flag) {
writel(readl(base + MMCIMASK0) |