From: Hugo Villeneuve <hugo@hugovil.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Biju Das <biju.das.jz@bp.renesas.com>,
"biju.das.au" <biju.das.au@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
Thierry Bultel <thierry.bultel.yh@bp.renesas.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"linux-renesas-soc@vger.kernel.org"
<linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH v3 2/3] serial: sh-sci: Drop check for zero baud rate from uart_get_baud_rate()
Date: Wed, 22 Apr 2026 10:05:38 -0400 [thread overview]
Message-ID: <20260422100538.25c6a279ec46defecd8d9a4f@hugovil.com> (raw)
In-Reply-To: <CAMuHMdUfGY6VwW09zQX8T3_JkRHwKGRUyNGRXvQaD4e58OV8qA@mail.gmail.com>
Hi,
On Wed, 22 Apr 2026 10:59:23 +0200
Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> Hi Biju,
>
> On Wed, 22 Apr 2026 at 09:26, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > > From: Geert Uytterhoeven <geert@linux-m68k.org>
> > > On Mon, 20 Apr 2026 at 16:04, Biju <biju.das.au@gmail.com> wrote:
> > > > From: Biju Das <biju.das.jz@bp.renesas.com>
> > > >
> > > > On DT systems, a zero baud rate from uart_get_baud_rate() is not
The fact that uart_get_baud_rate() cannot return zero is not related
to the system using DT or not, so I would drop this "On DT systems, "
from the commit message.
> > > > possible even earlycon derives its bit rate from chosen/stdout-path.
> > > > The zero baud guard and its associated done label are therefore dead code. So remove it.
> > > >
> > > > Also drop the unused done label from rsci_set_termios().
> > > >
> > > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > >
> > > > --- a/drivers/tty/serial/sh-sci.c
> > > > +++ b/drivers/tty/serial/sh-sci.c
> > > > @@ -2719,8 +2719,6 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
> > > > max_freq = max(max_freq, s->clk_rates[i]);
> > > >
> > > > baud = uart_get_baud_rate(port, termios, old, 0, max_freq / min_sr(s));
> > > > - if (!baud)
> > > > - goto done;
> > > >
> > > > /*
> > > > * There can be multiple sources for the sampling clock. Find
> > > > the one
> > >
> > > I am afraid you are missing that sh-sci is also used on SH, without DT?
> >
> > Ok, please share your thoughts to handle divide_by_zero fault for
> > SH platforms on the code path after done label??
>
> Someone has to check on an SH platform (or qemu rts7751r2d) if
> this can happen. It might have been broken along the road, as people
> only use earlyprintk when debugging a problem that requires it.
Geert: this "goto done" is not related to the earlyprintk block, which
is untouched by this patch?
--
Hugo Villeneuve
next prev parent reply other threads:[~2026-04-22 14:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 14:04 [PATCH v3 0/3] serial: sh-sci/rsci: Fix divide-by-zero and clean up baud rate handling Biju
2026-04-20 14:04 ` [PATCH v3 1/3] serial: sh-sci: Avoid divide-by-zero fault Biju
2026-04-20 14:04 ` [PATCH v3 2/3] serial: sh-sci: Drop check for zero baud rate from uart_get_baud_rate() Biju
2026-04-20 15:59 ` Hugo Villeneuve
2026-04-22 7:04 ` Geert Uytterhoeven
2026-04-22 7:26 ` Biju Das
2026-04-22 8:59 ` Geert Uytterhoeven
2026-04-22 14:05 ` Hugo Villeneuve [this message]
2026-04-20 14:04 ` [PATCH v3 3/3] serial: rsci: Refactor baud rate clock selection Biju
2026-04-22 6:26 ` Biju Das
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=20260422100538.25c6a279ec46defecd8d9a4f@hugovil.com \
--to=hugo@hugovil.com \
--cc=biju.das.au@gmail.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=thierry.bultel.yh@bp.renesas.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