]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
mmc: cqhci: Add cqhci_deactivate()
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 6 Mar 2020 14:08:42 +0000 (19:38 +0530)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Thu, 17 Sep 2020 06:47:07 +0000 (00:47 -0600)
BugLink: https://bugs.launchpad.net/bugs/1895880
commit 0ffa6cfbd94982e6c028a8924b06a96c1b91bed8 upstream.

Host controllers can reset CQHCI either directly or as a consequence of
host controller reset. Add cqhci_deactivate() which puts the CQHCI
driver into a state that is consistent with that.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
Link: https://lore.kernel.org/r/1583503724-13943-2-git-send-email-vbadigan@codeaurora.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/mmc/host/cqhci.c
drivers/mmc/host/cqhci.h

index c19f4c3f115a407e05161340d1fcdfa21220cc24..2d65b32d205a5907cd32fb8d044feb351fc7ea28 100644 (file)
@@ -299,16 +299,16 @@ static void __cqhci_disable(struct cqhci_host *cq_host)
        cq_host->activated = false;
 }
 
-int cqhci_suspend(struct mmc_host *mmc)
+int cqhci_deactivate(struct mmc_host *mmc)
 {
        struct cqhci_host *cq_host = mmc->cqe_private;
 
-       if (cq_host->enabled)
+       if (cq_host->enabled && cq_host->activated)
                __cqhci_disable(cq_host);
 
        return 0;
 }
-EXPORT_SYMBOL(cqhci_suspend);
+EXPORT_SYMBOL(cqhci_deactivate);
 
 int cqhci_resume(struct mmc_host *mmc)
 {
index def76e9b5cacf62e995e783cbc83a28a0c9fa3fe..437700179de4d8f9284c2ea058f722c5bf92f54b 100644 (file)
@@ -230,7 +230,11 @@ irqreturn_t cqhci_irq(struct mmc_host *mmc, u32 intmask, int cmd_error,
                      int data_error);
 int cqhci_init(struct cqhci_host *cq_host, struct mmc_host *mmc, bool dma64);
 struct cqhci_host *cqhci_pltfm_init(struct platform_device *pdev);
-int cqhci_suspend(struct mmc_host *mmc);
+int cqhci_deactivate(struct mmc_host *mmc);
+static inline int cqhci_suspend(struct mmc_host *mmc)
+{
+       return cqhci_deactivate(mmc);
+}
 int cqhci_resume(struct mmc_host *mmc);
 
 #endif