Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp694262pxb; Tue, 5 Apr 2022 19:04:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzFAUh3FpFYSvFJW+ZsgBNrtcsT5WS20AZ7LAMMO+EPITV4E0c0+LPDEN60N5yWalFDNvI X-Received: by 2002:a63:5520:0:b0:399:8cd:5f62 with SMTP id j32-20020a635520000000b0039908cd5f62mr5178920pgb.12.1649210591193; Tue, 05 Apr 2022 19:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649210591; cv=none; d=google.com; s=arc-20160816; b=LaDc/Aoo7Nq9wFq1w1KOAnI00zoF8o4NhCs2zyPhVtmvofo99xxtk2k1hVn1Eph8ea hMAGuYKfc6wIvEmqU1BuVZgakW1TCbGa3TCHEpR7wzSnWiymiQ/3r4TibhuNzlmgJGM+ bg1K6sbPL+J7msWtT3SzrH0VGW7do4L1D7SBFdxTqRmN+Am85r9ia32NNJM1UP9OkpXp UyY9YJ6eyISrcalk5oGxLEejxqDkdFHnjtO2MP5EOm4KxJ0KiMFEejPpRwn1IHjRoD1Z krPt/YLO4n9xVjAFv1RLKHDBdOtTn/xGBWbgyRIHjaONIx9/5nI0/1kym/cCG55YB8tL 8prA== 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=tOXFsD0Ilh44FS711jd+vVVqa4LlcIqkxlwtCRmjd3LWiuXpR9sjDkaU/jA6M266qo 8QbatI+E+phLPTa4wbEi9lmLIKyQve7M8sAISBQ5z63b6dp29jfRoh8+XYUvkDV561Bl OmD4zIuLXxbJSNjh832J6xekB+A03kVCU/1w9Dj1o5mK8StiBzYX+AcBhqFyiLH62rR3 uBpAAchiQx0kAdUvrY+Ak8shH+MmdXCT4+1Ur7RsPCLBXpGJ5KKOFhm3eqYX+BWrZ4oJ 7Y8P4cyhJVZd3SDVel1FuCO4AwNurm1MqKgx27rPQJlk9PFRuETR4nkjTThyppqZDheV J6qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GkJr9qC2; 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 d23-20020a63ed17000000b003816043ee66si14499657pgi.91.2022.04.05.19.02.53; Tue, 05 Apr 2022 19:03:11 -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=GkJr9qC2; 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 S231620AbiDEHpc (ORCPT + 99 others); Tue, 5 Apr 2022 03:45:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231950AbiDEHnd (ORCPT ); Tue, 5 Apr 2022 03:43:33 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EB83939A9; Tue, 5 Apr 2022 00:40:29 -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 sin.source.kernel.org (Postfix) with ESMTPS id 8EE48CE1BDB; Tue, 5 Apr 2022 07:40:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A548CC340EE; Tue, 5 Apr 2022 07:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649144426; bh=hiepfgHCUoOr2gSHKgyDZg8utOmO3xMK1AQWFOpqwto=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GkJr9qC2KCZP+nlnqKrC9pedg74fEqzMJoWoIjYhtYx6ezqePD4DklPcHENSQr+3h IEUVDU7DDq3gFlKwZwaDNchdZAd0615j7tccuVr3XOUBBYbM8Yh0VwOw9y7b2SJ1UX 1THFIiwBFTWbPnzUg6PZ/5tCK9+WKC6+agTFJCxI= 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.17 0040/1126] clk: rockchip: re-add rational best approximation algorithm to the fractional divider Date: Tue, 5 Apr 2022 09:13:07 +0200 Message-Id: <20220405070408.735525184@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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); }