Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1212848rwl; Wed, 29 Mar 2023 14:31:58 -0700 (PDT) X-Google-Smtp-Source: AKy350YTgj03NmGrQbrNB/ISCXEPGLzuZxPnlUx6bbjwnozwUQURkWmve9PkVKa1ZCqfz2a9WRln X-Received: by 2002:a62:65c6:0:b0:625:d630:4e1b with SMTP id z189-20020a6265c6000000b00625d6304e1bmr14869648pfb.31.1680125518098; Wed, 29 Mar 2023 14:31:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680125518; cv=none; d=google.com; s=arc-20160816; b=DWIF7TH53+ySGJXhy6gISe4EZM7bIAXcdyo+K3PaPzOpOUBRQ1ed96pXaR0Zae2Jds vF17HD/OMBNlfcysBt9C2aTxqFgWpr41yvHddtr5oTDGsGXRGCxMs2U++YWSCoFUpqNs 5PH6hlpHjz5doX/eyITNKai3GSp46iPvcGZUEQlDqywD+01UXRV/nAteaDX29YueB+ih LNH4Fc00LZB2uZfCCLlqFQiicq/0pboTfmD/MIfRdy1HeBldm8+Nq2ckp6qBWqc8cTcr 6oRarF3074dqACTKxdKf2A01zQU0fg2wovARlVI+0x5X7ll1Ex4BLeGiDUk8UgpfbOqs Y4/A== 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=IdkrU+u2666uNFOidnpAuqYFHz4iX1uEJWdST7vC1wM=; b=qA+9xqZRPPI54WWHa8Z9mZxoFZdDChkPqGyAlHAXp58ZkIk8Oo9Kwt4wXOavbA3Ssm GhhkQImIv1IkCi6I9Hi3ctGWrJ/o+cZGKt0dwYSZ6HtZlj6jZ3RdKa8It3ycAtD/qcoN cCXnZZz8U/wGRAPDVkgg818g7fclVrgnl8LutR0ZwgwnogXCIRJY1f3q6VkB+ihc93CQ F89YB7GEeXDhMqMioS2tK2mgJwT8JEn/4fknJOjwjPn8Kes1Lkda8XXxdYAJiKmWR6QL idxgOi0yfIHE4FpnRY5R8WoqzRjaek/wG68pF9JgCWi0OYg6Ek+0/78LlpDjM83cqw3J Kkww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HByzCpkd; 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 h184-20020a6383c1000000b0051320e68179si13705984pge.3.2023.03.29.14.31.37; Wed, 29 Mar 2023 14:31:58 -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=HByzCpkd; 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 S229754AbjC2V1N (ORCPT + 99 others); Wed, 29 Mar 2023 17:27:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjC2V1M (ORCPT ); Wed, 29 Mar 2023 17:27:12 -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 BA529FB; Wed, 29 Mar 2023 14:27: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 49EB361E1A; Wed, 29 Mar 2023 21:27:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 959CEC4339B; Wed, 29 Mar 2023 21:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680125230; bh=AS0hMPzODy4Xc1L29bhWgg84MiUUzESVyfIE6SFTowE=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=HByzCpkd+4vCITgt+uRrRp8rFQqgl4QLr74RtztpdlJXSIXL90mhxK5ZUgC+W5QVo GCQcOXgWNihEYMQuQYFdsbWJRMGxIR2/JS2q4fm9I8R8zyoqdAtTyy8OpXLpIJ9UU4 gNsCi4N0mM/KKLyLLo0lVb/TEm9QO3VfPJ1CFmdwIM7HwCLaZAglZ9EU3UBcMePND7 WAiRIddD0YoYDodbhjwH7uPRXmjdss2HkzIjJoFyDhsKrigKxchMltrCgNf69ZEfZX ss+jmE3cwyhkySqpd4uei37AXKtgenN66eZJJ+T5UiUFBisZwcAbZQgjsbSvPhlIMv VEwDhc+n11bnQ== Message-ID: <2f4967f2a079e23b2b8a6013012c66e0.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230329204632.lsiiqf42hrwmn6xm@pengutronix.de> References: <20221026151812.1042052-1-u.kleine-koenig@pengutronix.de> <4d8d412a33a7d63f2ffe6a13194375ed.sboyd@kernel.org> <20230329204632.lsiiqf42hrwmn6xm@pengutronix.de> Subject: Re: [PATCH v4] clk: expand clk_ignore_unused mechanism to keep only a few clks on From: Stephen Boyd Cc: Michael Turquette , linux-kernel@vger.kernel.org, Jonathan Corbet , linux-clk@vger.kernel.org, kernel@pengutronix.de, linux-doc@vger.kernel.org To: Uwe =?utf-8?q?Kleine-K=C3=B6nig?= Date: Wed, 29 Mar 2023 14:27:08 -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 (2023-03-29 13:46:32) > > > 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 > > > [...] > > > @@ -1352,12 +1354,17 @@ static void __init clk_disable_unused_subtree= (struct 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); > >=20 > > 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. >=20 > Well no, that doesn't work for all the problems where > clk_ignore_unused=3D7 could be useful. Consider that e.g. you know that > eth0 is broken, but with clk_ignore_unused is works. So one of the (say) > 25 nominally unused clks are required for eth0. But it's not possible to > test the network after each of the 25 clk_disable()s. Unless I'm missing > something and you can hook a userspace action on a trace line?! In that case it sounds like you want to compile the kernel with the support for enabling clks from debugfs. Can you use that?