mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Linus Torvalds" <torvalds@linux-foundation.org>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	"Ingo Molnar" <mingo@kernel.org>,
	"Johannes Berg" <johannes@sipsolutions.net>
Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: Linux 6.11-rc1
Date: Mon, 29 Jul 2024 23:34:41 +0200	[thread overview]
Message-ID: <eb1f2ec4-2bdb-4695-8e69-867ff25aa405@app.fastmail.com> (raw)
In-Reply-To: <CAHk-=wgEyzSxTs467NDOVfBSzWvUS6ztcwhiy=M3xog==KBmTw@mail.gmail.com>

On Mon, Jul 29, 2024, at 21:50, Linus Torvalds wrote:
> On Mon, 29 Jul 2024 at 12:23, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>>
>> And that fix (if it fixes it - I think it will) still leaves the alpha
>> allmodconfig build and all the failed tests.
>>
>> I'll take a look.
>
> Well, the alpha allmodconfig case is apparently
>
>   ERROR: modpost: "iowrite64be" [drivers/crypto/caam/caam_jr.ko] undefined!
>
> which I suspect it just a result of commit beba3771d9e0 ("crypto:
> caam: Make CRYPTO_DEV_FSL_CAAM dependent of COMPILE_TEST").
>
> IOW, that is almost certainly simply due to better build test
> coverage, not a new bug.
>
> But I didn't look into *why* it would fail. We have a comment about
> iowrite64be saying
>
>  * These get provided from <asm-generic/iomap.h> since alpha does not
>  * select GENERIC_IOMAP.
>
> and I'm not sure why that isn't correct.
>
> I get a feeling that lib/iomap.c is missing a couple of functions, but
> didn't look into it a lot.
>
> I suspect Arnd may be the right person to ask. Arnd?

Yes, I've noticed this problem a few weeks ago with another
driver as we tried to fix the usage of iowrite64() on 32-bit
architectures. We actually have two old bugs here and still
need to make a decision about how to fix that properly:

- ioread64()/iowrite64() and their variants are defined
  differently on architectures depending on whether they use
  CONFIG_GENERIC_IOMAP (x86, um, and a few rare configs
  elsewhere) or not. On GENERIC_IOMAP architectures, there
  is no 64-bit PIO, so lib/iomap.c only provides the
  iowrite64_hi_lo()/iowrite64_lo_hi() etc wrappers that do
  a pair of 32-bit accessors for PIO but native 64-bit
  MMIO. On other 64-bit architectures, iowrite64() is the
  same as writeq() and it can operate on PCI I/O space as
  well. Drivers with big-endian registers tend to use
  iowriteXXbe() in order to the correct byteswap in the
  absence of writeX_be().

- Alpha (and I think parisc) uses the asm-generic/iomap.h
  header that is meant for GENERIC_IOMAP but then provides
  its own functions. It never had iowrite64be() and we
  didn't notice this in the absence of users. The caam driver
  includes include/linux/io-64-nonatomic-lo-hi.h, which
  then redirects iowrite64be() to iowrite64be_lo_hi()
  on x86 (since it does not define iowrite64be()) and
  on 32-bit architectures, but uses iowrite64be() from
  include/asm-generic/io.h on most other 64-bit
  architectures. On alpha it uses the incorrect
  prototype.

I suspect we can fix the alpha issue with the trivial
change below (haven't tested yet), but the way we are
inconsistent about these will likely keep biting us
unless we come up with a better way to handle them
across architectures.

      Arnd

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,10 @@ 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

  reply	other threads:[~2024-07-29 21:35 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-28 21:40 Linus Torvalds
2024-07-29  9:28 ` Build regressions/improvements in v6.11-rc1 Geert Uytterhoeven
2024-07-29  9:35   ` Geert Uytterhoeven
2024-07-29  9:54     ` Arnd Bergmann
2024-07-29 10:07       ` Geert Uytterhoeven
2024-07-29 15:29 ` Linux 6.11-rc1 Guenter Roeck
2024-07-29 19:23   ` Linus Torvalds
2024-07-29 19:50     ` Linus Torvalds
2024-07-29 21:34       ` Arnd Bergmann [this message]
2024-07-29 23:47         ` Linus Torvalds
2024-07-30 15:47           ` Arnd Bergmann
2024-07-30  7:54     ` Peter Zijlstra
2024-07-31 15:45     ` Guenter Roeck
2024-07-30 17:04   ` Guenter Roeck
2024-07-30 17:20     ` Jens Axboe
2024-07-30 18:22       ` Guenter Roeck
2024-07-30 18:35         ` Jens Axboe
2024-07-30 18:54           ` Jens Axboe
2024-07-30 18:53     ` Linus Torvalds
2024-07-30 19:22       ` Peter Zijlstra
2024-07-30 19:31         ` Jens Axboe
2024-07-30 19:34           ` Jens Axboe
2024-07-30 19:38           ` Peter Zijlstra
2024-07-30 19:41             ` Linus Torvalds
2024-07-30 20:04             ` Guenter Roeck
2024-07-30 20:09               ` Peter Zijlstra
2024-07-30 21:12                 ` Peter Zijlstra
2024-07-30 23:29                 ` Guenter Roeck
2024-07-30 23:54                   ` Linus Torvalds
2024-07-31  8:21                     ` Borislav Petkov
2024-07-31  9:11                       ` Peter Zijlstra
2024-07-31 10:02                         ` Borislav Petkov
2024-07-31 14:37                       ` Guenter Roeck
2024-07-31 13:24                     ` Jens Axboe
2024-07-30 20:13               ` Linus Torvalds
2024-07-30 20:24             ` Guenter Roeck
2024-07-31 12:20               ` Peter Zijlstra
2024-07-31 13:03                 ` Thomas Gleixner
2024-07-31 15:55                   ` Peter Zijlstra
2024-07-31 16:17                     ` Linus Torvalds
2024-07-31 16:31                       ` Peter Zijlstra
2024-07-31 16:50                         ` Guenter Roeck
2024-07-31 16:51                         ` Peter Zijlstra
2024-07-31 17:26                           ` Thomas Gleixner
2024-07-31 21:20                             ` Peter Zijlstra
2024-07-31 21:23                               ` Linus Torvalds
2024-07-31 21:26                                 ` Peter Zijlstra
2024-07-31 21:41                                   ` Linus Torvalds
2024-07-31 21:47                                     ` Thomas Gleixner
2024-07-31 22:22                               ` Guenter Roeck
2024-08-01  8:54                                 ` Peter Zijlstra
2024-08-01 10:55                         ` [tip: x86/urgent] x86/mm: Fix pti_clone_pgtable() alignment assumption tip-bot2 for Peter Zijlstra
2024-08-01 13:03                         ` tip-bot2 for Peter Zijlstra
2024-07-31 16:49                       ` Linux 6.11-rc1 Guenter Roeck
2024-07-31 17:19                         ` Thomas Gleixner
2024-07-31 10:33       ` Peter Zijlstra
2024-07-31 14:15         ` Peter Zijlstra
2024-08-02 17:35   ` Linus Walleij
2024-08-02 19:40     ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eb1f2ec4-2bdb-4695-8e69-867ff25aa405@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=bigeasy@linutronix.de \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®