Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp107976rwo; Tue, 1 Aug 2023 13:49:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlGZxv9KdmjlaeI764w4XlQKQsZ9Lwf8qYYiCQpw0zjgthGJATUqeBK49R6gyW7aOvZUJGY3 X-Received: by 2002:a17:907:7882:b0:99b:ed44:1a79 with SMTP id ku2-20020a170907788200b0099bed441a79mr3569910ejc.3.1690922969899; Tue, 01 Aug 2023 13:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690922969; cv=none; d=google.com; s=arc-20160816; b=E3xWLZO2qq1VAMhMS3oF3nz/KpftZoVzpoG2c/SnDkIJooewxMFPe3RDHLKhDlRInL +fpyUFaRmH7msHluVijhLswRvkXcNALaOi3F7ksayt2sRsx3E2ZU3WexEkR3b+NEIlFR hgzkFiDQyCVP+26pFjAeya7bolPYlZfkhDlfdhOrRTqc8vj6rJxCjyfcdQwC+fACvqQm kcIF5iEKOVHRpEogJQ8wkO8jingWFPKzrtl7YCG1YQgE+HdBqzatRfHX3A229ORreV6E 87O/6EU1vjp6PgF+UIH1Kudf+vvhj9Ve3gdRiyjifc6iY/uv0RRq8N1iS9EED8mtZY80 t96w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=TpIpeG9VLEAGE6GM72UyJsg5nZtfZSWfUjKuBIQD144=; fh=Uw8khuSBhdiCOeoR5N7vUmVJc/BwBDyDr79eN2u+HJU=; b=llCxQICobTotsWpxyHxDRQ826famGCkKuH02pM2bKnWalpAb7SX/YAvw9JmAN5K5w7 yFFJ9N9z7s7fEiVJt+aGdkLn+FOlorpw5U+X3gyfcdsLyrO/XZYNIErcwspsYPrICGWZ E0cniMC1cniTmLceZKOlANxj7rkvFtKjWvGAKPyHcgNahPH7Iu16tABofjgSRGpjcZJr BbPfBlmWZTwrT/Ws0SWIx9/mPEdFlf1R4y7UPrKgvM6YtPKansEPYE7hp1fd8BsQ03R3 jAIqvsZRPeQMOF7+aAp1Yuj1MIV+G772v5DZMzE4N+LDCJNhS5aoZZuqXePKxJat3eO4 IX4A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id um26-20020a170906cf9a00b0098ddf0dcf02si6000270ejb.157.2023.08.01.13.49.04; Tue, 01 Aug 2023 13:49:29 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232590AbjHATpi (ORCPT + 99 others); Tue, 1 Aug 2023 15:45:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232557AbjHATph (ORCPT ); Tue, 1 Aug 2023 15:45:37 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 758B0B4 for ; Tue, 1 Aug 2023 12:45:36 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qQvIz-0000UE-5A; Tue, 01 Aug 2023 21:45:17 +0200 Received: from mfe by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1qQvIy-0002VK-3Q; Tue, 01 Aug 2023 21:45:16 +0200 Date: Tue, 1 Aug 2023 21:45:16 +0200 From: Marco Felsch To: Ahmad Fatoum Cc: Abel Vesa , Peng Fan , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] clk: imx: composite-8m: avoid glitches when set_rate would be a no-op Message-ID: <20230801194516.h6gxj2lqmmmls62k@pengutronix.de> References: <20230801162731.3278396-1-a.fatoum@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230801162731.3278396-1-a.fatoum@pengutronix.de> User-Agent: NeoMutt/20180716 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: mfe@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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On 23-08-01, Ahmad Fatoum wrote: > Reconfiguring the clock divider to the exact same value is observed > on an i.MX8MN to often cause a short clock pause, probably because > the divider restarts counting from the time the register is written. > > This issue doesn't show up normally, because the clock framework will > take care to not call set_rate when the clock rate is the same. > However, when we configure an upstream clock (e.g. an audio_pll), the > common code will call set_rate with the newly calculated rate on all > children. As the new rate is different, we enter set_rate and compute > the same divider values, write them back and cause the glitch (e.g. > on a SAI's MCLK). > > To avoid the glitch, we skip writing the same value back again. > > Fixes: d3ff9728134e ("clk: imx: Add imx composite clock") > Signed-off-by: Ahmad Fatoum Reviewed-by: Marco Felsch