public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno  <angelogioacchino.delregno@collabora.com>
To: Chen-Yu Tsai <wenst@chromium.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>
Cc: "Nícolas F . R . A . Prado" <nfraprado@collabora.com>,
	"Alexander Stein" <alexander.stein@ew.tq-group.com>,
	"Marcel Ziswiler" <marcel.ziswiler@toradex.com>,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] clk: core: Honor CLK_OPS_PARENT_ENABLE in clk_core_is_enabled
Date: Tue, 3 Jan 2023 12:53:04 +0100	[thread overview]
Message-ID: <d2a3e440-9755-b603-9c19-a47f68f3c780@collabora.com> (raw)
In-Reply-To: <20230103092330.494102-1-wenst@chromium.org>

Il 03/01/23 10:23, Chen-Yu Tsai ha scritto:
> In the previous commits that added CLK_OPS_PARENT_ENABLE, support for
> this flag was only added to rate change operations (rate setting and
> reparent) and disabling unused subtree. It was not added to the
> clock gate related operations. Any hardware driver that needs it for
> these operations will either see bogus results, or worse, hang.
> 
> This has been seen on MT8192 and MT8195, where the imp_ii2_* clk
> drivers set this, but dumping debugfs clk_summary would cause it
> to hang.
> 
> Prepare parent on prepare and enable parent on enable dependencies are
> already handled automatically by the core as part of its sequencing.
> Whether the case for "enable parent on prepare" should be supported by
> this flag or not is not clear, and thus ignored for now.
> 
> This change solely fixes the handling of clk_core_is_enabled, i.e.
> enabling the parent clock when reading the hardware state. Unfortunately
> clk_core_is_enabled is called in a variety of places, sometimes with
> the enable clock already held. To avoid deadlocking, the core will
> ignore readouts and just return false if CLK_OPS_PARENT_ENABLE is set
> but the parent isn't currently enabled.
> 
> Fixes: fc8726a2c021 ("clk: core: support clocks which requires parents enable (part 2)")
> Fixes: a4b3518d146f ("clk: core: support clocks which requires parents enable (part 1)")
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Moreover, for MT6795 Xperia M5, MT8173 Elm, MT8192 Asurada, MT8195 Tomato:

Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


      reply	other threads:[~2023-01-03 11:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03  9:23 [PATCH v3] clk: core: Honor CLK_OPS_PARENT_ENABLE in clk_core_is_enabled Chen-Yu Tsai
2023-01-03 11:53 ` AngeloGioacchino Del Regno [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2a3e440-9755-b603-9c19-a47f68f3c780@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=marcel.ziswiler@toradex.com \
    --cc=mturquette@baylibre.com \
    --cc=nfraprado@collabora.com \
    --cc=sboyd@kernel.org \
    --cc=wenst@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox