Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp651585pxb; Tue, 5 Apr 2022 17:21:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIhzk9qmA4ZR2V44dDzTg+ryGOqh3Ep8xXRqSGQABxtzBdd9Z92xBm7oSYpmGDYHSa4Gml X-Received: by 2002:aa7:d682:0:b0:419:3b78:e489 with SMTP id d2-20020aa7d682000000b004193b78e489mr6180220edr.372.1649204503290; Tue, 05 Apr 2022 17:21:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649204503; cv=none; d=google.com; s=arc-20160816; b=QYBytgkX+m/uzyVchzvHD9VYpzpAPtBNlSd/MJ44jaDYAXERk81jXF/LUTndGBQSVu vP34uAuRZr0KwqGbVMoQApk6lKy9KNczlJi+8kv2O8LpnoF3E21gImJRZdRo7CAHXUX4 m8IMq9RC9s5/6dRTu5BxN8WBRI/6/5HXIOvx3kk/YkB0g5HEDE3NkCJw8fqSedF274ql TYQLZzKzSN7iKW458BafMjKZP7M8xeovZp/GZzG0XPStg1sbJaUkWx4HUCMl6sg0nCqa B07QVNh+Ne5wQqzAEv75t+8bS/5/W+oiRB5dXzorrFIHeGCM84oNWJf0ZG/YM12TbKwH kfNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3j6wMZo0AlyOC3uCM1pAiyhYzv5yLD7ytPJ2D+N3hBg=; b=MyweciFmJprHs0CIzzKsr5wJuNt13YfIOu/zohnsYM7RqWN5p2A9eaYcqrMfGx+n8/ woVOu8UaECf1VXuoX6/lKBy/zVzn+3xwLfVvjGwQatf+1S8bMn4f5K//63qKgOBF3yHY kq7uNgxfQ+S2izaNy/BNOdJwNqwQiCk9lQtPorEJpAxh/6CBFUPXZNKf7dx2dSoRILeK 9T7wfGOLNdYEYX/L0gudRDZL6LKMdh/mkPnPHUCMPMULsoHjILgEkkA7JPZ8Un7ri094 /3i3iWD8/cBkbgIuvr+YP4sPe4iD9Ai1+mqiiSJ755AhEnroksCdlau13R2aCvtWzIso 8rSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="bX/02dTy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt2-20020a170906f20200b006df76385c1esi10062823ejb.190.2022.04.05.17.21.11; Tue, 05 Apr 2022 17:21:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="bX/02dTy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346894AbiDELBq (ORCPT + 99 others); Tue, 5 Apr 2022 07:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234755AbiDEIjT (ORCPT ); Tue, 5 Apr 2022 04:39:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87718C4; Tue, 5 Apr 2022 01:33:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2476B60FFC; Tue, 5 Apr 2022 08:33:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37A33C385A0; Tue, 5 Apr 2022 08:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649147594; bh=hiepfgHCUoOr2gSHKgyDZg8utOmO3xMK1AQWFOpqwto=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bX/02dTyAmdRkG+uHFOX6x145Gq/FQrEXIpFiFOT3oVJuBsMHl4NPfhcD+fU4GTAJ a332jMOVkPGeNKjfqNG7RU8dI+Q0tH+c5/RgiAwIzSFV5eD9F3saB8/fMYgITsCE3U +tpGDj5PtyGUt3tYM/8zP4bSz5w22tQjiRGKF0UI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Quentin Schulz , Quentin Schulz , Heiko Stuebner Subject: [PATCH 5.16 0052/1017] clk: rockchip: re-add rational best approximation algorithm to the fractional divider Date: Tue, 5 Apr 2022 09:16:05 +0200 Message-Id: <20220405070355.729518506@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Quentin Schulz commit 10b74af310735860510a533433b1d3ab2e05a138 upstream. In commit 4e7cf74fa3b2 ("clk: fractional-divider: Export approximation algorithm to the CCF users"), the code handling the rational best approximation algorithm was replaced by a call to the core clk_fractional_divider_general_approximation function which did the same thing back then. However, in commit 82f53f9ee577 ("clk: fractional-divider: Introduce POWER_OF_TWO_PS flag"), this common code was made conditional on CLK_FRAC_DIVIDER_POWER_OF_TWO_PS flag which was not added back to the rockchip clock driver. This broke the ltk050h3146w-a2 MIPI DSI display present on a PX30-based downstream board. Let's add the flag to the fractional divider flags so that the original and intended behavior is brought back to the rockchip clock drivers. Fixes: 82f53f9ee577 ("clk: fractional-divider: Introduce POWER_OF_TWO_PS flag") Cc: stable@vger.kernel.org Cc: Quentin Schulz Signed-off-by: Quentin Schulz Link: https://lore.kernel.org/r/20220131163224.708002-1-quentin.schulz@theobroma-systems.com Signed-off-by: Heiko Stuebner Signed-off-by: Greg Kroah-Hartman --- drivers/clk/rockchip/clk.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/clk/rockchip/clk.c +++ b/drivers/clk/rockchip/clk.c @@ -180,6 +180,7 @@ static void rockchip_fractional_approxim unsigned long rate, unsigned long *parent_rate, unsigned long *m, unsigned long *n) { + struct clk_fractional_divider *fd = to_clk_fd(hw); unsigned long p_rate, p_parent_rate; struct clk_hw *p_parent; @@ -190,6 +191,8 @@ static void rockchip_fractional_approxim *parent_rate = p_parent_rate; } + fd->flags |= CLK_FRAC_DIVIDER_POWER_OF_TWO_PS; + clk_fractional_divider_general_approximation(hw, rate, parent_rate, m, n); }