public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] alpha: fix ioread64be()/iowrite64be() helpers
@ 2024-07-30 15:27 Arnd Bergmann
  2024-07-31 15:47 ` Guenter Roeck
  2024-07-31 19:51 ` Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2024-07-30 15:27 UTC (permalink / raw)
  To: Richard Henderson, Ivan Kokshaysky, Matt Turner
  Cc: Arnd Bergmann, Paul E. McKenney, Kefeng Wang, Geert Uytterhoeven,
	Baoquan He, Jakub Kicinski, Breno Leitao, Linus Walleij,
	linux-alpha, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Compile-testing the crypto/caam driver on alpha showed a pre-existing
problem on alpha with iowrite64be() missing:

ERROR: modpost: "iowrite64be" [drivers/crypto/caam/caam_jr.ko] undefined!

The prototypes were added a while ago when we started using asm-generic/io.h,
but the implementation was still missing. At some point the ioread64/iowrite64
helpers were added, but the big-endian versions are still missing, and
the generic version (using readq/writeq) is would not work here.

Change it to wrap ioread64()/iowrite64() instead.

Fixes: beba3771d9e0 ("crypto: caam: Make CRYPTO_DEV_FSL_CAAM dependent of COMPILE_TEST")
Fixes: e19d4ebc536d ("alpha: add full ioread64/iowrite64 implementation")
Fixes: 7e772dad9913 ("alpha: Use generic <asm-generic/io.h>")
Closes: https://lore.kernel.org/all/CAHk-=wgEyzSxTs467NDOVfBSzWvUS6ztcwhiy=M3xog==KBmTw@mail.gmail.com/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I've queued this in the asm-generic tree now, will send a pull request
in the next few days to fix alpha allmodconfig.

 arch/alpha/include/asm/io.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h
index 2bb8cbeedf91..52212e47e917 100644
--- a/arch/alpha/include/asm/io.h
+++ b/arch/alpha/include/asm/io.h
@@ -534,8 +534,11 @@ extern inline void writeq(u64 b, volatile void __iomem *addr)
 
 #define ioread16be(p) swab16(ioread16(p))
 #define ioread32be(p) swab32(ioread32(p))
+#define ioread64be(p) swab64(ioread64(p))
 #define iowrite16be(v,p) iowrite16(swab16(v), (p))
 #define iowrite32be(v,p) iowrite32(swab32(v), (p))
+#define iowrite64be(v,p) iowrite64(swab64(v), (p))
+
 
 #define inb_p		inb
 #define inw_p		inw
@@ -634,8 +637,6 @@ extern void outsl (unsigned long port, const void *src, unsigned long count);
  */
 #define ioread64 ioread64
 #define iowrite64 iowrite64
-#define ioread64be ioread64be
-#define iowrite64be iowrite64be
 #define ioread8_rep ioread8_rep
 #define ioread16_rep ioread16_rep
 #define ioread32_rep ioread32_rep
-- 
2.39.2


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

* Re: [PATCH] alpha: fix ioread64be()/iowrite64be() helpers
  2024-07-30 15:27 [PATCH] alpha: fix ioread64be()/iowrite64be() helpers Arnd Bergmann
@ 2024-07-31 15:47 ` Guenter Roeck
  2024-08-01 13:48   ` Arnd Bergmann
  2024-07-31 19:51 ` Linus Walleij
  1 sibling, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2024-07-31 15:47 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Arnd Bergmann,
	Paul E. McKenney, Kefeng Wang, Geert Uytterhoeven, Baoquan He,
	Jakub Kicinski, Breno Leitao, Linus Walleij, linux-alpha,
	linux-kernel

On Tue, Jul 30, 2024 at 05:27:25PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Compile-testing the crypto/caam driver on alpha showed a pre-existing
> problem on alpha with iowrite64be() missing:
> 
> ERROR: modpost: "iowrite64be" [drivers/crypto/caam/caam_jr.ko] undefined!
> 
> The prototypes were added a while ago when we started using asm-generic/io.h,
> but the implementation was still missing. At some point the ioread64/iowrite64
> helpers were added, but the big-endian versions are still missing, and
> the generic version (using readq/writeq) is would not work here.
> 
> Change it to wrap ioread64()/iowrite64() instead.
> 
> Fixes: beba3771d9e0 ("crypto: caam: Make CRYPTO_DEV_FSL_CAAM dependent of COMPILE_TEST")
> Fixes: e19d4ebc536d ("alpha: add full ioread64/iowrite64 implementation")
> Fixes: 7e772dad9913 ("alpha: Use generic <asm-generic/io.h>")
> Closes: https://lore.kernel.org/all/CAHk-=wgEyzSxTs467NDOVfBSzWvUS6ztcwhiy=M3xog==KBmTw@mail.gmail.com/
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

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

> ---
> I've queued this in the asm-generic tree now, will send a pull request
> in the next few days to fix alpha allmodconfig.
> 
>  arch/alpha/include/asm/io.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h
> index 2bb8cbeedf91..52212e47e917 100644
> --- a/arch/alpha/include/asm/io.h
> +++ b/arch/alpha/include/asm/io.h
> @@ -534,8 +534,11 @@ extern inline void writeq(u64 b, volatile void __iomem *addr)
>  
>  #define ioread16be(p) swab16(ioread16(p))
>  #define ioread32be(p) swab32(ioread32(p))
> +#define ioread64be(p) swab64(ioread64(p))
>  #define iowrite16be(v,p) iowrite16(swab16(v), (p))
>  #define iowrite32be(v,p) iowrite32(swab32(v), (p))
> +#define iowrite64be(v,p) iowrite64(swab64(v), (p))
> +
>  

FWIW: Unnecessary extra blank line

Thanks,
Guenter

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

* Re: [PATCH] alpha: fix ioread64be()/iowrite64be() helpers
  2024-07-30 15:27 [PATCH] alpha: fix ioread64be()/iowrite64be() helpers Arnd Bergmann
  2024-07-31 15:47 ` Guenter Roeck
@ 2024-07-31 19:51 ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2024-07-31 19:51 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Arnd Bergmann,
	Paul E. McKenney, Kefeng Wang, Geert Uytterhoeven, Baoquan He,
	Jakub Kicinski, Breno Leitao, linux-alpha, linux-kernel

On Tue, Jul 30, 2024 at 5:27 PM Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
>
> Compile-testing the crypto/caam driver on alpha showed a pre-existing
> problem on alpha with iowrite64be() missing:
>
> ERROR: modpost: "iowrite64be" [drivers/crypto/caam/caam_jr.ko] undefined!
>
> The prototypes were added a while ago when we started using asm-generic/io.h,
> but the implementation was still missing. At some point the ioread64/iowrite64
> helpers were added, but the big-endian versions are still missing, and
> the generic version (using readq/writeq) is would not work here.
>
> Change it to wrap ioread64()/iowrite64() instead.
>
> Fixes: beba3771d9e0 ("crypto: caam: Make CRYPTO_DEV_FSL_CAAM dependent of COMPILE_TEST")
> Fixes: e19d4ebc536d ("alpha: add full ioread64/iowrite64 implementation")
> Fixes: 7e772dad9913 ("alpha: Use generic <asm-generic/io.h>")
> Closes: https://lore.kernel.org/all/CAHk-=wgEyzSxTs467NDOVfBSzWvUS6ztcwhiy=M3xog==KBmTw@mail.gmail.com/
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

So *that* was the problem, I was scratching my head over this one.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH] alpha: fix ioread64be()/iowrite64be() helpers
  2024-07-31 15:47 ` Guenter Roeck
@ 2024-08-01 13:48   ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2024-08-01 13:48 UTC (permalink / raw)
  To: Guenter Roeck, Arnd Bergmann
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Paul E. McKenney,
	Kefeng Wang, Geert Uytterhoeven, Baoquan He, Jakub Kicinski,
	Breno Leitao, Linus Walleij, linux-alpha, linux-kernel

On Wed, Jul 31, 2024, at 17:47, Guenter Roeck wrote:
> On Tue, Jul 30, 2024 at 05:27:25PM +0200, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>> 
>> Compile-testing the crypto/caam driver on alpha showed a pre-existing
>> problem on alpha with iowrite64be() missing:
>> 
>> ERROR: modpost: "iowrite64be" [drivers/crypto/caam/caam_jr.ko] undefined!
>> 
>> The prototypes were added a while ago when we started using asm-generic/io.h,
>> but the implementation was still missing. At some point the ioread64/iowrite64
>> helpers were added, but the big-endian versions are still missing, and
>> the generic version (using readq/writeq) is would not work here.
>> 
>> Change it to wrap ioread64()/iowrite64() instead.
>> 
>> Fixes: beba3771d9e0 ("crypto: caam: Make CRYPTO_DEV_FSL_CAAM dependent of COMPILE_TEST")
>> Fixes: e19d4ebc536d ("alpha: add full ioread64/iowrite64 implementation")
>> Fixes: 7e772dad9913 ("alpha: Use generic <asm-generic/io.h>")
>> Closes: https://lore.kernel.org/all/CAHk-=wgEyzSxTs467NDOVfBSzWvUS6ztcwhiy=M3xog==KBmTw@mail.gmail.com/
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Tested-by: Guenter Roeck <linux@roeck-us.net>

Thanks!

>> +#define ioread64be(p) swab64(ioread64(p))
>>  #define iowrite16be(v,p) iowrite16(swab16(v), (p))
>>  #define iowrite32be(v,p) iowrite32(swab32(v), (p))
>> +#define iowrite64be(v,p) iowrite64(swab64(v), (p))
>> +
>>  

Fixed

      Arnd

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

end of thread, other threads:[~2024-08-01 13:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-30 15:27 [PATCH] alpha: fix ioread64be()/iowrite64be() helpers Arnd Bergmann
2024-07-31 15:47 ` Guenter Roeck
2024-08-01 13:48   ` Arnd Bergmann
2024-07-31 19:51 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox