mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
MMC host:
- meson-mx-sdio: Fix support for HW busy detection - sdhci-msm: Fix support for HW busy detection - cqhci: Fix polling loop by converting to readx_poll_timeout() - sdhci-xenon: Fix annoying 1.8V regulator warning - sdhci-pci: Fix eMMC driver strength for BYT-based controllers -----BEGIN PGP SIGNATURE----- iQJLBAABCgA1FiEEugLDXPmKSktSkQsV/iaEJXNYjCkFAl6qdiwXHHVsZi5oYW5z c29uQGxpbmFyby5vcmcACgkQ/iaEJXNYjCkiVBAAuBpBcq/FMUi8p7UsTXogFwff /hnI0+YgPXFzNzt6ag6KTyc/wTb7WBbE/XEiGpCr+DBAQ+RAoGI2AAfNzIiKrLri CnwX2oY0PUUwMEaemY4VZ0KoN06ec86ltUDlJzT6r9+keLKkGAuyPXFu7geSSSbO VGzhw0I4w8s/x6GGenlETZHEmYd795N7oHwaq7KVLbBylOs+YnIB3scrLThTjxjw wy5R7OVN4/8gxVMLwzYLGCM496f9xsFAjm9PoY5EVH+4QpOj4wyW+8edhEpKP/Xo Kd5BZGmLVMxo7DJvf5Y7/MhwutNj5SSuu8CqaZPZPSIq7YZNwmIKsi2ns69nQAa9 PDWh9a9ELl5rBGVrrIdFf2WIfBG+qksnJKSRBwJ9wlOAm+ClKmyQyod8E75sbhQ/ 5WYJr/ezzpbOemz2INCJgqibc/vim+VNbBUv5qayGWD3lBjn6U9CudGExdvF9YSQ zS1PQa7dd9GvS5CUj4RkXBtSs+kmUjt2ymQfXupS7M0NG8wPOslk2S2wxG9FBvAQ U73T/BCJw13J6sKMJpAHdwLJ4Or6K0AdNaA2v4jw0oaH9+ukhgtmhGAwxN4C33qq lgrWc00O5zTVPIX6/kMN763xLlQ1ivD2hmLoBfH4xHshfd8IJbhNwVasv25AgtXu q3aClIiyA5+fpfieMAc= =0bek -----END PGP SIGNATURE----- Merge tag 'mmc-v5.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: - meson-mx-sdio: Fix support for HW busy detection - sdhci-msm: Fix support for HW busy detection - cqhci: Fix polling loop by converting to readx_poll_timeout() - sdhci-xenon: Fix annoying 1.8V regulator warning - sdhci-pci: Fix eMMC driver strength for BYT-based controllers * tag 'mmc-v5.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-pci: Fix eMMC driver strength for BYT-based controllers mmc: sdhci-xenon: fix annoying 1.8V regulator warning mmc: sdhci-msm: Enable host capabilities pertains to R1b response mmc: cqhci: Avoid false "cqhci: CQE stuck on" by not open-coding timeout loop mmc: meson-mx-sdio: remove the broken ->card_busy() op mmc: meson-mx-sdio: Set MMC_CAP_WAIT_WHILE_BUSY mmc: core: make mmc_interrupt_hpi() static
This commit is contained in:
commit
af4a32ad21
@ -878,7 +878,7 @@ static int mmc_send_hpi_cmd(struct mmc_card *card)
|
||||
* Issued High Priority Interrupt, and check for card status
|
||||
* until out-of prg-state.
|
||||
*/
|
||||
int mmc_interrupt_hpi(struct mmc_card *card)
|
||||
static int mmc_interrupt_hpi(struct mmc_card *card)
|
||||
{
|
||||
int err;
|
||||
u32 status;
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/slab.h>
|
||||
@ -349,12 +350,16 @@ static int cqhci_enable(struct mmc_host *mmc, struct mmc_card *card)
|
||||
/* CQHCI is idle and should halt immediately, so set a small timeout */
|
||||
#define CQHCI_OFF_TIMEOUT 100
|
||||
|
||||
static u32 cqhci_read_ctl(struct cqhci_host *cq_host)
|
||||
{
|
||||
return cqhci_readl(cq_host, CQHCI_CTL);
|
||||
}
|
||||
|
||||
static void cqhci_off(struct mmc_host *mmc)
|
||||
{
|
||||
struct cqhci_host *cq_host = mmc->cqe_private;
|
||||
ktime_t timeout;
|
||||
bool timed_out;
|
||||
u32 reg;
|
||||
int err;
|
||||
|
||||
if (!cq_host->enabled || !mmc->cqe_on || cq_host->recovery_halt)
|
||||
return;
|
||||
@ -364,15 +369,9 @@ static void cqhci_off(struct mmc_host *mmc)
|
||||
|
||||
cqhci_writel(cq_host, CQHCI_HALT, CQHCI_CTL);
|
||||
|
||||
timeout = ktime_add_us(ktime_get(), CQHCI_OFF_TIMEOUT);
|
||||
while (1) {
|
||||
timed_out = ktime_compare(ktime_get(), timeout) > 0;
|
||||
reg = cqhci_readl(cq_host, CQHCI_CTL);
|
||||
if ((reg & CQHCI_HALT) || timed_out)
|
||||
break;
|
||||
}
|
||||
|
||||
if (timed_out)
|
||||
err = readx_poll_timeout(cqhci_read_ctl, cq_host, reg,
|
||||
reg & CQHCI_HALT, 0, CQHCI_OFF_TIMEOUT);
|
||||
if (err < 0)
|
||||
pr_err("%s: cqhci: CQE stuck on\n", mmc_hostname(mmc));
|
||||
else
|
||||
pr_debug("%s: cqhci: CQE off\n", mmc_hostname(mmc));
|
||||
|
@ -357,14 +357,6 @@ static void meson_mx_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
|
||||
meson_mx_mmc_start_cmd(mmc, mrq->cmd);
|
||||
}
|
||||
|
||||
static int meson_mx_mmc_card_busy(struct mmc_host *mmc)
|
||||
{
|
||||
struct meson_mx_mmc_host *host = mmc_priv(mmc);
|
||||
u32 irqc = readl(host->base + MESON_MX_SDIO_IRQC);
|
||||
|
||||
return !!(irqc & MESON_MX_SDIO_IRQC_FORCE_DATA_DAT_MASK);
|
||||
}
|
||||
|
||||
static void meson_mx_mmc_read_response(struct mmc_host *mmc,
|
||||
struct mmc_command *cmd)
|
||||
{
|
||||
@ -506,7 +498,6 @@ static void meson_mx_mmc_timeout(struct timer_list *t)
|
||||
static struct mmc_host_ops meson_mx_mmc_ops = {
|
||||
.request = meson_mx_mmc_request,
|
||||
.set_ios = meson_mx_mmc_set_ios,
|
||||
.card_busy = meson_mx_mmc_card_busy,
|
||||
.get_cd = mmc_gpio_get_cd,
|
||||
.get_ro = mmc_gpio_get_ro,
|
||||
};
|
||||
@ -570,7 +561,7 @@ static int meson_mx_mmc_add_host(struct meson_mx_mmc_host *host)
|
||||
mmc->f_max = clk_round_rate(host->cfg_div_clk,
|
||||
clk_get_rate(host->parent_clk));
|
||||
|
||||
mmc->caps |= MMC_CAP_ERASE | MMC_CAP_CMD23;
|
||||
mmc->caps |= MMC_CAP_ERASE | MMC_CAP_CMD23 | MMC_CAP_WAIT_WHILE_BUSY;
|
||||
mmc->ops = &meson_mx_mmc_ops;
|
||||
|
||||
ret = mmc_of_parse(mmc);
|
||||
|
@ -2087,6 +2087,8 @@ static int sdhci_msm_probe(struct platform_device *pdev)
|
||||
goto clk_disable;
|
||||
}
|
||||
|
||||
msm_host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_NEED_RSP_BUSY;
|
||||
|
||||
pm_runtime_get_noresume(&pdev->dev);
|
||||
pm_runtime_set_active(&pdev->dev);
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
|
@ -601,6 +601,9 @@ static int intel_select_drive_strength(struct mmc_card *card,
|
||||
struct sdhci_pci_slot *slot = sdhci_priv(host);
|
||||
struct intel_host *intel_host = sdhci_pci_priv(slot);
|
||||
|
||||
if (!(mmc_driver_type_mask(intel_host->drv_strength) & card_drv))
|
||||
return 0;
|
||||
|
||||
return intel_host->drv_strength;
|
||||
}
|
||||
|
||||
|
@ -235,6 +235,16 @@ static void xenon_voltage_switch(struct sdhci_host *host)
|
||||
{
|
||||
/* Wait for 5ms after set 1.8V signal enable bit */
|
||||
usleep_range(5000, 5500);
|
||||
|
||||
/*
|
||||
* For some reason the controller's Host Control2 register reports
|
||||
* the bit representing 1.8V signaling as 0 when read after it was
|
||||
* written as 1. Subsequent read reports 1.
|
||||
*
|
||||
* Since this may cause some issues, do an empty read of the Host
|
||||
* Control2 register here to circumvent this.
|
||||
*/
|
||||
sdhci_readw(host, SDHCI_HOST_CONTROL2);
|
||||
}
|
||||
|
||||
static const struct sdhci_ops sdhci_xenon_ops = {
|
||||
|
Loading…
Reference in New Issue
Block a user