From: Jiri Slaby <jirislaby@kernel.org>
To: Vinicius Pedrosa <vinicius.eduardo.pedrosa@gmail.com>,
linux-serial@vger.kernel.org
Cc: gregkh@linuxfoundation.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, andriy.shevchenko@linux.intel.com,
ilpo.jarvinen@linux.intel.com, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev,
Andre Przywara <andre.przywara@arm.com>,
Chen-Yu Tsai <wens@kernel.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>,
Enzo Adriano <enzo.adriano.code@gmail.com>
Subject: Re: [PATCH v2 2/4] serial: 8250_dw: Only accept a contiguous DLF readback
Date: Tue, 20 Oct 2026 08:11:06 +0200 [thread overview]
Message-ID: <d992e18d-31ab-4937-8780-9c9dc423082a@kernel.org> (raw)
In-Reply-To: <a79114e72d029732db6764935dde12aa5d497706.1792439398.git.vinicius.eduardo.pedrosa@gmail.com>
On 19. 10. 26, 22:06, Vinicius Pedrosa wrote:
> --- a/drivers/tty/serial/8250/8250_dwlib.c
> +++ b/drivers/tty/serial/8250/8250_dwlib.c
> @@ -225,7 +225,11 @@ void dw8250_setup_port(struct uart_port *p)
> reg = dw8250_readl_ext(p, DW_UART_DLF);
> dw8250_writel_ext(p, DW_UART_DLF, old_dlf);
>
> - if (reg) {
> + /*
> + * DLF is a bit field starting at bit 0, so a real one reads back as
> + * 2^n - 1. Any other value means this offset is something else.
> + */
> + if (reg && !(reg & (reg + 1))) {
Do I understand correctly, that this equivalent to:
if (is_power_of_2(reg + 1))
?
thanks,
--
js
suse labs
next prev parent reply other threads:[~2026-10-20 6:11 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 20:06 [PATCH v2 0/4] serial: 8250_dw: Allwinner A733 UART support Vinicius Pedrosa
2026-10-19 20:06 ` [PATCH v2 1/4] serial: 8250_dw: Keep the BUSY-safe divisor hook when DLF is present Vinicius Pedrosa
2026-10-19 20:26 ` sashiko-bot
2026-10-20 8:30 ` Andy Shevchenko
2026-10-20 8:51 ` Andy Shevchenko
2026-10-20 10:47 ` Vinicius Pedrosa
2026-10-21 6:42 ` Andy Shevchenko
2026-10-21 10:00 ` Vinicius Pedrosa
2026-10-21 13:45 ` Andy Shevchenko
2026-10-19 20:06 ` [PATCH v2 2/4] serial: 8250_dw: Only accept a contiguous DLF readback Vinicius Pedrosa
2026-10-19 20:24 ` sashiko-bot
2026-10-20 6:11 ` Jiri Slaby [this message]
2026-10-20 8:31 ` Andy Shevchenko
2026-10-20 11:50 ` Ilpo Järvinen
2026-10-20 12:27 ` Vinicius Pedrosa
2026-10-20 13:02 ` Ilpo Järvinen
2026-10-21 6:43 ` Andy Shevchenko
2026-10-20 10:47 ` Vinicius Pedrosa
2026-10-19 20:06 ` [PATCH v2 3/4] dt-bindings: serial: snps-dw-apb-uart: Add Allwinner A733 Vinicius Pedrosa
2026-10-19 20:24 ` sashiko-bot
2026-10-19 20:06 ` [PATCH v2 4/4] serial: 8250_dw: Add Allwinner A733 UART Vinicius Pedrosa
2026-10-19 20:24 ` sashiko-bot
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=d992e18d-31ab-4937-8780-9c9dc423082a@kernel.org \
--to=jirislaby@kernel.org \
--cc=andre.przywara@arm.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=enzo.adriano.code@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jernej.skrabec@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=robh@kernel.org \
--cc=samuel@sholland.org \
--cc=vinicius.eduardo.pedrosa@gmail.com \
--cc=wens@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.