2019-10-17 13:55:13

by Tuowen Zhao

[permalink] [raw]
Subject: [PATCH v5 0/4] Fix MTRR bug for intel-lpss-pci

Some BIOS erroneously specifies write-combining BAR for intel-lpss-pci
in MTRR. This will cause the system to hang during boot. If possible,
this bug could be corrected with a firmware update.

Previous version: https://lkml.org/lkml/2019/10/14/575

Changes from previous version:

* implement ioremap_uc for sparc64
* split docs changes to not CC stable (doc location moved since 5.3)

Tuowen Zhao (4):
sparc64: implement ioremap_uc
lib: devres: add a helper function for ioremap_uc
mfd: intel-lpss: use devm_ioremap_uc for MMIO
docs: driver-model: add devm_ioremap_uc

.../driver-api/driver-model/devres.rst | 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(-)

--
2.23.0


2019-10-17 13:56:12

by Tuowen Zhao

[permalink] [raw]
Subject: [PATCH v5 1/4] sparc64: implement ioremap_uc

On sparc64, the whole physical IO address space is accessible using
physically addressed loads and stores. *_uc does nothing like the
others.

Cc: <[email protected]>
Reported-by: kbuild test robot <[email protected]>
Signed-off-by: Tuowen Zhao <[email protected]>
---
arch/sparc/include/asm/io_64.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h
index 688911051b44..f4afa301954a 100644
--- a/arch/sparc/include/asm/io_64.h
+++ b/arch/sparc/include/asm/io_64.h
@@ -407,6 +407,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))

--
2.23.0

2019-10-17 13:57:34

by Tuowen Zhao

[permalink] [raw]
Subject: [PATCH v5 3/4] mfd: intel-lpss: use devm_ioremap_uc for MMIO

Some BIOS erroneously specifies write-combining BAR for intel-lpss-pci
in MTRR. This will cause the system to hang during boot. If possible,
this bug could be corrected with a firmware update.

This patch use devm_ioremap_uc to overwrite/ignore the MTRR settings
by forcing the use of strongly uncachable pages for intel-lpss.

The BIOS bug is present on Dell XPS 13 7390 2-in-1:

[ 0.001734] 5 base 4000000000 mask 6000000000 write-combining

4000000000-7fffffffff : PCI Bus 0000:00
4000000000-400fffffff : 0000:00:02.0 (i915)
4010000000-4010000fff : 0000:00:15.0 (intel-lpss-pci)

Link: https://bugzilla.kernel.org/show_bug.cgi?id=203485
Cc: <[email protected]>
Tested-by: AceLan Kao <[email protected]>
Signed-off-by: Tuowen Zhao <[email protected]>
Acked-by: Mika Westerberg <[email protected]>
Acked-by: Andy Shevchenko <[email protected]>
Acked-for-MFD-by: Lee Jones <[email protected]>
---
drivers/mfd/intel-lpss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
index bfe4ff337581..b0f0781a6b9c 100644
--- a/drivers/mfd/intel-lpss.c
+++ b/drivers/mfd/intel-lpss.c
@@ -384,7 +384,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;
--
2.23.0

2019-10-17 13:58:22

by Tuowen Zhao

[permalink] [raw]
Subject: [PATCH v5 4/4] docs: driver-model: add devm_ioremap_uc

Signed-off-by: Tuowen Zhao <[email protected]>
---
Documentation/driver-api/driver-model/devres.rst | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index a100bef54952..92628fdc2f11 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -314,6 +314,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()
--
2.23.0

2019-10-17 13:59:21

by Tuowen Zhao

[permalink] [raw]
Subject: [PATCH v5 2/4] lib: devres: add a helper function for ioremap_uc

Implement a resource managed strongly uncachable ioremap function.

Cc: <[email protected]>
Tested-by: AceLan Kao <[email protected]>
Signed-off-by: Tuowen Zhao <[email protected]>
Acked-by: Mika Westerberg <[email protected]>
Acked-by: Andy Shevchenko <[email protected]>
Acked-by: Luis Chamberlain <[email protected]>
Acked-for-MFD-by: Lee Jones <[email protected]>
---
include/linux/io.h | 2 ++
lib/devres.c | 19 +++++++++++++++++++
2 files changed, 21 insertions(+)

diff --git a/include/linux/io.h b/include/linux/io.h
index accac822336a..a59834bc0a11 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -64,6 +64,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 6a0e9bd6524a..17624d35e82d 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

2019-10-17 14:02:55

by David Miller

[permalink] [raw]
Subject: Re: [PATCH v5 1/4] sparc64: implement ioremap_uc

From: Tuowen Zhao <[email protected]>
Date: Wed, 16 Oct 2019 15:06:27 -0600

> On sparc64, the whole physical IO address space is accessible using
> physically addressed loads and stores. *_uc does nothing like the
> others.
>
> Cc: <[email protected]>
> Reported-by: kbuild test robot <[email protected]>
> Signed-off-by: Tuowen Zhao <[email protected]>

Acked-by: David S. Miller <[email protected]>

2019-10-18 10:03:00

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v5 0/4] Fix MTRR bug for intel-lpss-pci

On Wed, Oct 16, 2019 at 03:06:25PM -0600, Tuowen Zhao wrote:
> Some BIOS erroneously specifies write-combining BAR for intel-lpss-pci
> in MTRR. This will cause the system to hang during boot. If possible,
> this bug could be corrected with a firmware update.
>
> Previous version: https://lkml.org/lkml/2019/10/14/575
>
> Changes from previous version:
>
> * implement ioremap_uc for sparc64
> * split docs changes to not CC stable (doc location moved since 5.3)
>

It forgot to explicitly mention through which tree is supposed to go.
I think it's MFD one, correct?

Other than above remark, the series looks good to me, thanks!

--
With Best Regards,
Andy Shevchenko


2019-10-18 10:13:10

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v5 0/4] Fix MTRR bug for intel-lpss-pci

On Thu, 17 Oct 2019, Andy Shevchenko wrote:

> On Wed, Oct 16, 2019 at 03:06:25PM -0600, Tuowen Zhao wrote:
> > Some BIOS erroneously specifies write-combining BAR for intel-lpss-pci
> > in MTRR. This will cause the system to hang during boot. If possible,
> > this bug could be corrected with a firmware update.
> >
> > Previous version: https://lkml.org/lkml/2019/10/14/575
> >
> > Changes from previous version:
> >
> > * implement ioremap_uc for sparc64
> > * split docs changes to not CC stable (doc location moved since 5.3)
> >
>
> It forgot to explicitly mention through which tree is supposed to go.
> I think it's MFD one, correct?

To be fair, that's not really up to the submitter to decide.

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2019-10-18 10:14:50

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v5 0/4] Fix MTRR bug for intel-lpss-pci

On Thu, Oct 17, 2019 at 08:31:16AM +0100, Lee Jones wrote:
> On Thu, 17 Oct 2019, Andy Shevchenko wrote:
> > On Wed, Oct 16, 2019 at 03:06:25PM -0600, Tuowen Zhao wrote:
> > > Some BIOS erroneously specifies write-combining BAR for intel-lpss-pci
> > > in MTRR. This will cause the system to hang during boot. If possible,
> > > this bug could be corrected with a firmware update.
> > >
> > > Previous version: https://lkml.org/lkml/2019/10/14/575
> > >
> > > Changes from previous version:
> > >
> > > * implement ioremap_uc for sparc64
> > > * split docs changes to not CC stable (doc location moved since 5.3)
> > >
> >
> > It forgot to explicitly mention through which tree is supposed to go.
> > I think it's MFD one, correct?
>
> To be fair, that's not really up to the submitter to decide.

Submitter still can share their view, no?

--
With Best Regards,
Andy Shevchenko


2019-10-18 10:15:22

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v5 0/4] Fix MTRR bug for intel-lpss-pci

On Thu, 17 Oct 2019, Andy Shevchenko wrote:

> On Thu, Oct 17, 2019 at 08:31:16AM +0100, Lee Jones wrote:
> > On Thu, 17 Oct 2019, Andy Shevchenko wrote:
> > > On Wed, Oct 16, 2019 at 03:06:25PM -0600, Tuowen Zhao wrote:
> > > > Some BIOS erroneously specifies write-combining BAR for intel-lpss-pci
> > > > in MTRR. This will cause the system to hang during boot. If possible,
> > > > this bug could be corrected with a firmware update.
> > > >
> > > > Previous version: https://lkml.org/lkml/2019/10/14/575
> > > >
> > > > Changes from previous version:
> > > >
> > > > * implement ioremap_uc for sparc64
> > > > * split docs changes to not CC stable (doc location moved since 5.3)
> > > >
> > >
> > > It forgot to explicitly mention through which tree is supposed to go.
> > > I think it's MFD one, correct?
> >
> > To be fair, that's not really up to the submitter to decide.
>
> Submitter still can share their view, no?

Preferences can be voiced, if held, and will always be taken into
consideration. The final decision will always be made by the people
managing the trees.

The comment above implies a requirement to specify which tree is
preferred, which is not the case. In almost all cases, it's best not
to specify.

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2019-10-18 14:00:18

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v5 0/4] Fix MTRR bug for intel-lpss-pci

On Thu, Oct 17, 2019 at 09:22:01AM +0100, Lee Jones wrote:
> On Thu, 17 Oct 2019, Andy Shevchenko wrote:
> > On Thu, Oct 17, 2019 at 08:31:16AM +0100, Lee Jones wrote:
> > > On Thu, 17 Oct 2019, Andy Shevchenko wrote:
> > > > On Wed, Oct 16, 2019 at 03:06:25PM -0600, Tuowen Zhao wrote:
> > > > > Some BIOS erroneously specifies write-combining BAR for intel-lpss-pci
> > > > > in MTRR. This will cause the system to hang during boot. If possible,
> > > > > this bug could be corrected with a firmware update.
> > > > >
> > > > > Previous version: https://lkml.org/lkml/2019/10/14/575
> > > > >
> > > > > Changes from previous version:
> > > > >
> > > > > * implement ioremap_uc for sparc64
> > > > > * split docs changes to not CC stable (doc location moved since 5.3)
> > > > >
> > > >
> > > > It forgot to explicitly mention through which tree is supposed to go.
> > > > I think it's MFD one, correct?
> > >
> > > To be fair, that's not really up to the submitter to decide.
> >
> > Submitter still can share their view, no?
>
> Preferences can be voiced, if held, and will always be taken into
> consideration. The final decision will always be made by the people
> managing the trees.
>
> The comment above implies a requirement to specify which tree is
> preferred, which is not the case. In almost all cases, it's best not
> to specify.

In my practice I had been asked several times to specify and express my
understanding which subsystem should take series. It's not so unequivocally.

--
With Best Regards,
Andy Shevchenko


2019-10-18 22:10:20

by Tuowen Zhao

[permalink] [raw]
Subject: Re: [PATCH v5 2/4] lib: devres: add a helper function for ioremap_uc

Sorry, patches in this set should have tag # v4.19+

Should I resubmit a set with the correct tags?

Tuowen

2019-10-19 08:48:54

by Sasha Levin

[permalink] [raw]
Subject: Re: [PATCH v5 2/4] lib: devres: add a helper function for ioremap_uc

On Thu, Oct 17, 2019 at 11:49:50AM -0600, Tuowen Zhao wrote:
>Sorry, patches in this set should have tag # v4.19+
>
>Should I resubmit a set with the correct tags?

Nah, this note should be good enough, thanks.

--
Thanks,
Sasha

2019-10-22 19:04:40

by Roman Gilg

[permalink] [raw]
Subject: Re: [PATCH v5 3/4] mfd: intel-lpss: use devm_ioremap_uc for MMIO

On Thu, Oct 17, 2019 at 7:48 PM Tuowen Zhao <[email protected]> wrote:
>
> Some BIOS erroneously specifies write-combining BAR for intel-lpss-pci
> in MTRR. This will cause the system to hang during boot. If possible,
> this bug could be corrected with a firmware update.
>
> This patch use devm_ioremap_uc to overwrite/ignore the MTRR settings
> by forcing the use of strongly uncachable pages for intel-lpss.
>
> The BIOS bug is present on Dell XPS 13 7390 2-in-1:
>
> [ 0.001734] 5 base 4000000000 mask 6000000000 write-combining
>
> 4000000000-7fffffffff : PCI Bus 0000:00
> 4000000000-400fffffff : 0000:00:02.0 (i915)
> 4010000000-4010000fff : 0000:00:15.0 (intel-lpss-pci)
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=203485
> Cc: <[email protected]>
> Tested-by: AceLan Kao <[email protected]>
> Signed-off-by: Tuowen Zhao <[email protected]>
> Acked-by: Mika Westerberg <[email protected]>
> Acked-by: Andy Shevchenko <[email protected]>
> Acked-for-MFD-by: Lee Jones <[email protected]>
> ---
> drivers/mfd/intel-lpss.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
> index bfe4ff337581..b0f0781a6b9c 100644
> --- a/drivers/mfd/intel-lpss.c
> +++ b/drivers/mfd/intel-lpss.c
> @@ -384,7 +384,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;
> --
> 2.23.0
>

Tested this v5 series on an XPS 13 7390 2-in-1 with Manjaro/KDE
install and works fine there. Fixes hang during boot. Currently being
backported to 5.3 on that distro:
https://gitlab.manjaro.org/packages/core/linux53/commit/c00ddfb5

Tested-by: Roman Gilg <[email protected]>

2019-10-23 11:27:52

by Luis Chamberlain

[permalink] [raw]
Subject: Re: [PATCH v5 4/4] docs: driver-model: add devm_ioremap_uc

On Wed, Oct 16, 2019 at 03:06:30PM -0600, Tuowen Zhao wrote:
> Signed-off-by: Tuowen Zhao <[email protected]>

Acked-by: Luis Chamberlain <[email protected]>

Luis

2019-11-11 08:42:26

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v5 2/4] lib: devres: add a helper function for ioremap_uc

On Wed, 16 Oct 2019, Tuowen Zhao wrote:

> Implement a resource managed strongly uncachable ioremap function.
>
> Cc: <[email protected]>
> Tested-by: AceLan Kao <[email protected]>
> Signed-off-by: Tuowen Zhao <[email protected]>
> Acked-by: Mika Westerberg <[email protected]>
> Acked-by: Andy Shevchenko <[email protected]>
> Acked-by: Luis Chamberlain <[email protected]>
> Acked-for-MFD-by: Lee Jones <[email protected]>
> ---
> include/linux/io.h | 2 ++
> lib/devres.c | 19 +++++++++++++++++++
> 2 files changed, 21 insertions(+)

Applied, thanks.

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2019-11-11 08:43:11

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v5 3/4] mfd: intel-lpss: use devm_ioremap_uc for MMIO

On Wed, 16 Oct 2019, Tuowen Zhao wrote:

> Some BIOS erroneously specifies write-combining BAR for intel-lpss-pci
> in MTRR. This will cause the system to hang during boot. If possible,
> this bug could be corrected with a firmware update.
>
> This patch use devm_ioremap_uc to overwrite/ignore the MTRR settings
> by forcing the use of strongly uncachable pages for intel-lpss.
>
> The BIOS bug is present on Dell XPS 13 7390 2-in-1:
>
> [ 0.001734] 5 base 4000000000 mask 6000000000 write-combining
>
> 4000000000-7fffffffff : PCI Bus 0000:00
> 4000000000-400fffffff : 0000:00:02.0 (i915)
> 4010000000-4010000fff : 0000:00:15.0 (intel-lpss-pci)
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=203485
> Cc: <[email protected]>
> Tested-by: AceLan Kao <[email protected]>
> Signed-off-by: Tuowen Zhao <[email protected]>
> Acked-by: Mika Westerberg <[email protected]>
> Acked-by: Andy Shevchenko <[email protected]>
> Acked-for-MFD-by: Lee Jones <[email protected]>
> ---
> drivers/mfd/intel-lpss.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2019-11-11 08:44:31

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v5 4/4] docs: driver-model: add devm_ioremap_uc

On Wed, 16 Oct 2019, Tuowen Zhao wrote:

> Signed-off-by: Tuowen Zhao <[email protected]>
> ---
> Documentation/driver-api/driver-model/devres.rst | 1 +
> 1 file changed, 1 insertion(+)

Applied, thanks.

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2019-11-11 08:44:42

by Lee Jones

[permalink] [raw]
Subject: [GIT PULL] Immutable branch between MFD, Docs, Sparc and Lib Devres due for the v5.5 merge window

Enjoy!

The following changes since commit 54ecb8f7028c5eb3d740bb82b0f1d90f2df63c5c:

Linux 5.4-rc1 (2019-09-30 10:35:40 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-doc-sparc-libdevres-v5.5

for you to fetch changes up to 7b8c4d73d7fe68f371d11b38a353134e1ffe199f:

docs: driver-model: add devm_ioremap_uc (2019-11-11 08:40:27 +0000)

----------------------------------------------------------------
Immutable branch between MFD, Docs, Sparc and Lib Devres due for the v5.5 merge window

----------------------------------------------------------------
Tuowen Zhao (4):
sparc64: implement ioremap_uc
lib: devres: add a helper function for ioremap_uc
mfd: intel-lpss: Use devm_ioremap_uc for MMIO
docs: driver-model: add devm_ioremap_uc

Documentation/driver-api/driver-model/devres.rst | 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(-)

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2019-12-04 16:00:13

by Tuowen Zhao

[permalink] [raw]
Subject: Re: [PATCH v5 2/4] lib: devres: add a helper function for ioremap_uc

Hi Sasha,

Sorry to bother. Can I ask for patches in this series to NOT be applied
to stable?

They causes build failure on Hexagon.

Relevant patches include

sparc64: implement ioremap_uc
lib: devres: add a helper function for ioremap_uc
mfd: intel-lpss: Use devm_ioremap_uc for MMIO

Best,
Tuowen

2019-12-04 19:56:02

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v5 2/4] lib: devres: add a helper function for ioremap_uc

On Wed, Dec 04, 2019 at 08:51:30AM -0700, Tuowen Zhao wrote:
> Hi Sasha,
>
> Sorry to bother. Can I ask for patches in this series to NOT be applied
> to stable?
>
> They causes build failure on Hexagon.
>
> Relevant patches include
>
> sparc64: implement ioremap_uc
> lib: devres: add a helper function for ioremap_uc
> mfd: intel-lpss: Use devm_ioremap_uc for MMIO

Since Guenter submitted a fix, we can leave with these ones and fix applied together.

--
With Best Regards,
Andy Shevchenko


2019-12-04 20:17:05

by Tuowen Zhao

[permalink] [raw]
Subject: Re: [PATCH v5 2/4] lib: devres: add a helper function for ioremap_uc

On Wed, 2019-12-04 at 21:54 +0200, Andy Shevchenko wrote:
>
> Since Guenter submitted a fix, we can leave with these ones and fix
> applied together.
>

Since I have apparently missed something with hexagon, I don't feel
comfortable with messing with stable with this. I'm not sure as before
that this series is self-contained.

Tuowen

2019-12-10 08:08:25

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v5 2/4] lib: devres: add a helper function for ioremap_uc

On Mon, Nov 11, 2019 at 9:45 AM Lee Jones <[email protected]> wrote:
> On Wed, 16 Oct 2019, Tuowen Zhao wrote:
> > Implement a resource managed strongly uncachable ioremap function.
> >
> > Cc: <[email protected]>
> > Tested-by: AceLan Kao <[email protected]>
> > Signed-off-by: Tuowen Zhao <[email protected]>
> > Acked-by: Mika Westerberg <[email protected]>
> > Acked-by: Andy Shevchenko <[email protected]>
> > Acked-by: Luis Chamberlain <[email protected]>
> > Acked-for-MFD-by: Lee Jones <[email protected]>
> > ---
> > include/linux/io.h | 2 ++
> > lib/devres.c | 19 +++++++++++++++++++
> > 2 files changed, 21 insertions(+)
>
> Applied, thanks.

This is now commit e537654b7039aacf ("lib: devres: add a helper function
for ioremap_uc") in upstream.

Do we really need this? There is only one user of ioremap_uc(), which
Christoph is trying hard to get rid of, and now you made it mandatory.
https://lore.kernel.org/dri-devel/[email protected]/

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2019-12-10 08:09:49

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v5 1/4] sparc64: implement ioremap_uc

On Thu, Oct 17, 2019 at 7:47 PM Tuowen Zhao <[email protected]> wrote:
> On sparc64, the whole physical IO address space is accessible using
> physically addressed loads and stores. *_uc does nothing like the
> others.
>
> Cc: <[email protected]>
> Reported-by: kbuild test robot <[email protected]>
> Signed-off-by: Tuowen Zhao <[email protected]>
> ---
> arch/sparc/include/asm/io_64.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h
> index 688911051b44..f4afa301954a 100644
> --- a/arch/sparc/include/asm/io_64.h
> +++ b/arch/sparc/include/asm/io_64.h
> @@ -407,6 +407,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))

Do we really need this? There is only one user of ioremap_uc(), which
Christoph is trying hard to get rid of, and the new devres helper that
triggers all of this :-(
https://lore.kernel.org/dri-devel/[email protected]/

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2019-12-10 08:14:03

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v5 3/4] mfd: intel-lpss: use devm_ioremap_uc for MMIO

CC Christoph (ioremap() API cleanup)

On Thu, Oct 17, 2019 at 10:44 PM Tuowen Zhao <[email protected]> wrote:
> Some BIOS erroneously specifies write-combining BAR for intel-lpss-pci
> in MTRR. This will cause the system to hang during boot. If possible,
> this bug could be corrected with a firmware update.
>
> This patch use devm_ioremap_uc to overwrite/ignore the MTRR settings
> by forcing the use of strongly uncachable pages for intel-lpss.
>
> The BIOS bug is present on Dell XPS 13 7390 2-in-1:
>
> [ 0.001734] 5 base 4000000000 mask 6000000000 write-combining
>
> 4000000000-7fffffffff : PCI Bus 0000:00
> 4000000000-400fffffff : 0000:00:02.0 (i915)
> 4010000000-4010000fff : 0000:00:15.0 (intel-lpss-pci)
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=203485
> Cc: <[email protected]>
> Tested-by: AceLan Kao <[email protected]>
> Signed-off-by: Tuowen Zhao <[email protected]>
> Acked-by: Mika Westerberg <[email protected]>
> Acked-by: Andy Shevchenko <[email protected]>
> Acked-for-MFD-by: Lee Jones <[email protected]>
> ---
> drivers/mfd/intel-lpss.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
> index bfe4ff337581..b0f0781a6b9c 100644
> --- a/drivers/mfd/intel-lpss.c
> +++ b/drivers/mfd/intel-lpss.c
> @@ -384,7 +384,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;

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2019-12-10 12:51:45

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v5 2/4] lib: devres: add a helper function for ioremap_uc

On Tue, 10 Dec 2019, Geert Uytterhoeven wrote:

> On Mon, Nov 11, 2019 at 9:45 AM Lee Jones <[email protected]> wrote:
> > On Wed, 16 Oct 2019, Tuowen Zhao wrote:
> > > Implement a resource managed strongly uncachable ioremap function.
> > >
> > > Cc: <[email protected]>
> > > Tested-by: AceLan Kao <[email protected]>
> > > Signed-off-by: Tuowen Zhao <[email protected]>
> > > Acked-by: Mika Westerberg <[email protected]>
> > > Acked-by: Andy Shevchenko <[email protected]>
> > > Acked-by: Luis Chamberlain <[email protected]>
> > > Acked-for-MFD-by: Lee Jones <[email protected]>
> > > ---
> > > include/linux/io.h | 2 ++
> > > lib/devres.c | 19 +++++++++++++++++++
> > > 2 files changed, 21 insertions(+)
> >
> > Applied, thanks.
>
> This is now commit e537654b7039aacf ("lib: devres: add a helper function
> for ioremap_uc") in upstream.
>
> Do we really need this? There is only one user of ioremap_uc(), which
> Christoph is trying hard to get rid of, and now you made it mandatory.
> https://lore.kernel.org/dri-devel/[email protected]/

Patches welcome.

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog