···6969 maxItems: 470707171 clocks:7272- minItems: 37272+ minItems: 27373 items:7474 - description: Main peripheral bus clock, PCLK/HCLK - AHB Bus clock7575 - description: SDC MMC clock, MCLK
+20-11
drivers/mmc/core/block.c
···179179 struct mmc_queue *mq);180180static void mmc_blk_hsq_req_done(struct mmc_request *mrq);181181static int mmc_spi_err_check(struct mmc_card *card);182182+static int mmc_blk_busy_cb(void *cb_data, bool *busy);182183183184static struct mmc_blk_data *mmc_blk_get(struct gendisk *disk)184185{···471470 struct mmc_data data = {};472471 struct mmc_request mrq = {};473472 struct scatterlist sg;474474- bool r1b_resp, use_r1b_resp = false;473473+ bool r1b_resp;475474 unsigned int busy_timeout_ms;476475 int err;477476 unsigned int target_part;···552551 busy_timeout_ms = idata->ic.cmd_timeout_ms ? : MMC_BLK_TIMEOUT_MS;553552 r1b_resp = (cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B;554553 if (r1b_resp)555555- use_r1b_resp = mmc_prepare_busy_cmd(card->host, &cmd,556556- busy_timeout_ms);554554+ mmc_prepare_busy_cmd(card->host, &cmd, busy_timeout_ms);557555558556 mmc_wait_for_req(card->host, &mrq);559557 memcpy(&idata->ic.response, cmd.resp, sizeof(cmd.resp));···605605 if (idata->ic.postsleep_min_us)606606 usleep_range(idata->ic.postsleep_min_us, idata->ic.postsleep_max_us);607607608608- /* No need to poll when using HW busy detection. */609609- if ((card->host->caps & MMC_CAP_WAIT_WHILE_BUSY) && use_r1b_resp)610610- return 0;611611-612608 if (mmc_host_is_spi(card->host)) {613609 if (idata->ic.write_flag || r1b_resp || cmd.flags & MMC_RSP_SPI_BUSY)614610 return mmc_spi_err_check(card);615611 return err;616612 }617617- /* Ensure RPMB/R1B command has completed by polling with CMD13. */618618- if (idata->rpmb || r1b_resp)619619- err = mmc_poll_for_busy(card, busy_timeout_ms, false,620620- MMC_BUSY_IO);613613+614614+ /*615615+ * Ensure RPMB, writes and R1B responses are completed by polling with616616+ * CMD13. Note that, usually we don't need to poll when using HW busy617617+ * detection, but here it's needed since some commands may indicate the618618+ * error through the R1 status bits.619619+ */620620+ if (idata->rpmb || idata->ic.write_flag || r1b_resp) {621621+ struct mmc_blk_busy_data cb_data = {622622+ .card = card,623623+ };624624+625625+ err = __mmc_poll_for_busy(card->host, 0, busy_timeout_ms,626626+ &mmc_blk_busy_cb, &cb_data);627627+628628+ idata->ic.response[0] = cb_data.status;629629+ }621630622631 return err;623632}
+7-1
drivers/mmc/core/sdio.c
···10891089 }10901090 err = mmc_sdio_reinit_card(host);10911091 } else if (mmc_card_wake_sdio_irq(host)) {10921092- /* We may have switched to 1-bit mode during suspend */10921092+ /*10931093+ * We may have switched to 1-bit mode during suspend,10941094+ * need to hold retuning, because tuning only supprt10951095+ * 4-bit mode or 8 bit mode.10961096+ */10971097+ mmc_retune_hold_now(host);10931098 err = sdio_enable_4bit_bus(host->card);10991099+ mmc_retune_release(host);10941100 }1095110110961102 if (err)