Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp341336pxv; Thu, 8 Jul 2021 22:59:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwA47EhUx/lxYqMIIzcy7pUTG9V5TqiP7tGm/0cEeN1W4JLhlnqLh9Zeq3eTz7NpLwBQ4V0 X-Received: by 2002:a17:906:c10a:: with SMTP id do10mr34549221ejc.544.1625810350458; Thu, 08 Jul 2021 22:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625810350; cv=none; d=google.com; s=arc-20160816; b=hH4Xk19L02PaNUj/ZGJVRTp/lTj8GJLOeF2LMbBXTBHVcPD97+C7B4GOLirRsTsi0h hMvyBEo/E04yzba9ksYyEQkHyH5hTwspSsOkE8wISjfaESK5wyXhHr8Y5UREb1jwgjxY eZNpjgKg4OmniwEkVtxHLs0JDnIeqwPfgeQyorn1Tolz26hlOANxj7CML3gPBvae0rx2 dcEOeABnh6Co/zFAsZeF1d3IqFpnB2HH3CqXfb3R/nC+qbf30nPy54F/Vy4gecHElFOX vHtdhy/T9e9r+63ZczUdkfvz6rV4o0r9Mwr3N2edpc4U8WHFVQaWi9XslGs1OOis4trY Qo+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=RO2pXPm0Tg1XkDBcFyyqlBIb3NuSjaJSnAP20364jxI=; b=iz1N4Gusm8TbdPmIwA7riDoJRmUlia1lXRLdKB24aBVM9al2YpnzKMiZ390aCVK1+w gXmINkLc9l9ExVUlbXwrMx02wFBogYO1sQPoeLYLNUwV/4fXFzEZ+sHLqPfLyb9+PXP6 rD50jMmALBTuKsaAxxmmU1jRcoD2Ymtuy2McEBQY/wbTJz85uGU18F5EN95TkFsNGtP+ yM0OVie/SRlSk3NF0HmyD3hRhiNrf+wocb7q4EwLVY9vtbL0Y+wth8u0agwTq14Kpsdy ZEw51QlQkHpzRGffjAi0DvNd0mEF5y0ZVeTt7y8bplWoc6kDmBeZiRwntyMItS8QSv+6 6EcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q18si6688051edi.63.2021.07.08.22.58.21; Thu, 08 Jul 2021 22:59:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229908AbhGIF4g (ORCPT + 99 others); Fri, 9 Jul 2021 01:56:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229618AbhGIF4g (ORCPT ); Fri, 9 Jul 2021 01:56:36 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D0ABC061574 for ; Thu, 8 Jul 2021 22:53:53 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1jSI-0007lA-QR; Fri, 09 Jul 2021 07:53:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1m1jSE-0003cR-5b; Fri, 09 Jul 2021 07:53:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1m1jSE-0000zp-38; Fri, 09 Jul 2021 07:53:38 +0200 Date: Fri, 9 Jul 2021 07:53:25 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Billy Tsai Cc: "lee.jones@linaro.org" , "robh+dt@kernel.org" , "joel@jms.id.au" , "andrew@aj.id.au" , "thierry.reding@gmail.com" , "p.zabel@pengutronix.de" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-aspeed@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" , "linux-pwm@vger.kernel.org" , BMC-SW Subject: Re: [v8 2/2] pwm: Add Aspeed ast2600 PWM support Message-ID: <20210709055325.4y4ufjvoiwo2pcvi@pengutronix.de> References: <20210608064658.14262-1-billy_tsai@aspeedtech.com> <20210608064658.14262-3-billy_tsai@aspeedtech.com> <20210702143147.6a7psfup4tlidq2x@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qqbiwvrhqx7yu7h3" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --qqbiwvrhqx7yu7h3 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=F6nig" wrote: > > The multiplication can be up to: >=20 > > 100000000 * (1 << 31) * (31 + 1) * (255 + 1) >=20 > > right? This needs 71 bits and so might overflow a u64. >=20 > No, the multiplication can be up to: >=20 > Max(div_h) =3D 15 > Max(div_l) =3D 255 > Max(clk_period) =3D 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 --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --qqbiwvrhqx7yu7h3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmDn5FAACgkQwfwUeK3K 7AkCLgf/Wqw5mfuphqGF4+uRZjb+BVpbgi6TY8lgmZQS9hR+16ML35aNawrAo0J/ c/2e0I8SQtbevb552QGX2eSStU0i/jPIWBpXRzYBxYNy4+tYOdpL59GEA5qZJeH7 R83lXsYsQEOGoSufHH3MsHWZfPXNms1rxZAmQ1Zlp6AqRVwVNE+cLdC3ByC9qxxl Um2TbbOwVHvQfhXgfGLwlC1rmBeDU0I0rrdWNBnw3ifWKCCHuwytg/mJ0c/MXKzo 44gxD+YqV0J1gy9vKLtNWEOFY8RBXV5UjPQLgH2bk5vD9xLOATF11c5wc2e58s6P aCwg6rvWFB+hrS+UP6aXQlO4CKM5uQ== =i2jo -----END PGP SIGNATURE----- --qqbiwvrhqx7yu7h3--