Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp620254pxb; Tue, 5 Apr 2022 16:11:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAWD2j8P3UKJEstBj49Kh5aVC3CfmbiOhtxIQkQr6fWOZ/aT0VWO8+OAxD+3eSr4QflmGc X-Received: by 2002:a05:6a00:b95:b0:4fa:ec15:7eb7 with SMTP id g21-20020a056a000b9500b004faec157eb7mr6088069pfj.74.1649200293336; Tue, 05 Apr 2022 16:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649200293; cv=none; d=google.com; s=arc-20160816; b=B5HO3uURom6s7Fi0qCmTrf/t02tQ3TQcxVoqgCvVjSbIM3fLAnAw9mlwgfFDRSp5Yb UFimTGu/OWR6PIOQPOn3t+AHHDGdnMnogO+dngvD66wgRul5BeODguRyT3Q1JA91kNOQ xSbDRl6oRwk8Ns4Tqs6xfhBresBPzfkWybweIZago56XKYmrc2eUMuATV6jkuQ2mrxoa zAHfs55O6P8NMbuYKbe1fCPo+XVignUUG8W2lcNn8VCVJRiUomSsSqFAlNgnp/s1egUt aPQ45NhDe5Ug64pRLNcLl+ePtcivIfE2htxDYG+IHmJZckKtKrvwskmBTwHY1+wikDwB CxsA== 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=K28dN4HbdrDhgrraZuKkUr0RTni2xacMgixqZhGbHo+H7qTJr6qDgknyBvMo7YOfE8 LYOl+wmcS/6RgRJbrqnDLYqf4UNGkxAJQL3Vr/8BfTRQIMOX5BNvf0XybyIleyHQie0Y o+1XqY9xf6+vJlCgwDpSxVCwJEexa8bNGpMeCuMHKdqs42oEFOfhLNNNCg/OgF77wuuj O0NinXM66Q3BaZ5k33qI6HtJETgMbPNnXFNPE5wbCWCR21T4qSAQDnZNjuPrs2ibN3yW 91hSoipSwJDVsYc5geLZWxJURk3Eux3FeS4S9HM3v8rf4rug5Ke8OAtBECQVJI7r3QQD u0OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cxGp3D6H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id mh12-20020a17090b4acc00b001bd14e0308fsi3999231pjb.103.2022.04.05.16.11.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:11:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cxGp3D6H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 88F95164D27; Tue, 5 Apr 2022 15:55:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387728AbiDEOcv (ORCPT + 99 others); Tue, 5 Apr 2022 10:32:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238903AbiDEJdC (ORCPT ); Tue, 5 Apr 2022 05:33:02 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A013DB; Tue, 5 Apr 2022 02:20:23 -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 ams.source.kernel.org (Postfix) with ESMTPS id 2F041B81B75; Tue, 5 Apr 2022 09:20:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E5E8C385A3; Tue, 5 Apr 2022 09:20:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150420; bh=hiepfgHCUoOr2gSHKgyDZg8utOmO3xMK1AQWFOpqwto=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cxGp3D6HN6wXyYpj8xegz+HJikfjf4v5a4G1h50RgsGke9vykPLgUYa1FKl8PMHaM nRb4dzySLrMOS/6sCsqtICCq3pQsf5uwDpdz0N2oKbjp/JcgysYowlFpPXQyWrT0hd 5da+IYY9ofhCuJPMmrkJN4XftOA5DHDfk+oVnrug= 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.15 050/913] clk: rockchip: re-add rational best approximation algorithm to the fractional divider Date: Tue, 5 Apr 2022 09:18:32 +0200 Message-Id: <20220405070341.320272822@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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); }