From: Ed Blake <ed.blake@sondrel.com>
To: "Nuno Gonçalves" <nunojpg@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
linux-serial@vger.kernel.org
Subject: Re: [PATCH] 8250_dw: do not int overflow when rate can not be aplied
Date: Thu, 11 Jan 2018 18:03:36 +0000 [thread overview]
Message-ID: <4fc98be4-e489-20f0-d899-e5eabdbd5e9d@sondrel.com> (raw)
In-Reply-To: <CAEXMXLRV27_GqbiRfGzc+pWLuytw3CesVuN6WdVAUhWvA6zkUQ@mail.gmail.com>
On 11/01/18 17:55, Nuno Gonçalves wrote:
> So, for me clk_round_rate() always returns 24000000, and only the loop
> variable i changes, so the search is monotonic, from the highest baud
> to the lowest (increasing divider).
>
> I am using a Allwiner H2+, with the serial port configuration from
> sunxi-h3-h5.dtsi.
>
> Are you sure that clk_round_rate can return differet values? Is that
> because some boards might have several clock options beside the
> adjustable divider?
Yes I'm sure. Some platforms allow the clock rate to be varied, hence
the existence of clk_round_rate() and clk_set_rate().
> I really need to understand what is the problem, to be able to suggest
> a solution to the integer overflow that is being allowed to happen.
Some sort of overflow check on i * max_rate could work?
> Thanks,
> Nuno
next prev parent reply other threads:[~2018-01-11 18:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-11 13:38 [PATCH] 8250_dw: do not int overflow when rate can not be aplied Nuno Goncalves
2018-01-11 17:18 ` Ed Blake
2018-01-11 17:28 ` Nuno Gonçalves
2018-01-11 17:48 ` Ed Blake
2018-01-11 17:55 ` Nuno Gonçalves
2018-01-11 18:03 ` Ed Blake [this message]
2018-01-12 13:33 ` Ed Blake
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=4fc98be4-e489-20f0-d899-e5eabdbd5e9d@sondrel.com \
--to=ed.blake@sondrel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=nunojpg@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