From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Billy Tsai <billy_tsai@aspeedtech.com>
Cc: "lee.jones@linaro.org" <lee.jones@linaro.org>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"joel@jms.id.au" <joel@jms.id.au>,
"andrew@aj.id.au" <andrew@aj.id.au>,
"thierry.reding@gmail.com" <thierry.reding@gmail.com>,
"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-aspeed@lists.ozlabs.org" <linux-aspeed@lists.ozlabs.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-pwm@vger.kernel.org" <linux-pwm@vger.kernel.org>,
BMC-SW <BMC-SW@aspeedtech.com>
Subject: Re: [v8 2/2] pwm: Add Aspeed ast2600 PWM support
Date: Fri, 9 Jul 2021 07:53:25 +0200 [thread overview]
Message-ID: <20210709055325.4y4ufjvoiwo2pcvi@pengutronix.de> (raw)
In-Reply-To: <FC122EAB-46A9-4B6F-B75C-271B4E17F057@aspeedtech.com>
[-- Attachment #1: Type: text/plain, Size: 824 bytes --]
Hello Billy,
On Fri, Jul 09, 2021 at 05:40:45AM +0000, Billy Tsai wrote:
> On 2021/7/2, 10:32 PM, "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de> wrote:
> > The multiplication can be up to:
>
> > 100000000 * (1 << 31) * (31 + 1) * (255 + 1)
>
> > right? This needs 71 bits and so might overflow a u64.
>
> No, the multiplication can be up to:
>
> Max(div_h) = 15
> Max(div_l) = 255
> Max(clk_period) = 255
> 1000000000 * (1 << 15) * (255 + 1) * (255 + 1) < 2^64 - 1
> it doesn't overflow a u64.
Ah, you're right. Please note this in a comment (not that you were
right, but that it doesn't overflow :-)
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2021-07-09 5:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-08 6:46 [v8 0/2] Support pwm driver for aspeed ast26xx Billy Tsai
2021-06-08 6:46 ` [v8 1/2] dt-bindings: Add bindings for aspeed pwm-tach Billy Tsai
2021-06-08 6:46 ` [v8 2/2] pwm: Add Aspeed ast2600 PWM support Billy Tsai
2021-07-02 14:31 ` Uwe Kleine-König
2021-07-09 5:40 ` Billy Tsai
2021-07-09 5:53 ` Uwe Kleine-König [this message]
2021-07-09 5:59 ` Billy Tsai
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=20210709055325.4y4ufjvoiwo2pcvi@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=BMC-SW@aspeedtech.com \
--cc=andrew@aj.id.au \
--cc=billy_tsai@aspeedtech.com \
--cc=devicetree@vger.kernel.org \
--cc=joel@jms.id.au \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh+dt@kernel.org \
--cc=thierry.reding@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;
as well as URLs for NNTP newsgroup(s).