Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'mmc-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Pull MMC fixes from Ulf Hansson:
"MMC core:
- Restore (mostly) the busy polling for MMC_SEND_OP_COND

MMC host:
- meson-gx: Fix DMA usage of meson_mmc_post_req()"

* tag 'mmc-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
mmc: core: Restore (almost) the busy polling for MMC_SEND_OP_COND
mmc: meson: Fix usage of meson_mmc_post_req()

+22 -15
+1 -1
drivers/mmc/core/block.c
··· 1908 1908 1909 1909 cb_data.card = card; 1910 1910 cb_data.status = 0; 1911 - err = __mmc_poll_for_busy(card->host, MMC_BLK_TIMEOUT_MS, 1911 + err = __mmc_poll_for_busy(card->host, 0, MMC_BLK_TIMEOUT_MS, 1912 1912 &mmc_blk_busy_cb, &cb_data); 1913 1913 1914 1914 /*
+1 -1
drivers/mmc/core/mmc.c
··· 1962 1962 goto out_release; 1963 1963 } 1964 1964 1965 - err = __mmc_poll_for_busy(host, timeout_ms, &mmc_sleep_busy_cb, host); 1965 + err = __mmc_poll_for_busy(host, 0, timeout_ms, &mmc_sleep_busy_cb, host); 1966 1966 1967 1967 out_release: 1968 1968 mmc_retune_release(host);
+9 -4
drivers/mmc/core/mmc_ops.c
··· 21 21 22 22 #define MMC_BKOPS_TIMEOUT_MS (120 * 1000) /* 120s */ 23 23 #define MMC_SANITIZE_TIMEOUT_MS (240 * 1000) /* 240s */ 24 + #define MMC_OP_COND_PERIOD_US (1 * 1000) /* 1ms */ 25 + #define MMC_OP_COND_TIMEOUT_MS 1000 /* 1s */ 24 26 25 27 static const u8 tuning_blk_pattern_4bit[] = { 26 28 0xff, 0x0f, 0xff, 0x00, 0xff, 0xcc, 0xc3, 0xcc, ··· 234 232 cmd.arg = mmc_host_is_spi(host) ? 0 : ocr; 235 233 cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R3 | MMC_CMD_BCR; 236 234 237 - err = __mmc_poll_for_busy(host, 1000, &__mmc_send_op_cond_cb, &cb_data); 235 + err = __mmc_poll_for_busy(host, MMC_OP_COND_PERIOD_US, 236 + MMC_OP_COND_TIMEOUT_MS, 237 + &__mmc_send_op_cond_cb, &cb_data); 238 238 if (err) 239 239 return err; 240 240 ··· 499 495 return 0; 500 496 } 501 497 502 - int __mmc_poll_for_busy(struct mmc_host *host, unsigned int timeout_ms, 498 + int __mmc_poll_for_busy(struct mmc_host *host, unsigned int period_us, 499 + unsigned int timeout_ms, 503 500 int (*busy_cb)(void *cb_data, bool *busy), 504 501 void *cb_data) 505 502 { 506 503 int err; 507 504 unsigned long timeout; 508 - unsigned int udelay = 32, udelay_max = 32768; 505 + unsigned int udelay = period_us ? period_us : 32, udelay_max = 32768; 509 506 bool expired = false; 510 507 bool busy = false; 511 508 ··· 551 546 cb_data.retry_crc_err = retry_crc_err; 552 547 cb_data.busy_cmd = busy_cmd; 553 548 554 - return __mmc_poll_for_busy(host, timeout_ms, &mmc_busy_cb, &cb_data); 549 + return __mmc_poll_for_busy(host, 0, timeout_ms, &mmc_busy_cb, &cb_data); 555 550 } 556 551 EXPORT_SYMBOL_GPL(mmc_poll_for_busy); 557 552
+2 -1
drivers/mmc/core/mmc_ops.h
··· 41 41 int mmc_switch_status(struct mmc_card *card, bool crc_err_fatal); 42 42 bool mmc_prepare_busy_cmd(struct mmc_host *host, struct mmc_command *cmd, 43 43 unsigned int timeout_ms); 44 - int __mmc_poll_for_busy(struct mmc_host *host, unsigned int timeout_ms, 44 + int __mmc_poll_for_busy(struct mmc_host *host, unsigned int period_us, 45 + unsigned int timeout_ms, 45 46 int (*busy_cb)(void *cb_data, bool *busy), 46 47 void *cb_data); 47 48 int mmc_poll_for_busy(struct mmc_card *card, unsigned int timeout_ms,
+1 -1
drivers/mmc/core/sd.c
··· 1672 1672 1673 1673 cb_data.card = card; 1674 1674 cb_data.reg_buf = reg_buf; 1675 - err = __mmc_poll_for_busy(card->host, SD_POWEROFF_NOTIFY_TIMEOUT_MS, 1675 + err = __mmc_poll_for_busy(card->host, 0, SD_POWEROFF_NOTIFY_TIMEOUT_MS, 1676 1676 &sd_busy_poweroff_notify_cb, &cb_data); 1677 1677 1678 1678 out:
+8 -7
drivers/mmc/host/meson-gx-mmc.c
··· 173 173 int irq; 174 174 175 175 bool vqmmc_enabled; 176 + bool needs_pre_post_req; 177 + 176 178 }; 177 179 178 180 #define CMD_CFG_LENGTH_MASK GENMASK(8, 0) ··· 665 663 struct meson_host *host = mmc_priv(mmc); 666 664 667 665 host->cmd = NULL; 666 + if (host->needs_pre_post_req) 667 + meson_mmc_post_req(mmc, mrq, 0); 668 668 mmc_request_done(host->mmc, mrq); 669 669 } 670 670 ··· 884 880 static void meson_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) 885 881 { 886 882 struct meson_host *host = mmc_priv(mmc); 887 - bool needs_pre_post_req = mrq->data && 883 + host->needs_pre_post_req = mrq->data && 888 884 !(mrq->data->host_cookie & SD_EMMC_PRE_REQ_DONE); 889 885 890 886 /* ··· 900 896 } 901 897 } 902 898 903 - if (needs_pre_post_req) { 899 + if (host->needs_pre_post_req) { 904 900 meson_mmc_get_transfer_mode(mmc, mrq); 905 901 if (!meson_mmc_desc_chain_mode(mrq->data)) 906 - needs_pre_post_req = false; 902 + host->needs_pre_post_req = false; 907 903 } 908 904 909 - if (needs_pre_post_req) 905 + if (host->needs_pre_post_req) 910 906 meson_mmc_pre_req(mmc, mrq); 911 907 912 908 /* Stop execution */ 913 909 writel(0, host->regs + SD_EMMC_START); 914 910 915 911 meson_mmc_start_cmd(mmc, mrq->sbc ?: mrq->cmd); 916 - 917 - if (needs_pre_post_req) 918 - meson_mmc_post_req(mmc, mrq, 0); 919 912 } 920 913 921 914 static void meson_mmc_read_resp(struct mmc_host *mmc, struct mmc_command *cmd)