From: sashiko-bot@kernel.org
To: "Vinicius Pedrosa" <vinicius.eduardo.pedrosa@gmail.com>
Cc: linux-sunxi@lists.linux.dev, devicetree@vger.kernel.org,
conor+dt@kernel.org, linux-serial@vger.kernel.org,
robh@kernel.org
Subject: Re: [PATCH 2/3] dt-bindings: serial: snps-dw-apb-uart: Add Allwinner A733
Date: Mon, 05 Oct 2026 17:34:17 +0000 [thread overview]
Message-ID: <20261005173417.870D51F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261005172538.398522-3-vinicius.eduardo.pedrosa@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] dt-bindings: Invalid snps,dw-apb-uart fallback for Allwinner A733
--
commit 51cd638ddbc823709bc6b8874d8c1f36411d5573
Author: Vinicius Pedrosa <vinicius.eduardo.pedrosa@gmail.com>
dt-bindings: serial: snps-dw-apb-uart: Add Allwinner A733
This commit adds the Allwinner A733 UART compatible string to the DesignWare
APB UART bindings, specifying "snps,dw-apb-uart" as a fallback. It mentions
that the baud clock cannot change rate and offset 0xc0 is an RS485 control
register rather than a DLF register.
> diff --git a/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml b/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml
> index 86dc259193112..aa8cab5ba3d33 100644
> --- a/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml
> +++ b/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml
> @@ -51,6 +51,7 @@ properties:
> - const: renesas,rzn1-uart
> - items:
> - enum:
> + - allwinner,sun60i-a733-uart
[Severity: High]
Is it safe to use "snps,dw-apb-uart" as a fallback for the A733?
When an OS binds to the generic "snps,dw-apb-uart" fallback, the 8250_dwlib
driver auto-probes offset 0xc0 (DW_UART_DLF) to detect DLF support:
drivers/tty/serial/8250/8250_dwlib.c:dw8250_setup_port() {
...
old_dlf = dw8250_readl_ext(p, DW_UART_DLF);
dw8250_writel_ext(p, DW_UART_DLF, ~0U);
...
}
Because 0xc0 is an active R/W RS485 register on the A733, the auto-probe will
falsely succeed. The generic driver will then set p->set_divisor =
dw8250_set_divisor, which blindly overwrites the RS485 bits with fractional
divisor calculations on every baud rate change.
Can this corrupt the RS485 configuration and potentially trigger unintended
hardware states (such as bus collisions) on the RS485 line?
Furthermore, the generic fallback lacks the DW_UART_QUIRK_SKIP_SET_RATE
quirk, so it will erroneously attempt to call clk_set_rate() on the bus clock
gate during baud rate changes:
drivers/tty/serial/8250/8250_dw.c:dw8250_set_termios() {
...
ret = clk_set_rate(d->clk, newrate);
...
}
Given that the generic fallback driver actively misbehaves on this hardware,
should the compatible definition omit the fallback string so that unmodified
kernels do not attempt to drive the A733 incorrectly?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261005172538.398522-1-vinicius.eduardo.pedrosa@gmail.com?part=2
next prev parent reply other threads:[~2026-10-05 17:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 17:25 [PATCH 0/3] serial: 8250_dw: Allwinner A733 UART support Vinicius Pedrosa
2026-10-05 17:25 ` [PATCH 1/3] serial: 8250_dw: Keep the BUSY-safe divisor hook when DLF is present Vinicius Pedrosa
2026-10-05 17:34 ` sashiko-bot
2026-10-06 10:19 ` Ilpo Järvinen
2026-10-06 11:32 ` Vinicius Pedrosa
2026-10-05 17:25 ` [PATCH 2/3] dt-bindings: serial: snps-dw-apb-uart: Add Allwinner A733 Vinicius Pedrosa
2026-10-05 17:34 ` sashiko-bot [this message]
2026-10-07 10:36 ` Conor Dooley
2026-10-05 17:25 ` [PATCH 3/3] serial: 8250_dw: Add Allwinner A733 UART Vinicius Pedrosa
2026-10-05 17:32 ` sashiko-bot
2026-10-06 9:46 ` Andre Przywara
2026-10-06 11:33 ` Vinicius Pedrosa
2026-10-06 12:16 ` Andre Przywara
2026-10-06 19:30 ` Vinicius Pedrosa
2026-10-07 9:33 ` Vinicius Pedrosa
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=20261005173417.870D51F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vinicius.eduardo.pedrosa@gmail.com \
/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