Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5550543rwi; Tue, 18 Oct 2022 00:12:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6o5kFGBvdm0KAuvx8J+U4WOhsOPxw8SRkOYhhWVLv82vEsLaGxXKfXsrisLKIFNp04g2Br X-Received: by 2002:a05:6402:f94:b0:459:42d7:ea9a with SMTP id eh20-20020a0564020f9400b0045942d7ea9amr1319640edb.392.1666077142609; Tue, 18 Oct 2022 00:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666077142; cv=none; d=google.com; s=arc-20160816; b=J3Anfexl1akL5fHAUYIZa3dvu19JfD9rnXJHjG+buroeI0TSES3Udqeh2S4QMUQTBz Joh/2Z4IPxBX8H7TO3mBr8HG4GJnvidhOMFu93T0t8a8lGyW5menGwF1noudTL0r5zPG g9RDGsiNdpE/dnSN1mH+3loWCM9tQXsogwxu6BsCNyKpBdyldvQG7KeENdiHc/Weh8Cl 4lqmEkmDi32ax5Hd8lt1gNnhOGd6BV0u8LeiJ1fp0d2/9imJR7Xp0S1DYMZ7HYzs3TBv lZudNRh+hknXhwNTzTBTq3SEx8L7mDG2c5sLtxnd6xBFKpCwl77l9vyStsLOw/4TUrhH Qjug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature:dkim-signature; bh=1218Q8hjcADaeitkBJ8qYgkPVJTD+QuHR2ne+rHmWHs=; b=EtQ+fVdou8B/XzZ+yFIdw5zT4cAOtvPer7pXyQLVvSm9EJJ4fGpLp8v41GK/+X+9kU QfrcEUiILUf1/7R3WCyXIBupmG/GyVinvsvQGSNMo40xO+Gyl+TiDGxJHbmCc86E/vrJ XCAeQj1x/BKzwFKvB4wXdDjJ+BNiYdZO6+zO+rK6GQUapn/EQDfSB+M8IMAQrUigbQ8Y 1whgcO0+0ESqDW4Z3MX0JKxHjyI5qbhr0GoBIEe5wvF/jsXfXfPJPT+yU+ptlaTb6enG R5a6/oAkg30zT7+RIBvUvMEHjO+LOalwVb1OBauXZ9L3n8v5JfZTy3/RGbppSS9jBvUx 7heA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=W2e5lclZ; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=PaecRi+T; 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=cerno.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz43-20020a1709077dab00b0079195d87013si3555588ejc.713.2022.10.18.00.11.55; Tue, 18 Oct 2022 00:12:22 -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=@cerno.tech header.s=fm3 header.b=W2e5lclZ; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=PaecRi+T; 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=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230034AbiJRHHK (ORCPT + 99 others); Tue, 18 Oct 2022 03:07:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230077AbiJRHHC (ORCPT ); Tue, 18 Oct 2022 03:07:02 -0400 Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C479D6BD5F; Tue, 18 Oct 2022 00:06:59 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id 514442B067A5; Tue, 18 Oct 2022 03:06:56 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 18 Oct 2022 03:06:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1666076815; x= 1666084015; bh=1218Q8hjcADaeitkBJ8qYgkPVJTD+QuHR2ne+rHmWHs=; b=W 2e5lclZ/owkQ7qi7m8R+1jwwN+I8r2UBxPH5ix26g5O6MlAhPLVD48vnkG+zCG3a jH+goVwE65ty29gUdsdt7S5eGNphIA+iam2XVqp4eQF1QM9jxr4NtQPj5lmh6zKh REEKq49Jn9rgngzTw95OZgCrt3xhEVmOfHFuuSZ6MP1s6QqjUEqUMmGyUAgazghm xyUlLvl/O1zmHHMTRpuFmL0nzUEsFRtg70dUGPrbGuNn92cGW8m4pSvhhZ3GdXNB dOd5ji5FNslDEUOqoMSkLrAODL3Hl1TOUttps+9U8zh4G7mWlWdDonuO6YATVRuI Rp0jQcAT0v3YAQr6JG6FA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1666076815; x= 1666084015; bh=1218Q8hjcADaeitkBJ8qYgkPVJTD+QuHR2ne+rHmWHs=; b=P aecRi+TYeNwR/aJhGVhKZPCjIyoAKZyYrOt0tbqgasVM34/2I9mV6AFjgOrIwRPj S2yaRSIhWZNaRYzPhOzJyFRm1lD+mdU+gHFKnpa9phBzGUmjM2A0J6IlAdoyx7GV b2mM68iYUe1lZceXF6aXO2KPd+JelO6GRYi6AMaGin2QxciCdw7jLi3T4ptVRFQi JoF1KAsvkvoE0pnaI83Xzl9teS3x+tMNHZSNKzroDA4FY/ImCZs3HI6XbrH/Uhyz zrUs0uax1ldsU4urwbCHGLuWrwgAWkzj9vZVcfd6KXi+5i5Vv5U6vohhnxiE4m6K R6b2VGiptoZHGOlknxbGw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeltddguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtugfgjgesthhqredttddtvdenucfhrhhomhepofgr gihimhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtf frrghtthgvrhhnpeehjefffeeggfeiveejvdffgfdvgfehtdfgvdeujedvjefgffdvueet ieevudefvdenucffohhmrghinhepsghoohhtlhhinhdrtghomhenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdr thgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Oct 2022 03:06:54 -0400 (EDT) Date: Tue, 18 Oct 2022 09:06:53 +0200 From: Maxime Ripard To: Stephen Boyd Cc: AngeloGioacchino Del Regno , mturquette@baylibre.com, matthias.bgg@gmail.com, chun-jie.chen@mediatek.com, miles.chen@mediatek.com, wenst@chromium.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] clk: mediatek: clk-mux: Add .determine_rate() callback Message-ID: <20221018070653.gsvnacqe7chvzux2@houat> References: <20221011135548.318323-1-angelogioacchino.delregno@collabora.com> <20221012085555.3nls7ja56vlnaz2w@houat> <20221012094004.jgiyvmbgomiyedik@houat> <6e76f90f-3b6a-330d-6902-b31bf3d33ad4@collabora.com> <20221012114813.6d6adro746w5bd7c@houat> <20221012135619.wxyzuqheolhypoec@houat> <20221014193652.0C745C433D6@smtp.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20221014193652.0C745C433D6@smtp.kernel.org> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS 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 Hi Stephen, On Fri, Oct 14, 2022 at 12:36:50PM -0700, Stephen Boyd wrote: > Quoting Maxime Ripard (2022-10-12 06:56:19) > >=20 > > I think we need to address this in multiple ways: > >=20 > > - If you have ftrace enabled on that platform, running with "tp_printk > > trace_event=3Dclk:*" in the kernel command line on a failing kernel w= ould > > be great, so that we can figure out what is happening exactly. > >=20 > > - We really need to merge your patch above as well; > >=20 > > - And, if we can, we should forbid to register a mux without a > > determine_rate implementation. We have to take into account that some > > muxes are going to be RO and won't need a determine_rate > > implementation at all, but a clock with a set_parent and without a > > determine_rate seems like a weird combination. > >=20 >=20 > So should I apply this patch now on clk-next? Given this regression I'm > leaning towards not sending off the clk rate request this merge window > and letting it bake another cycle. I saw that you sent the PR, thanks We spent some time with Angelo yesterday debugging this, and it's still not clear to me what happens. He provided a significant amount of traces, and we first checked that the round_rate part of set_rate was returning something meaningful, and it does. The rate is fine, the parent is too, everything's great. Next we checked the decisions by clk_calc_new_rates, and it does return the proper top clock, and its proper rate. Finally, we hooked into clk_change_rate() to see what kind of decision it was enforcing, and it seems to be ok as well. It doesn't change parent, and it sets the proper rate, in both cases. There's still one thing we haven't checked: one of the clock in the tree (the parent of the one we want to change the rate on, and it has SET_RATE_PARENT) has a notifier. As we've had a bug recently over this I've not ruled out that this could be a similar bug. I don't really think it is though, since the notifier callback doesn't use the data provided by the framework: https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/clk/mediatek/clk-m= ux.c#L279 I've pushed a branch for Angelo to test, just to confirm. So... yeah. I can't explain the regression at this point. Do you have an idea? The good news is, since you merged this patch the regression is invisible now to that platform. We still could encounter it on another platform, but maybe it will also have a more obvious setup to replicate? Thanks! Maxime