From patchwork Wed Oct 26 13:46:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 11277 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp278412wru; Wed, 26 Oct 2022 06:50:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4bhkTMjwwD106WcrkntPKwV5cJPkhUWwouFxhPqDjQ8sy5x0YhgksHXubN8g0nFn5V80ZW X-Received: by 2002:a17:907:1629:b0:79d:aa05:3783 with SMTP id hb41-20020a170907162900b0079daa053783mr23507349ejc.637.1666792219984; Wed, 26 Oct 2022 06:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666792219; cv=none; d=google.com; s=arc-20160816; b=KOjyUQers0A2yM+TyFAI7Eehe3hHcOATRsxJ6PFvLBEzqkFvfMGBclfpkrzEf1xMCe JMZ+n5SNd6MOGepJ4nKN9F9qDKGOlMy6vqAe+KDBNkD1klNhFi2YAckrrBeJvsScLtc+ oC0ErUMkYJ+JMSptfvGhGv/5Kr+JY6IqDRbDkcEzSj3mDINp7y2QpFxnGE2YHYs0CXiN 31d8y+hifBXW70APSWatTXjZSe2cgGzXz/Ed5dQAl/AxGKr4KwI8ha5QlXLVp+9Zr+0j JP49k3o4OMKTgo39rQT9Hbag6i/uNQh9YxfgDwEYIZj10UjQl2zzgzqfswmaGVAoWdwz 7nLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :feedback-id:dkim-signature:dkim-signature; bh=45bUwAs9zMuezRr68evvNoGp71TZBRQX/Ua2y9yCqM8=; b=pjpjZCT2ThJkJDKWF1LGE0Wchq/XkINAYgA8ls+Gzz5h/rJbWnn5DDsYxujNqsVssc ihQtzOFiR0BgWuAaUd60eVrwxN9FHCHPtYlBY075QzKlsmMPXpNKxhSDTm38SY3j3NV9 AgSobjZiJPU5wBfH5FngY3VLI5guzEsfO4D7ZaXn2OZwL4qhaaEgG33MVx8a+INqMkx1 iVz0sCyOWAZXiXzqTPvOvLdKMS0EDThqCpigam5GFhf7XF+wLRmNlX6X9Ex+q4KsnP2J 4UGJI1ZYdDmoC/NzvARguyKzNH6AqydzBW2IN9KJv5uEwALGh9sCGupjwV409G73G694 i7yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=lGS48gbj; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=TpnLsRpL; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v8-20020a509548000000b00453a0393deasi4976729eda.368.2022.10.26.06.49.52; Wed, 26 Oct 2022 06:50:19 -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=lGS48gbj; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=TpnLsRpL; 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 S229904AbiJZNsV (ORCPT + 99 others); Wed, 26 Oct 2022 09:48:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232679AbiJZNsA (ORCPT ); Wed, 26 Oct 2022 09:48:00 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFBA1106923; Wed, 26 Oct 2022 06:47:31 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 338005C0179; Wed, 26 Oct 2022 09:47:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 26 Oct 2022 09:47:31 -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=1666792051; x= 1666878451; bh=45bUwAs9zMuezRr68evvNoGp71TZBRQX/Ua2y9yCqM8=; b=l GS48gbjeS71a8GPbP4Z1E/Hfl/saR+mMLW+hrCRjws/mmN0r3esjAbdFTZA84Rx9 G/K0tP7bu3ATNA7+CuvMfWEyfEaCgJYahPPqrMVjr2mo/O4tXQNPLC1joTkRkb6K ynz9542UpIuyKzwguEhXNutLfAze4zoYIDC8NXcAoe29suwr5mqBsLgTkXYibFz0 TsFuv2hgNV+WOjN5aLrDW3+8PMSm9XFZanYHE5vLsuP42LGw3Qh5hIs5BJl5G+Lj zKESjVviDiEbGmtwjtPmfPoGOyXL5pijWvFrQ2cY86bTnRtXId+sIJ4XpqjyKxIJ 96c6G8V7p80wxqXZa+XJA== 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=1666792051; x= 1666878451; bh=45bUwAs9zMuezRr68evvNoGp71TZBRQX/Ua2y9yCqM8=; b=T pnLsRpLmLjSJ+ZHlEtuBk0xkfx++5TvLgslxGYCimRgqzxPiiP1M+8jM2G+StccW us5vnwl4TSw/iqFpBddhRu5cfb7U2vk3zTTxDHeRoyg/2rcK+TUsc5XddxNfxPJU Ca1vOSb87y1XodmlsIxyddkGuq/w6QPOaWS5lcLI85rywLonxB/T3Bb6ST6T/lD4 /oMqpWvNcyc7Ymxj6Gl6lUL3MCD4ZvO6WAFcNFj4G+ZIjFdY+yG/zz2DKYzXci4L ksa2Jy/BZ/qNeynuQ1/MM1vHVflWoeO0Bf2KZqHCYJlFXuXr04T78fDVRZKFp4hR 3CojllKVsVUWl1hciZjvg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrtddvgdejtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhfffugggtgffkfhgjvfevofesthekredtredtjeenucfhrhhomhepmhgrgihi mhgvsegtvghrnhhordhtvggthhenucggtffrrghtthgvrhhnpeefudfhgeevhefhfedtue evueeluddutdetuddtvddvgeekheelvefhteekteeihfenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtg hh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Oct 2022 09:47:30 -0400 (EDT) From: maxime@cerno.tech Date: Wed, 26 Oct 2022 15:46:58 +0200 Subject: [PATCH v2 1/2] clk: Store clk_core for clk_rate_request MIME-Version: 1.0 Message-Id: <20221018-clk-rate-request-tracing-v2-1-5170b363c413@cerno.tech> References: <20221018-clk-rate-request-tracing-v2-0-5170b363c413@cerno.tech> In-Reply-To: <20221018-clk-rate-request-tracing-v2-0-5170b363c413@cerno.tech> To: Steven Rostedt , Masami Hiramatsu , Stephen Boyd , Michael Turquette Cc: Maxime Ripard , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1640; i=maxime@cerno.tech; h=from:subject:message-id; bh=Cf1mYycsWJ2/45P+TgQHH1k5LjxSUSEf7IFdDRMwXJU=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDMmRViFeoWuDxHZUm/i8e3miY4ZQ1Xed8wcczrNLlBZIKLiq VOl1lLIwiHExyIopssQImy+JOzXrdScb3zyYOaxMIEMYuDgFYCJrdRj+p679t+GUr+TTWm67IJbgLI a2jq18K3/z/GeYx8hh7JFqwMgw4Qvfq/zSO1dbG3Jjes7PqFAVLVF9IDBXaU3K3YwbadNYAA== X-Developer-Key: i=maxime@cerno.tech; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D 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,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747758318875434151?= X-GMAIL-MSGID: =?utf-8?q?1747758318875434151?= The struct clk_rate_request is meant to store the context around a rate request such as the parent, boundaries, and so on. However, it doesn't store the clock the rate request is submitted to, which makes debugging difficult. Let's add a pointer to the relevant clk_core instance in order to improve the debugging of rate requests in a subsequent patch. Signed-off-by: Maxime Ripard --- drivers/clk/clk.c | 1 + include/linux/clk-provider.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 11c41d987ff4..bc6f964cb676 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -1468,6 +1468,7 @@ static void clk_core_init_rate_req(struct clk_core * const core, if (!core) return; + req->core = core; req->rate = rate; clk_core_get_boundaries(core, &req->min_rate, &req->max_rate); diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 267cd06b54a0..842e72a5348f 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -44,6 +44,7 @@ struct dentry; * * Should be initialized by calling clk_hw_init_rate_request(). * + * @core: Pointer to the struct clk_core affected by this request * @rate: Requested clock rate. This field will be adjusted by * clock drivers according to hardware capabilities. * @min_rate: Minimum rate imposed by clk users. @@ -55,6 +56,7 @@ struct dentry; * */ struct clk_rate_request { + struct clk_core *core; unsigned long rate; unsigned long min_rate; unsigned long max_rate;