On the Pro 7 and Laptop 3, intel_lpss_pci fails to probe and thus keeps the system from booting. Add a patch to fix this. Note: The added patch is on it's way upstream. See: https://lkml.org/lkml/2019/10/16/1230
111 lines
3.7 KiB
Diff
111 lines
3.7 KiB
Diff
From 47c5b0a738f431a2aa27116acd233afe41bfe0dd Mon Sep 17 00:00:00 2001
|
|
From: Tuowen Zhao <ztuowen@gmail.com>
|
|
Date: Wed, 16 Oct 2019 15:06:27 -0600
|
|
Subject: [PATCH 13/13] ioremap_uc
|
|
|
|
---
|
|
Documentation/driver-model/devres.txt | 1 +
|
|
arch/sparc/include/asm/io_64.h | 1 +
|
|
drivers/mfd/intel-lpss.c | 2 +-
|
|
include/linux/io.h | 2 ++
|
|
lib/devres.c | 19 +++++++++++++++++++
|
|
5 files changed, 24 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
|
|
index 43681ca0837f..7b1ee4190208 100644
|
|
--- a/Documentation/driver-model/devres.txt
|
|
+++ b/Documentation/driver-model/devres.txt
|
|
@@ -294,6 +294,7 @@ IOMAP
|
|
devm_ioport_unmap()
|
|
devm_ioremap()
|
|
devm_ioremap_nocache()
|
|
+ devm_ioremap_uc()
|
|
devm_ioremap_wc()
|
|
devm_ioremap_resource() : checks resource, requests memory region, ioremaps
|
|
devm_iounmap()
|
|
diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h
|
|
index b162c23ae8c2..7a836d21ff0c 100644
|
|
--- a/arch/sparc/include/asm/io_64.h
|
|
+++ b/arch/sparc/include/asm/io_64.h
|
|
@@ -409,6 +409,7 @@ static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
|
|
}
|
|
|
|
#define ioremap_nocache(X,Y) ioremap((X),(Y))
|
|
+#define ioremap_uc(X,Y) ioremap((X),(Y))
|
|
#define ioremap_wc(X,Y) ioremap((X),(Y))
|
|
#define ioremap_wt(X,Y) ioremap((X),(Y))
|
|
|
|
diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
|
|
index ff3fba16e735..37a5bb09d228 100644
|
|
--- a/drivers/mfd/intel-lpss.c
|
|
+++ b/drivers/mfd/intel-lpss.c
|
|
@@ -397,7 +397,7 @@ int intel_lpss_probe(struct device *dev,
|
|
if (!lpss)
|
|
return -ENOMEM;
|
|
|
|
- lpss->priv = devm_ioremap(dev, info->mem->start + LPSS_PRIV_OFFSET,
|
|
+ lpss->priv = devm_ioremap_uc(dev, info->mem->start + LPSS_PRIV_OFFSET,
|
|
LPSS_PRIV_SIZE);
|
|
if (!lpss->priv)
|
|
return -ENOMEM;
|
|
diff --git a/include/linux/io.h b/include/linux/io.h
|
|
index 32e30e8fb9db..da39ff89df65 100644
|
|
--- a/include/linux/io.h
|
|
+++ b/include/linux/io.h
|
|
@@ -75,6 +75,8 @@ static inline void devm_ioport_unmap(struct device *dev, void __iomem *addr)
|
|
|
|
void __iomem *devm_ioremap(struct device *dev, resource_size_t offset,
|
|
resource_size_t size);
|
|
+void __iomem *devm_ioremap_uc(struct device *dev, resource_size_t offset,
|
|
+ resource_size_t size);
|
|
void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset,
|
|
resource_size_t size);
|
|
void __iomem *devm_ioremap_wc(struct device *dev, resource_size_t offset,
|
|
diff --git a/lib/devres.c b/lib/devres.c
|
|
index faccf1a037d0..97c56f9893a4 100644
|
|
--- a/lib/devres.c
|
|
+++ b/lib/devres.c
|
|
@@ -9,6 +9,7 @@
|
|
enum devm_ioremap_type {
|
|
DEVM_IOREMAP = 0,
|
|
DEVM_IOREMAP_NC,
|
|
+ DEVM_IOREMAP_UC,
|
|
DEVM_IOREMAP_WC,
|
|
};
|
|
|
|
@@ -39,6 +40,9 @@ static void __iomem *__devm_ioremap(struct device *dev, resource_size_t offset,
|
|
case DEVM_IOREMAP_NC:
|
|
addr = ioremap_nocache(offset, size);
|
|
break;
|
|
+ case DEVM_IOREMAP_UC:
|
|
+ addr = ioremap_uc(offset, size);
|
|
+ break;
|
|
case DEVM_IOREMAP_WC:
|
|
addr = ioremap_wc(offset, size);
|
|
break;
|
|
@@ -68,6 +72,21 @@ void __iomem *devm_ioremap(struct device *dev, resource_size_t offset,
|
|
}
|
|
EXPORT_SYMBOL(devm_ioremap);
|
|
|
|
+/**
|
|
+ * devm_ioremap_uc - Managed ioremap_uc()
|
|
+ * @dev: Generic device to remap IO address for
|
|
+ * @offset: Resource address to map
|
|
+ * @size: Size of map
|
|
+ *
|
|
+ * Managed ioremap_uc(). Map is automatically unmapped on driver detach.
|
|
+ */
|
|
+void __iomem *devm_ioremap_uc(struct device *dev, resource_size_t offset,
|
|
+ resource_size_t size)
|
|
+{
|
|
+ return __devm_ioremap(dev, offset, size, DEVM_IOREMAP_UC);
|
|
+}
|
|
+EXPORT_SYMBOL_GPL(devm_ioremap_uc);
|
|
+
|
|
/**
|
|
* devm_ioremap_nocache - Managed ioremap_nocache()
|
|
* @dev: Generic device to remap IO address for
|
|
--
|
|
2.23.0
|
|
|