Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Fil Dunsky" <filipp.dunsky@gmail.com>
Cc: conor+dt@kernel.org, linux-serial@vger.kernel.org,
	robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH RFC 05/10] ARM: debug: Add Cortina Systems CS75xx UART0 support
Date: Wed, 30 Sep 2026 07:11:09 +0000	[thread overview]
Message-ID: <20260930071109.940D41F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260930-b4-cs75xx-v1-5-4617c4463529@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] arm: debug: cs75xx senduart clobbers register on BE8 breaking newlines
--

commit 8bcfce484cc05ad1abae605952a7f9c8f05d1c26
Author: Fil Dunsky <filipp.dunsky@gmail.com>

ARM: debug: Add Cortina Systems CS75xx UART0 support

Add low-level debug output through UART0 of the Cortina Systems CS75xx
SoCs. The UART is mapped at a fixed virtual address by the generic
debug_ll_io_init(), so no platform map_io is needed.

> diff --git a/arch/arm/include/debug/cs75xx.S b/arch/arm/include/debug/cs75xx.S
> new file mode 100644
> index 0000000000000..d840384cc32bd
> --- /dev/null
> +++ b/arch/arm/include/debug/cs75xx.S

[ ... ]

> +		.macro	addruart, rp, rv, tmp
> +		ldr	\rp, =CONFIG_DEBUG_UART_PHYS
> +		ldr	\rv, =CONFIG_DEBUG_UART_VIRT
> +		.endm
> +
> +		.macro	senduart, rd, rx
> +		ARM_BE8(rev \rd, \rd)
> +		str	\rd, [\rx, #CS75XX_UART_TXDAT]
> +		.endm

[Severity: Medium]
Does this rev instruction clobber the character register on big-endian (BE-8)
builds?

The macro reverses the bytes of \rd but does not restore it via a second rev.
This violates the caller's expectation that the character register is
preserved.

For example, when the compressed bootloader's puts function sends a newline,
it relies on the register retaining its value:

arch/arm/boot/compressed/head.S:puts()
    2:      writeb  r2, r3, r1
            mov     r1, #0x00020000
    3:      subs    r1, r1, #1
            bne     3b
            teq     r2, #'\n'
            moveq   r2, #'\r'
            beq     2b

If writeb (which wraps senduart) permanently swaps r2 to 0x0A000000, the teq
comparison fails. The carriage return is never injected, resulting in
stair-stepped early console output.

> +
> +		.macro	waituartcts, rd, rx
> +		.endm
> +
> +		.macro	waituarttxrdy, rd, rx

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260930-b4-cs75xx-v1-0-4617c4463529@gmail.com?part=5

  reply	other threads:[~2026-09-30  7:11 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30  6:59 [PATCH RFC 00/10] ARM: Add support for Cortina Systems CS75xx and Securifi Almond+ Fil Dunsky via B4 Relay
2026-09-30  7:00 ` [PATCH RFC 01/10] dt-bindings: vendor-prefixes: Add Securifi Fil Dunsky via B4 Relay
2026-09-30  7:02   ` sashiko-bot
2026-09-30  9:58   ` Linus Walleij
2026-10-01 18:44   ` Conor Dooley
2026-09-30  7:00 ` [PATCH RFC 02/10] dt-bindings: arm: Add Cortina Systems CS7542 and Securifi Almond+ Fil Dunsky via B4 Relay
2026-09-30  7:06   ` sashiko-bot
2026-09-30  9:59   ` Linus Walleij
2026-10-01 18:45   ` Conor Dooley
2026-09-30  7:00 ` [PATCH RFC 03/10] dt-bindings: arm: cpus: Add Cortina Systems CS7542 enable method Fil Dunsky via B4 Relay
2026-09-30  7:06   ` sashiko-bot
2026-09-30  9:59   ` Linus Walleij
2026-09-30  7:00 ` [PATCH RFC 04/10] ARM: cortina: Add support for the CS75xx SoC family Fil Dunsky via B4 Relay
2026-09-30  7:08   ` sashiko-bot
2026-09-30 10:11   ` Linus Walleij
2026-09-30 10:18     ` Fil Dunsky
2026-09-30 10:20   ` Krzysztof Kozlowski
2026-09-30 10:57     ` Fil Dunsky
2026-09-30 11:01       ` Linus Walleij
2026-09-30 11:36         ` Arnd Bergmann
2026-09-30 11:43           ` Fil Dunsky
2026-09-30 12:02             ` Arnd Bergmann
2026-09-30 12:11               ` Fil Dunsky
2026-09-30 12:55                 ` Arnd Bergmann
2026-09-30 13:05                   ` Fil Dunsky
2026-09-30  7:00 ` [PATCH RFC 05/10] ARM: debug: Add Cortina Systems CS75xx UART0 support Fil Dunsky via B4 Relay
2026-09-30  7:11   ` sashiko-bot [this message]
2026-09-30 10:23   ` Linus Walleij
2026-09-30  7:00 ` [PATCH RFC 06/10] dt-bindings: serial: Add Cortina Systems CS7542 UART Fil Dunsky via B4 Relay
2026-09-30  7:04   ` sashiko-bot
2026-10-01 18:48   ` Conor Dooley
2026-10-01 19:03     ` Fil Dunsky
2026-09-30  7:00 ` [PATCH RFC 07/10] tty: serial: Add Cortina Systems CS75xx UART driver Fil Dunsky via B4 Relay
2026-09-30  7:14   ` sashiko-bot
2026-09-30  7:14   ` Greg Kroah-Hartman
2026-09-30  7:52     ` Fil Dunsky
2026-09-30 10:57   ` Linus Walleij
2026-09-30 11:08     ` Arnd Bergmann
2026-09-30 11:24       ` Fil Dunsky
2026-09-30 12:05         ` Arnd Bergmann
2026-10-01  3:17         ` Jason Li
2026-10-01  3:26           ` Fil Dunsky
2026-10-01  5:14             ` Jason Li
2026-10-01  5:26               ` Fil Dunsky
2026-10-01  6:18                 ` Arnd Bergmann
2026-10-01  6:29                   ` Fil Dunsky
2026-10-01  7:03                     ` Jason Li
2026-10-01  7:14                       ` Fil Dunsky
2026-09-30  7:00 ` [PATCH RFC 08/10] ARM: dts: cortina: Add CS7542 SoC and Securifi Almond+ board Fil Dunsky via B4 Relay
2026-09-30  7:09   ` sashiko-bot
2026-09-30  7:00 ` [PATCH RFC 09/10] ARM: multi_v7_defconfig: Enable Cortina Systems CS75xx support Fil Dunsky via B4 Relay
2026-09-30  7:02   ` sashiko-bot
2026-09-30  7:00 ` [PATCH RFC 10/10] MAINTAINERS: Add entry for Cortina Systems CS75xx Fil Dunsky via B4 Relay
2026-09-30 10:39 ` [PATCH RFC 00/10] ARM: Add support for Cortina Systems CS75xx and Securifi Almond+ Linus Walleij
2026-09-30 10:57   ` Fil Dunsky
2026-09-30 11:06     ` 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=20260930071109.940D41F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=filipp.dunsky@gmail.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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