}
static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms,
- struct request *req, int *gen_err)
+ bool hw_busy_detect, struct request *req, int *gen_err)
{
unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms);
int err = 0;
*gen_err = 1;
}
+ /* We may rely on the host hw to handle busy detection.*/
+ if ((card->host->caps & MMC_CAP_WAIT_WHILE_BUSY) &&
+ hw_busy_detect)
+ break;
+
/*
* Timeout if the device never becomes ready for data and never
* leaves the program state.
gen_err = 1;
}
- err = card_busy_detect(card, MMC_BLK_TIMEOUT_MS, req, &gen_err);
+ err = card_busy_detect(card, MMC_BLK_TIMEOUT_MS, false, req,
+ &gen_err);
if (err)
return MMC_BLK_CMD_ERR;
}