From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 417CBC4332B for ; Wed, 20 Jan 2021 17:34:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F3E7233F8 for ; Wed, 20 Jan 2021 17:34:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725956AbhATRdx (ORCPT ); Wed, 20 Jan 2021 12:33:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729022AbhATR0E (ORCPT ); Wed, 20 Jan 2021 12:26:04 -0500 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 B3FECC0613D3 for ; Wed, 20 Jan 2021 09:25:24 -0800 (PST) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2HED-0007E4-9d; Wed, 20 Jan 2021 18:25:09 +0100 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1l2HDt-0003dQ-No; Wed, 20 Jan 2021 18:24:49 +0100 Date: Wed, 20 Jan 2021 18:24:49 +0100 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Baruch Siach Cc: Thierry Reding , Lee Jones , Linus Walleij , Bartosz Golaszewski , Russell King , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Thomas Petazzoni , Chris Packham , Sascha Hauer , Ralph Sennhauser , linux-pwm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v5 4/4] gpio: mvebu: improve handling of pwm zero on/off values Message-ID: <20210120172449.z55oyiktpez76zwe@pengutronix.de> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7i7bkmbdao25rjm4" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 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-gpio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org --7i7bkmbdao25rjm4 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 20, 2021 at 06:16:28PM +0200, Baruch Siach wrote: > Hardware appears to treat zero value as 2^32. Take advantage of this > fact to support on/off values of up to UINT_MAX+1 =3D=3D 2^32. Adjust both > .apply and .get_state to handle zero as a special case. >=20 > Rounded up division result in .get_state can't be zero, since the > dividend is now larger than 0. Remove check for this case. >=20 > Reported-by: Uwe Kleine-K=F6nig > Analyzed-by: Russell King > Signed-off-by: Baruch Siach Reviewed-by: Uwe Kleine-K=F6nig Thanks Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --7i7bkmbdao25rjm4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmAIZ14ACgkQwfwUeK3K 7Am43QgAlhpAMjUS5lyrhrNQdVVIq+zrFhcmzsorsvBCzxThEDvX8zDEagYumWpI eLhnqfrf8Sih4Q8IdvC49DlYMj77DcMlwLYNvCf+KR4LkcBrANp8MsKyGMXdKmRu KaOo5greL3fISrXCddluJBz/AY3lNRSvasQgYBbZlUcWmIT4usiRpuuS7XfRmkFS 23rzl3TZ4XEtyLnr73jJ7xmYgJg9aNRlOUOtIZ8kQ11Y6fl+wQWgCpsodWo/4t/B 3YASAH9hMBhboxD3cGhhG+Gza7XomINaZhKLFUf3PoBGnueGju0suOsF9tT1p2wS s/gxj0bkBsQWrbglhgk2x2RRoZcH5A== =EzHw -----END PGP SIGNATURE----- --7i7bkmbdao25rjm4-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F9A7C433E0 for ; Wed, 20 Jan 2021 17:27:00 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8D54423358 for ; Wed, 20 Jan 2021 17:26:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D54423358 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=g1UFWxQrnzZ++ElYofe0Aux1FaOdLnjYwF913bBp5Wg=; b=z38sxeNM192WuGA5F5RxRKQ+h 4EZdl65ip2rF+66t0SVJeqTD8XJ5n/33VOYh8OfB/Q5UwZJVnlkcHaDdcOgWAsMTfThTID1Q4o0E+ I0eh2sVsO1KisvNKSoIsrFAENpdI2MjNjJ/XyOBMAQLLvztUhxBP/xN5vSSQJToY4jo9eqwAoFMMM fr9xBSiCpK2lGSpRhhgP1NUVwvpsEjZF6EKvmcWlFCVDpmnlBdS50pevQQmxFb+prUbhRmfdRNoS2 ZJX63iYPxHL7lIv6aCnzUR2SJW7pwUIXR5bEehtuWpF8EQezUjCaA45sKV9jqlkvmceVlt6fDtbhy sM60kzNbA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2HEY-0001PX-MZ; Wed, 20 Jan 2021 17:25:30 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2HEV-0001P5-Ew for linux-arm-kernel@lists.infradead.org; Wed, 20 Jan 2021 17:25:28 +0000 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2HED-0007E4-9d; Wed, 20 Jan 2021 18:25:09 +0100 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1l2HDt-0003dQ-No; Wed, 20 Jan 2021 18:24:49 +0100 Date: Wed, 20 Jan 2021 18:24:49 +0100 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Baruch Siach Subject: Re: [PATCH v5 4/4] gpio: mvebu: improve handling of pwm zero on/off values Message-ID: <20210120172449.z55oyiktpez76zwe@pengutronix.de> References: MIME-Version: 1.0 In-Reply-To: X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210120_122527_511842_BAB9A8A2 X-CRM114-Status: GOOD ( 14.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , Sascha Hauer , linux-pwm@vger.kernel.org, Linus Walleij , Chris Packham , Russell King , Bartosz Golaszewski , Thierry Reding , Thomas Petazzoni , linux-gpio@vger.kernel.org, Ralph Sennhauser , Lee Jones , Gregory Clement , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth Content-Type: multipart/mixed; boundary="===============0353811269515188959==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============0353811269515188959== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7i7bkmbdao25rjm4" Content-Disposition: inline --7i7bkmbdao25rjm4 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 20, 2021 at 06:16:28PM +0200, Baruch Siach wrote: > Hardware appears to treat zero value as 2^32. Take advantage of this > fact to support on/off values of up to UINT_MAX+1 =3D=3D 2^32. Adjust both > .apply and .get_state to handle zero as a special case. >=20 > Rounded up division result in .get_state can't be zero, since the > dividend is now larger than 0. Remove check for this case. >=20 > Reported-by: Uwe Kleine-K=F6nig > Analyzed-by: Russell King > Signed-off-by: Baruch Siach Reviewed-by: Uwe Kleine-K=F6nig Thanks Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --7i7bkmbdao25rjm4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmAIZ14ACgkQwfwUeK3K 7Am43QgAlhpAMjUS5lyrhrNQdVVIq+zrFhcmzsorsvBCzxThEDvX8zDEagYumWpI eLhnqfrf8Sih4Q8IdvC49DlYMj77DcMlwLYNvCf+KR4LkcBrANp8MsKyGMXdKmRu KaOo5greL3fISrXCddluJBz/AY3lNRSvasQgYBbZlUcWmIT4usiRpuuS7XfRmkFS 23rzl3TZ4XEtyLnr73jJ7xmYgJg9aNRlOUOtIZ8kQ11Y6fl+wQWgCpsodWo/4t/B 3YASAH9hMBhboxD3cGhhG+Gza7XomINaZhKLFUf3PoBGnueGju0suOsF9tT1p2wS s/gxj0bkBsQWrbglhgk2x2RRoZcH5A== =EzHw -----END PGP SIGNATURE----- --7i7bkmbdao25rjm4-- --===============0353811269515188959== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============0353811269515188959==--