]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mmc: sdhci: Drop redundant code for SDIO IRQs
authorUlf Hansson <ulf.hansson@linaro.org>
Sun, 8 Sep 2019 10:12:35 +0000 (12:12 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 11 Sep 2019 14:10:19 +0000 (16:10 +0200)
Nowadays sdhci prevents runtime suspend when SDIO IRQs are enabled.

However, some variants such as sdhci-esdhc-imx's, tries to allow runtime
suspend while having the SDIO IRQs enabled, but without supporting remote
wakeups. This support is a bit questionable, especially if the host device
have a PM domain attached that can be power gated, but more importantly,
the code have also become redundant (which was not the case when it was
introduced).

Rather than keeping the redundant code around, let's drop it and leave this
to be revisited later on.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-esdhc-imx.c
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.h

index 776a942162488e87e14f3d48fd2b285ab9ecd1cf..1c988d6a24330abd484f2c73bd249d15b5e1fcd8 100644 (file)
@@ -1666,12 +1666,10 @@ static int sdhci_esdhc_runtime_suspend(struct device *dev)
        if (host->tuning_mode != SDHCI_TUNING_MODE_3)
                mmc_retune_needed(host->mmc);
 
-       if (!sdhci_sdio_irq_enabled(host)) {
-               imx_data->actual_clock = host->mmc->actual_clock;
-               esdhc_pltfm_set_clock(host, 0);
-               clk_disable_unprepare(imx_data->clk_per);
-               clk_disable_unprepare(imx_data->clk_ipg);
-       }
+       imx_data->actual_clock = host->mmc->actual_clock;
+       esdhc_pltfm_set_clock(host, 0);
+       clk_disable_unprepare(imx_data->clk_per);
+       clk_disable_unprepare(imx_data->clk_ipg);
        clk_disable_unprepare(imx_data->clk_ahb);
 
        if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS)
@@ -1695,15 +1693,15 @@ static int sdhci_esdhc_runtime_resume(struct device *dev)
        if (err)
                goto remove_pm_qos_request;
 
-       if (!sdhci_sdio_irq_enabled(host)) {
-               err = clk_prepare_enable(imx_data->clk_per);
-               if (err)
-                       goto disable_ahb_clk;
-               err = clk_prepare_enable(imx_data->clk_ipg);
-               if (err)
-                       goto disable_per_clk;
-               esdhc_pltfm_set_clock(host, imx_data->actual_clock);
-       }
+       err = clk_prepare_enable(imx_data->clk_per);
+       if (err)
+               goto disable_ahb_clk;
+
+       err = clk_prepare_enable(imx_data->clk_ipg);
+       if (err)
+               goto disable_per_clk;
+
+       esdhc_pltfm_set_clock(host, imx_data->actual_clock);
 
        err = sdhci_runtime_resume_host(host, 0);
        if (err)
@@ -1715,11 +1713,9 @@ static int sdhci_esdhc_runtime_resume(struct device *dev)
        return err;
 
 disable_ipg_clk:
-       if (!sdhci_sdio_irq_enabled(host))
-               clk_disable_unprepare(imx_data->clk_ipg);
+       clk_disable_unprepare(imx_data->clk_ipg);
 disable_per_clk:
-       if (!sdhci_sdio_irq_enabled(host))
-               clk_disable_unprepare(imx_data->clk_per);
+       clk_disable_unprepare(imx_data->clk_per);
 disable_ahb_clk:
        clk_disable_unprepare(imx_data->clk_ahb);
 remove_pm_qos_request:
index efa6cda8c991477e51691480e44333fc38ade48b..4c4285387b47bdaf7128888fc3bd706f6c26b491 100644 (file)
@@ -3048,7 +3048,7 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
 
        spin_lock(&host->lock);
 
-       if (host->runtime_suspended && !sdhci_sdio_irq_enabled(host)) {
+       if (host->runtime_suspended) {
                spin_unlock(&host->lock);
                return IRQ_NONE;
        }
index cf3d1ed9190957198b3bf1e34d0c3a81429bcbf2..8effaac61c3ab6dead2f4554304effe41c6ec521 100644 (file)
@@ -753,11 +753,6 @@ static inline void sdhci_read_caps(struct sdhci_host *host)
        __sdhci_read_caps(host, NULL, NULL, NULL);
 }
 
-static inline bool sdhci_sdio_irq_enabled(struct sdhci_host *host)
-{
-       return !!(host->flags & SDHCI_SDIO_IRQ_ENABLED);
-}
-
 u16 sdhci_calc_clk(struct sdhci_host *host, unsigned int clock,
                   unsigned int *actual_clock);
 void sdhci_set_clock(struct sdhci_host *host, unsigned int clock);