All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] alpha: Fix ioread64/iowrite64 helpers
@ 2022-10-03 16:07 Guenter Roeck
  0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2022-10-03 16:07 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Arnd Bergmann,
	linux-alpha, linux-arch

On Mon, Oct 03, 2022 at 02:13:16PM +0200, Linus Walleij wrote:
> When doing allmod builds it turns out some modules are using
> ioread64() and iowrite64() that the alpha does not implement,
> as it is using <asm-generic/iomap.h> without selecting
> GENERIC_IOMAP.
> 
> Fix this by implementing the ioread64()/iowrite64() stubs
> as well, using readq() and writeq() respectively.
> 
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Fixes: 7e772dad9913 ("alpha: Use generic <asm-generic/io.h>")
> Link: https://lore.kernel.org/linux-arch/20221002224521.GA968453@roeck-us.net/
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Richard Henderson <richard.henderson@linaro.org>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Matt Turner <mattst88@gmail.com>
> Cc: linux-arch@vger.kernel.org
> Cc: linux-alpha@vger.kernel.org
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Tested-by: Guenter Roeck <linux@roeck-us.net>

Note that I don't have a preference about the two suggested patches.
Both fix the problem I had observed.

Thanks,
Guenter

> ---
> Arnd if this looks OK then please apply it on linux-arch
> for fixes.
> ---
>  arch/alpha/kernel/io.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/arch/alpha/kernel/io.c b/arch/alpha/kernel/io.c
> index 838586abb1e0..5f3e75a945c1 100644
> --- a/arch/alpha/kernel/io.c
> +++ b/arch/alpha/kernel/io.c
> @@ -41,6 +41,11 @@ unsigned int ioread32(const void __iomem *addr)
>  	return ret;
>  }
>  
> +u64 ioread64(const void __iomem *addr)
> +{
> +	return readq(addr);
> +}
> +
>  void iowrite8(u8 b, void __iomem *addr)
>  {
>  	mb();
> @@ -59,12 +64,19 @@ void iowrite32(u32 b, void __iomem *addr)
>  	IO_CONCAT(__IO_PREFIX,iowrite32)(b, addr);
>  }
>  
> +void iowrite64(u64 b, void __iomem *addr)
> +{
> +	writeq(b, addr);
> +}
> +
>  EXPORT_SYMBOL(ioread8);
>  EXPORT_SYMBOL(ioread16);
>  EXPORT_SYMBOL(ioread32);
> +EXPORT_SYMBOL(ioread64);
>  EXPORT_SYMBOL(iowrite8);
>  EXPORT_SYMBOL(iowrite16);
>  EXPORT_SYMBOL(iowrite32);
> +EXPORT_SYMBOL(iowrite64);
>  
>  u8 inb(unsigned long port)
>  {
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] alpha: Fix ioread64/iowrite64 helpers
  2022-10-03 13:04 ` Arnd Bergmann
@ 2022-10-03 18:47   ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2022-10-03 18:47 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-alpha,
	Guenter Roeck, Linux-Arch

On Mon, Oct 3, 2022 at 3:05 PM Arnd Bergmann <arnd@arndb.de> wrote:
> On Mon, Oct 3, 2022, at 2:13 PM, Linus Walleij wrote:
> > When doing allmod builds it turns out some modules are using
> > ioread64() and iowrite64() that the alpha does not implement,
> > as it is using <asm-generic/iomap.h> without selecting
> > GENERIC_IOMAP.
> >
> > Fix this by implementing the ioread64()/iowrite64() stubs
> > as well, using readq() and writeq() respectively.
> >
> > Reported-by: Guenter Roeck <linux@roeck-us.net>
> > Fixes: 7e772dad9913 ("alpha: Use generic <asm-generic/io.h>")
> > Link: https://lore.kernel.org/linux-arch/20221002224521.GA968453@roeck-us.net/
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Cc: Richard Henderson <richard.henderson@linaro.org>
> > Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> > Cc: Matt Turner <mattst88@gmail.com>
> > Cc: linux-arch@vger.kernel.org
> > Cc: linux-alpha@vger.kernel.org
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> > ---
> > Arnd if this looks OK then please apply it on linux-arch
> > for fixes.
> > --
>
> It looks like we just crossed patches. I also sent a fix a minute
> ago, but I think mine is better here because it also works on
> I/O ports.

Hey! :D
Take your patch instead.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] alpha: Fix ioread64/iowrite64 helpers
  2022-10-03 12:13 Linus Walleij
@ 2022-10-03 13:04 ` Arnd Bergmann
  2022-10-03 18:47   ` Linus Walleij
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2022-10-03 13:04 UTC (permalink / raw)
  To: Linus Walleij, Richard Henderson, Ivan Kokshaysky, Matt Turner
  Cc: linux-alpha, Guenter Roeck, Linux-Arch

On Mon, Oct 3, 2022, at 2:13 PM, Linus Walleij wrote:
> When doing allmod builds it turns out some modules are using
> ioread64() and iowrite64() that the alpha does not implement,
> as it is using <asm-generic/iomap.h> without selecting
> GENERIC_IOMAP.
>
> Fix this by implementing the ioread64()/iowrite64() stubs
> as well, using readq() and writeq() respectively.
>
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Fixes: 7e772dad9913 ("alpha: Use generic <asm-generic/io.h>")
> Link: https://lore.kernel.org/linux-arch/20221002224521.GA968453@roeck-us.net/
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Richard Henderson <richard.henderson@linaro.org>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Matt Turner <mattst88@gmail.com>
> Cc: linux-arch@vger.kernel.org
> Cc: linux-alpha@vger.kernel.org
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> Arnd if this looks OK then please apply it on linux-arch
> for fixes.
> --

It looks like we just crossed patches. I also sent a fix a minute
ago, but I think mine is better here because it also works on
I/O ports.

     Arnd

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] alpha: Fix ioread64/iowrite64 helpers
@ 2022-10-03 12:13 Linus Walleij
  2022-10-03 13:04 ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2022-10-03 12:13 UTC (permalink / raw)
  To: Richard Henderson, Ivan Kokshaysky, Matt Turner, Arnd Bergmann
  Cc: linux-alpha, Linus Walleij, Guenter Roeck, linux-arch

When doing allmod builds it turns out some modules are using
ioread64() and iowrite64() that the alpha does not implement,
as it is using <asm-generic/iomap.h> without selecting
GENERIC_IOMAP.

Fix this by implementing the ioread64()/iowrite64() stubs
as well, using readq() and writeq() respectively.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Fixes: 7e772dad9913 ("alpha: Use generic <asm-generic/io.h>")
Link: https://lore.kernel.org/linux-arch/20221002224521.GA968453@roeck-us.net/
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: linux-arch@vger.kernel.org
Cc: linux-alpha@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Arnd if this looks OK then please apply it on linux-arch
for fixes.
---
 arch/alpha/kernel/io.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/alpha/kernel/io.c b/arch/alpha/kernel/io.c
index 838586abb1e0..5f3e75a945c1 100644
--- a/arch/alpha/kernel/io.c
+++ b/arch/alpha/kernel/io.c
@@ -41,6 +41,11 @@ unsigned int ioread32(const void __iomem *addr)
 	return ret;
 }
 
+u64 ioread64(const void __iomem *addr)
+{
+	return readq(addr);
+}
+
 void iowrite8(u8 b, void __iomem *addr)
 {
 	mb();
@@ -59,12 +64,19 @@ void iowrite32(u32 b, void __iomem *addr)
 	IO_CONCAT(__IO_PREFIX,iowrite32)(b, addr);
 }
 
+void iowrite64(u64 b, void __iomem *addr)
+{
+	writeq(b, addr);
+}
+
 EXPORT_SYMBOL(ioread8);
 EXPORT_SYMBOL(ioread16);
 EXPORT_SYMBOL(ioread32);
+EXPORT_SYMBOL(ioread64);
 EXPORT_SYMBOL(iowrite8);
 EXPORT_SYMBOL(iowrite16);
 EXPORT_SYMBOL(iowrite32);
+EXPORT_SYMBOL(iowrite64);
 
 u8 inb(unsigned long port)
 {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-03 18:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-03 16:07 [PATCH] alpha: Fix ioread64/iowrite64 helpers Guenter Roeck
  -- strict thread matches above, loose matches on Subject: below --
2022-10-03 12:13 Linus Walleij
2022-10-03 13:04 ` Arnd Bergmann
2022-10-03 18:47   ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.