Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3025433rwb; Mon, 15 Aug 2022 16:23:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR4erAKSAaEMye0EArat7vF0x7EKsv+FoogFryQBnzdNGCCotgcUHa03v6NFAKKWJBMVcd7k X-Received: by 2002:a17:906:8b81:b0:733:183b:988e with SMTP id nr1-20020a1709068b8100b00733183b988emr11733936ejc.457.1660605807835; Mon, 15 Aug 2022 16:23:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605807; cv=none; d=google.com; s=arc-20160816; b=SyL6NZHPwCoOhv7WLCoWh3C+tgB8R330nwHpIMx6I5HPpufa+WBxAs4mfeurW0wtTV 6EjU5iXyXJhIIQwSu2AAFJ0lmKCyNHb2+x64H1OTbiSYJePr9AYZvWDwWQ2+0tydgdEh h7eztho2xl3tky0nxVJkvZ6Gvwu5+ztlUfyBhvh6oqWh2nwUgHFH5UfVzPh9CMKSTt4z 8vtACrNX8dO/sADgBqFkoUMZBRzOMdIKGzZTuiyUwhffqnnniT3raLcHx9Nnrt7Msy+y ldZkK6Ts1CUEK3qhOrQOfFly9LunxYneaWmxSStevW4V3QGs9bS/LpJZZvtKfo1uIt8+ F7tA== 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=AHLXYkv8ZhGTnRsAjOEkASo0iogOtuakMcEVO+XLebg=; b=jOzNz6VmfFPHlj0F6vNiqq8PUjR+K2vVtpCCVON+k5Q90ckALzd1tOlfy7aBLsFH3r +CLoJjXIhKVHYjbgyjqHUK7CEZ8n+B003WbN6mZ0sBV0WRcqQ4GhnNqFd48OHT3VANkr sGZTJSHfDO+TKDosMunLp4raS3Kg/YMBCtDlizASgzIqlKUF6QLIoeHN8T49Iwy5plYr Kw4pcYHFUD5YJrjoO3hwl5dQj1igZkjYgD6L5BT5+o7tuJR8Wk1Y8C4jGwKpgJEfXH4p uqLBDYjUr2JXebAy+670k6xNQ0s/WjjO3MYsUIbha+PcA3st5Tq+R2cEyDX+9bz2dFRk n7KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eiHFntFV; 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 sd31-20020a1709076e1f00b0073075197e3bsi9802972ejc.755.2022.08.15.16.23.02; Mon, 15 Aug 2022 16:23:27 -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=eiHFntFV; 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 S1349439AbiHOVsC (ORCPT + 99 others); Mon, 15 Aug 2022 17:48:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349333AbiHOVnO (ORCPT ); Mon, 15 Aug 2022 17:43:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1EE6C57BE; Mon, 15 Aug 2022 12:29:43 -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 0F6C1B810C6; Mon, 15 Aug 2022 19:29:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5750FC433C1; Mon, 15 Aug 2022 19:29:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591780; bh=jOFUmOin2soedTIGfZkBJaD3YTlBujDsu4f/pQUr+Tk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eiHFntFVpbyz75+bJnwn85mFWMkPYz57/oAuh83gIMV5kfaq2Uh30W2+9BcWlQwAm D4i9D6/2B9byTbUDUStGo9BjfGaYapdedPzHIo1r/3wzpIH7XgJdywVDL8/Vyd1zDZ k8eVhF+XIom6eAqDfj/XWYlwv7CVev8qvyVcakYY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Fan , Jacky Bai , Abel Vesa , Sasha Levin Subject: [PATCH 5.18 0680/1095] clk: imx: clk-fracn-gppll: correct rdiv Date: Mon, 15 Aug 2022 20:01:19 +0200 Message-Id: <20220815180457.505796844@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 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: Peng Fan [ Upstream commit f300cb7fccf69ba1835b983c76d70deb818ad194 ] According to Reference Manual: 000b - Divide by 1 001b - Divide by 1 010b - Divide by 2 011b - Divide by 3 100b - Divide by 4 101b - Divide by 5 110b - Divide by 6 111b - Divide by 7 So only need increase rdiv by 1 when the register value is 0. Fixes: 1b26cb8a77a4 ("clk: imx: support fracn gppll") Signed-off-by: Peng Fan Reviewed-by: Jacky Bai Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220609132902.3504651-7-peng.fan@oss.nxp.com Signed-off-by: Abel Vesa Signed-off-by: Sasha Levin --- drivers/clk/imx/clk-fracn-gppll.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-fracn-gppll.c b/drivers/clk/imx/clk-fracn-gppll.c index cb06b0045e9e..025b73229cdd 100644 --- a/drivers/clk/imx/clk-fracn-gppll.c +++ b/drivers/clk/imx/clk-fracn-gppll.c @@ -149,7 +149,8 @@ static unsigned long clk_fracn_gppll_recalc_rate(struct clk_hw *hw, unsigned lon if (rate) return (unsigned long)rate; - rdiv = rdiv + 1; + if (!rdiv) + rdiv = rdiv + 1; switch (odiv) { case 0: -- 2.35.1