]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
UBUNTU: SAUCE: sdhci: use PCI ID to identify Dell IoT gateways
authorShrirang Bagul <shrirang.bagul@canonical.com>
Sat, 25 Mar 2017 05:51:06 +0000 (13:51 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 25 Apr 2017 18:37:32 +0000 (20:37 +0200)
BugLink: http://bugs.launchpad.net/bugs/1669672
This patch adds a guard against changes in commit 2171e55 being applied
to the complete SDHCI sub-system. PCI Subsystem ID 1028:07b9 is used to
uniquely identify Dell IoT gateway.

Signed-off-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/mmc/host/sdhci.c

index 62d37d2ac557b264ddb57a339dd19ac915ccbe80..d919bb7c67811e28306ea53485090a3366e43014 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/io.h>
 #include <linux/module.h>
 #include <linux/dma-mapping.h>
+#include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/scatterlist.h>
 #include <linux/regulator/consumer.h>
@@ -1747,9 +1748,18 @@ static void sdhci_enable_sdio_irq_nolock(struct sdhci_host *host, int enable)
 static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable)
 {
        struct sdhci_host *host = mmc_priv(mmc);
+       struct pci_dev *pci_host;
        unsigned long flags;
 
-       sdhci_runtime_pm_get(host);
+       pci_host = pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID,
+                       0x1028, 0x07b9, NULL);
+
+       if (!pci_host)
+               sdhci_runtime_pm_get(host);
+       else {
+               if (enable)
+                       sdhci_runtime_pm_get(host);
+       }
 
        spin_lock_irqsave(&host->lock, flags);
        if (enable)
@@ -1760,7 +1770,12 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable)
        sdhci_enable_sdio_irq_nolock(host, enable);
        spin_unlock_irqrestore(&host->lock, flags);
 
-       sdhci_runtime_pm_put(host);
+       if (!pci_host)
+               sdhci_runtime_pm_put(host);
+       else {
+               if (!enable)
+                       sdhci_runtime_pm_put(host);
+       }
 }
 
 static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,