Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1111255rwl; Wed, 29 Mar 2023 12:53:33 -0700 (PDT) X-Google-Smtp-Source: AK7set8FGbw4Q8roVAEv48Cyu4bmTt7YvVOQtuKTomTQJ2wfuEwSqcgBqFvMNVLO1qxhfGxuNXx3 X-Received: by 2002:a05:6a20:c426:b0:d5:e640:15ec with SMTP id en38-20020a056a20c42600b000d5e64015ecmr17815760pzb.29.1680119612776; Wed, 29 Mar 2023 12:53:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680119612; cv=none; d=google.com; s=arc-20160816; b=IuJWelx4SUTAb0k2omYtYpeBeW5KYS2ArogXufOgmnynrMeYR7V85Oc+kAebVWC5Oh hkB/AAWWmc6+bP9tqKOsThJJh67nC37hBjSyL5nSd1sjP5Qs+EoZR0stWGB+pDZTc2Qq D3uaHLd/icJ06Vj//y6kTjgxKDCh+4VlvVswrG97mFJLexAFhJ8Rnw9yTJET/JMMoBpb Y+rSN0Y618y1BBXMeBTQZ2I1JmD9egY2lthKFaow4FyZ5+0QaYeZP0c3GaYprXhzAy13 mHXACsBH2HfVJB6wZsuMD46PRw+b6jt1rP8nQ8mbiRs1Qv7ebqAMn8AKYmcbt4XaezK6 5jng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:date:to:cc:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:message-id :dkim-signature; bh=5ypnxOUX7CrP0hebScVkpoHC5uPiYzY5k5WS/u7hFDc=; b=IJ33FG2QL6pj9HJ8SJfdNYnLktViA6ha5GUgDYELPtXlWwSiocKHCkHMBGUggFttp8 WQG7A1gpWeK8wn8dqpq6aRIwVu0OuoQnLAC2JiZLBhdiybHCU6xY9c8X+Kp+O5dA4grY Bx/04Z2nBY/sgc5hL6HnPzkoC3Ij4dz80uEvVbEIMXwWplkDpe5+eI+TtLssTjA8CVDn 7Kx02Kyc8ZPo7hGDs/9rFo7sswT61zLKFiJnl62MG6M/nPb3rrgvPlgPuqBqIn7/Bq7g t47FJrzeyeN3bDLducR6fGYoQiCKwDCylFjjaOBeiaWH+nK6uUy2TViiwoMyBb2O21MU 6pwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WJ3prnXq; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v186-20020a6389c3000000b00513234112b0si13547394pgd.892.2023.03.29.12.53.21; Wed, 29 Mar 2023 12:53:32 -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=@kernel.org header.s=k20201202 header.b=WJ3prnXq; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230094AbjC2Tul (ORCPT + 99 others); Wed, 29 Mar 2023 15:50:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230405AbjC2Tug (ORCPT ); Wed, 29 Mar 2023 15:50:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E4451711; Wed, 29 Mar 2023 12:50:11 -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 dfw.source.kernel.org (Postfix) with ESMTPS id D268861E08; Wed, 29 Mar 2023 19:49:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 380C0C433EF; Wed, 29 Mar 2023 19:49:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680119362; bh=hYn4WbhBF9Rj4s8CX4YfCGFQYwTZemqDMnlxN7alqCc=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=WJ3prnXqzFYvW40J07pruGFfkj8X9rYOqEUiY8/61uNsL6rMvq4o2LdMWm4L4xqeW GReYTckx/hBtRUrvRXfJUlBgYqMA1K6xlKcTWCY8rf2LQyGbO+vSLXJkSDuocjOPgC //YxNGMhicHErPa//m4uaeOWa9PXglK/L9V9jfbGliu0AvsYDjugzfhf/lSII7JLJV 2M4aPmID2JVtO7+21lGlXoh8NtvAoLA1bsmmxi3uKF3OG69E4qglHkrOOjo/kx6E4f 9Tetmg8wxpA91ZfDVmLof+rYIj9o54jBxWJFEloLF7cGljWfPqyDzg+lqmwPwYXMw0 c8QVI1cHIlSZQ== Message-ID: <4d8d412a33a7d63f2ffe6a13194375ed.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20221026151812.1042052-1-u.kleine-koenig@pengutronix.de> References: <20221026151812.1042052-1-u.kleine-koenig@pengutronix.de> Subject: Re: [PATCH v3] clk: expand clk_ignore_unused mechanism to keep only a few clks on From: Stephen Boyd Cc: linux-doc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Jonathan Corbet To: Michael Turquette , Uwe =?utf-8?q?Kleine-K=C3=B6nig?= Date: Wed, 29 Mar 2023 12:49:19 -0700 User-Agent: alot/0.10 X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 Quoting Uwe Kleine-K=C3=B6nig (2022-10-26 08:18:12) > Allow to pass an integer n that results in only keeping n unused clocks > enabled. >=20 > This helps to debug the problem if you only know that clk_ignore_unused > helps but you have no clue yet which clock is the culprit. >=20 > Signed-off-by: Uwe Kleine-K=C3=B6nig > --- > Hello, >=20 > compared to v2 sent in August 2021 this is a trivial rebase on top of > v6.1-rc1. I pinged that one repeatedly, I'm now trying with resending > and calling the rebased patch v3 to maybe get some feedback. :-\ >=20 > Best regards > Uwe >=20 > Documentation/driver-api/clk.rst | 4 +++- No update to Documentation/admin-guide/kernel-parameters.txt? > drivers/clk/clk.c | 33 ++++++++++++++++++++++++-------- > 2 files changed, 28 insertions(+), 9 deletions(-) >=20 > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c > index c3c3f8c07258..356119a7e5fe 100644 > --- a/drivers/clk/clk.c > +++ b/drivers/clk/clk.c > @@ -1322,6 +1322,8 @@ static void __init clk_unprepare_unused_subtree(str= uct clk_core *core) > clk_pm_runtime_put(core); > } > =20 > +static unsigned clk_unused_keep_on __initdata; > + > static void __init clk_disable_unused_subtree(struct clk_core *core) > { > struct clk_core *child; > @@ -1352,12 +1354,17 @@ static void __init clk_disable_unused_subtree(str= uct clk_core *core) > * back to .disable > */ > if (clk_core_is_enabled(core)) { > - trace_clk_disable(core); > - if (core->ops->disable_unused) > - core->ops->disable_unused(core->hw); > - else if (core->ops->disable) > - core->ops->disable(core->hw); > - trace_clk_disable_complete(core); > + if (clk_unused_keep_on) { > + pr_warn("Keep unused clk \"%s\" on\n", core->name= ); > + clk_unused_keep_on -=3D 1; > + } else { > + trace_clk_disable(core); We have trace_clk_disable() here. Can you have this tracepoint print to the kernel log and watch over serial console? That would be faster than bisecting. > + if (core->ops->disable_unused) > + core->ops->disable_unused(core->hw); > + else if (core->ops->disable) > + core->ops->disable(core->hw); > + trace_clk_disable_complete(core); > + } > } > =20 > unlock_out: > @@ -1369,9 +1376,17 @@ static void __init clk_disable_unused_subtree(stru= ct clk_core *core) > } > =20 > static bool clk_ignore_unused __initdata; > -static int __init clk_ignore_unused_setup(char *__unused) > +static int __init clk_ignore_unused_setup(char *keep) > { > - clk_ignore_unused =3D true; > + if (*keep =3D=3D '=3D') { > + int ret; > + > + ret =3D kstrtouint(keep + 1, 0, &clk_unused_keep_on); > + if (ret < 0) Could omit 'ret' and just have if (kstrtouint(..)) > + pr_err("Warning: failed to parse clk_ignore_unuse= d parameter, ignoring"); Missing newline on printk. > + } else { > + clk_ignore_unused =3D true; > + } > return 1; > } > __setup("clk_ignore_unused", clk_ignore_unused_setup);