Linux Serial subsystem development
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Linus Walleij" <linusw@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH v2] serial: 8250: handle ixp4xx register endianness correctly
Date: Thu, 09 Jul 2026 22:33:16 +0200	[thread overview]
Message-ID: <8e8795a0-704f-46d0-bb1d-5833f642df7b@app.fastmail.com> (raw)
In-Reply-To: <20260709-ixp4xx-serial-hackfix-v2-1-465fc8e4c54c@kernel.org>

On Thu, Jul 9, 2026, at 21:21, Linus Walleij wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Unlike modern SoCs that just work in both big-endian and little-endian
> mode using the readl()/writel() or readb()/writeb() accessors, the
> internal registers on ixp4xx behave like native-endian 32-bit registers
> in both modes, which requires adjusting the register address
> when using 8-bit access.
>
> The existing dts files are written for big-endian kernels and 8-bit
> access, which does not work with little-endian kernels.
>
> Add a quirk that makes the 8250 OF driver:
>
> 1. Mask off any hardcoded offset.
> 2. Add the += 3 offset if and only if we are running on big endian.
>
> This should work in all combinations of big-endian and little-endian
> kernels with either variant of the DTS file.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> [linusw@kernel.org: Modified to just play with the offset]
> Signed-off-by: Linus Walleij <linusw@kernel.org>
> ---
> Changes in v2:
> - Use PTR_ALIGN_DOWN(*,4) instead of the custom &= 3, which also
>   works with a pointer which is an unsigned char *
> - Fix to the earlycon code to do the same thing as the main
>   serial port.
> - Link to v1: 
> https://patch.msgid.link/20260709-ixp4xx-serial-hackfix-v1-1-cd1c29d02183@kernel.org

Thanks a lot for the update, this looks good to me now.

It's barely worth keeping my authorship on it, as I'm sure
you have put more work into it than I did, but it's probably
not worth resending it just for that unless something else
comes up.

    Arnd

  reply	other threads:[~2026-07-09 20:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 19:21 [PATCH v2] serial: 8250: handle ixp4xx register endianness correctly Linus Walleij
2026-07-09 20:33 ` Arnd Bergmann [this message]
2026-07-09 21:24   ` Linus Walleij

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=8e8795a0-704f-46d0-bb1d-5833f642df7b@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-serial@vger.kernel.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