Skip to content

Commit 962336b

Browse files
committed
Merge tag 'mmc-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC fixes from Ulf Hansson: "MMC core: - Avoid bitfield RMW for claim/retune flags MMC host: - dw_mmc-rockchip: Fix runtime PM support for internal phase support - mmci: Fix device_node reference leak in of_get_dml_pipe_index() - sdhci-brcmstb: Use correct register offset for V1 pin_sel restore" * tag 'mmc-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: core: Avoid bitfield RMW for claim/retune flags mmc: sdhci-brcmstb: use correct register offset for V1 pin_sel restore mmc: dw_mmc-rockchip: Fix runtime PM support for internal phase support mmc: mmci: Fix device_node reference leak in of_get_dml_pipe_index()
2 parents 78d964c + 901084c commit 962336b

4 files changed

Lines changed: 44 additions & 6 deletions

File tree

drivers/mmc/host/dw_mmc-rockchip.c

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ struct dw_mci_rockchip_priv_data {
3636
int default_sample_phase;
3737
int num_phases;
3838
bool internal_phase;
39+
int sample_phase;
40+
int drv_phase;
3941
};
4042

4143
/*
@@ -573,9 +575,43 @@ static void dw_mci_rockchip_remove(struct platform_device *pdev)
573575
dw_mci_pltfm_remove(pdev);
574576
}
575577

578+
static int dw_mci_rockchip_runtime_suspend(struct device *dev)
579+
{
580+
struct platform_device *pdev = to_platform_device(dev);
581+
struct dw_mci *host = platform_get_drvdata(pdev);
582+
struct dw_mci_rockchip_priv_data *priv = host->priv;
583+
584+
if (priv->internal_phase) {
585+
priv->sample_phase = rockchip_mmc_get_phase(host, true);
586+
priv->drv_phase = rockchip_mmc_get_phase(host, false);
587+
}
588+
589+
return dw_mci_runtime_suspend(dev);
590+
}
591+
592+
static int dw_mci_rockchip_runtime_resume(struct device *dev)
593+
{
594+
struct platform_device *pdev = to_platform_device(dev);
595+
struct dw_mci *host = platform_get_drvdata(pdev);
596+
struct dw_mci_rockchip_priv_data *priv = host->priv;
597+
int ret;
598+
599+
ret = dw_mci_runtime_resume(dev);
600+
if (ret)
601+
return ret;
602+
603+
if (priv->internal_phase) {
604+
rockchip_mmc_set_phase(host, true, priv->sample_phase);
605+
rockchip_mmc_set_phase(host, false, priv->drv_phase);
606+
mci_writel(host, MISC_CON, MEM_CLK_AUTOGATE_ENABLE);
607+
}
608+
609+
return ret;
610+
}
611+
576612
static const struct dev_pm_ops dw_mci_rockchip_dev_pm_ops = {
577613
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
578-
RUNTIME_PM_OPS(dw_mci_runtime_suspend, dw_mci_runtime_resume, NULL)
614+
RUNTIME_PM_OPS(dw_mci_rockchip_runtime_suspend, dw_mci_rockchip_runtime_resume, NULL)
579615
};
580616

581617
static struct platform_driver dw_mci_rockchip_pltfm_driver = {

drivers/mmc/host/mmci_qcom_dml.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ static int of_get_dml_pipe_index(struct device_node *np, const char *name)
109109
&dma_spec))
110110
return -ENODEV;
111111

112+
of_node_put(dma_spec.np);
112113
if (dma_spec.args_count)
113114
return dma_spec.args[0];
114115

drivers/mmc/host/sdhci-brcmstb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static void sdhci_brcmstb_restore_regs(struct mmc_host *mmc, enum cfg_core_ver v
116116
writel(sr->boot_main_ctl, priv->boot_regs + SDIO_BOOT_MAIN_CTL);
117117

118118
if (ver == SDIO_CFG_CORE_V1) {
119-
writel(sr->sd_pin_sel, cr + SDIO_CFG_SD_PIN_SEL);
119+
writel(sr->sd_pin_sel, cr + SDIO_CFG_V1_SD_PIN_SEL);
120120
return;
121121
}
122122

include/linux/mmc/host.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,14 +486,12 @@ struct mmc_host {
486486

487487
struct mmc_ios ios; /* current io bus settings */
488488

489+
bool claimed; /* host exclusively claimed */
490+
489491
/* group bitfields together to minimize padding */
490492
unsigned int use_spi_crc:1;
491-
unsigned int claimed:1; /* host exclusively claimed */
492493
unsigned int doing_init_tune:1; /* initial tuning in progress */
493-
unsigned int can_retune:1; /* re-tuning can be used */
494494
unsigned int doing_retune:1; /* re-tuning in progress */
495-
unsigned int retune_now:1; /* do re-tuning at next req */
496-
unsigned int retune_paused:1; /* re-tuning is temporarily disabled */
497495
unsigned int retune_crc_disable:1; /* don't trigger retune upon crc */
498496
unsigned int can_dma_map_merge:1; /* merging can be used */
499497
unsigned int vqmmc_enabled:1; /* vqmmc regulator is enabled */
@@ -508,6 +506,9 @@ struct mmc_host {
508506
int rescan_disable; /* disable card detection */
509507
int rescan_entered; /* used with nonremovable devices */
510508

509+
bool can_retune; /* re-tuning can be used */
510+
bool retune_now; /* do re-tuning at next req */
511+
bool retune_paused; /* re-tuning is temporarily disabled */
511512
int need_retune; /* re-tuning is needed */
512513
int hold_retune; /* hold off re-tuning */
513514
unsigned int retune_period; /* re-tuning period in secs */

0 commit comments

Comments
 (0)