build/patch/kernel/archive/sunxi-5.10/megous/mmc-sunxi-Disable-runtime-pm.patch

99 lines
3.1 KiB
Diff

From a03833bdd65e979514ff27c4f70e338493b215e3 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Tue, 19 Feb 2019 22:21:35 +0100
Subject: [PATCH 177/351] mmc: sunxi: Disable runtime pm
Runtime PM breaks WIFI on TBS A711.
Signed-off-by: Ondrej Jirman <megous@megous.com>
---
drivers/mmc/host/sunxi-mmc.c | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index fc62773602ec..0f57fc3f4efe 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -944,9 +944,15 @@ static void sunxi_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{
struct sunxi_mmc_host *host = mmc_priv(mmc);
+ if (ios->power_mode == MMC_POWER_OFF)
+ sunxi_mmc_reset_host(host);
+
sunxi_mmc_card_power(host, ios);
sunxi_mmc_set_bus_width(host, ios->bus_width);
sunxi_mmc_set_clk(host, ios);
+
+ if (ios->power_mode == MMC_POWER_UP)
+ sunxi_mmc_init_host(host);
}
static int sunxi_mmc_volt_switch(struct mmc_host *mmc, struct mmc_ios *ios)
@@ -972,8 +978,8 @@ static void sunxi_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
unsigned long flags;
u32 imask;
- if (enable)
- pm_runtime_get_noresume(host->dev);
+ //if (enable)
+ //pm_runtime_get_noresume(host->dev);
spin_lock_irqsave(&host->lock, flags);
@@ -988,8 +994,8 @@ static void sunxi_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
mmc_writel(host, REG_IMASK, imask);
spin_unlock_irqrestore(&host->lock, flags);
- if (!enable)
- pm_runtime_put_noidle(host->mmc->parent);
+ //if (!enable)
+ //pm_runtime_put_noidle(host->mmc->parent);
}
static void sunxi_mmc_hw_reset(struct mmc_host *mmc)
@@ -1431,10 +1437,10 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
if (ret)
goto error_free_dma;
- pm_runtime_set_active(&pdev->dev);
- pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
- pm_runtime_use_autosuspend(&pdev->dev);
- pm_runtime_enable(&pdev->dev);
+ //pm_runtime_set_active(&pdev->dev);
+ //pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
+ //pm_runtime_use_autosuspend(&pdev->dev);
+ //pm_runtime_enable(&pdev->dev);
ret = mmc_add_host(mmc);
if (ret)
@@ -1459,7 +1465,7 @@ static int sunxi_mmc_remove(struct platform_device *pdev)
struct sunxi_mmc_host *host = mmc_priv(mmc);
mmc_remove_host(mmc);
- pm_runtime_force_suspend(&pdev->dev);
+ //pm_runtime_force_suspend(&pdev->dev);
disable_irq(host->irq);
sunxi_mmc_disable(host);
dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma);
@@ -1498,7 +1504,6 @@ static int sunxi_mmc_runtime_suspend(struct device *dev)
* Disabling the irq will prevent this.
*/
disable_irq(host->irq);
- sunxi_mmc_reset_host(host);
sunxi_mmc_disable(host);
return 0;
@@ -1516,7 +1521,7 @@ static struct platform_driver sunxi_mmc_driver = {
.name = "sunxi-mmc",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(sunxi_mmc_of_match),
- .pm = &sunxi_mmc_pm_ops,
+ //.pm = &sunxi_mmc_pm_ops,
},
.probe = sunxi_mmc_probe,
.remove = sunxi_mmc_remove,
--
2.34.0