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=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 44E21C33CAF for ; Thu, 16 Jan 2020 19:14:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28DD2207E0 for ; Thu, 16 Jan 2020 19:14:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387777AbgAPTOr (ORCPT ); Thu, 16 Jan 2020 14:14:47 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:38097 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732483AbgAPQ4S (ORCPT ); Thu, 16 Jan 2020 11:56:18 -0500 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1is8RL-0003ja-2D; Thu, 16 Jan 2020 17:56:15 +0100 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1is8RK-0003vs-9c; Thu, 16 Jan 2020 17:56:14 +0100 Date: Thu, 16 Jan 2020 17:56:14 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Sasha Levin Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Ondrej Jirman , Thierry Reding , linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH AUTOSEL 5.4 053/205] pwm: sun4i: Fix incorrect calculation of duty_cycle/period Message-ID: <20200116165614.a3u5x7g4qxxrm6s4@pengutronix.de> References: <20200116164300.6705-1-sashal@kernel.org> <20200116164300.6705-53-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200116164300.6705-53-sashal@kernel.org> User-Agent: NeoMutt/20170113 (1.7.2) 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-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 16, 2020 at 11:40:28AM -0500, Sasha Levin wrote: > From: Ondrej Jirman > > [ Upstream commit 50cc7e3e4f26e3bf5ed74a8d061195c4d2161b8b ] > > Since 5.4-rc1, pwm_apply_state calls ->get_state after ->apply > if available, and this revealed an issue with integer precision > when calculating duty_cycle and period for the currently set > state in ->get_state callback. > > This issue manifested in broken backlight on several Allwinner > based devices. > > Previously this worked, because ->apply updated the passed state > directly. > > Fixes: deb9c462f4e53 ("pwm: sun4i: Don't update the state for the caller of pwm_apply_state") > Signed-off-by: Ondrej Jirman > Acked-by: Uwe Kleine-König > Signed-off-by: Thierry Reding > Signed-off-by: Sasha Levin Note that while the patch is still correct, the problem isn't that bad any more since commit 01ccf903edd65f6421612321648fa5a7f4b7cb10 was reverted. So .get_state is only called once during boot where the breakage doesn't hurt that much. I let you decide if you still want to apply this patch. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |