From: Marek Vasut <marex@denx.de>
To: Peng Fan <peng.fan@nxp.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Cc: Fabio Estevam <festevam@denx.de>, Jacky Bai <ping.bai@nxp.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Lucas Stach <l.stach@pengutronix.de>,
Shawn Guo <shawnguo@kernel.org>,
"S.J. Wang" <shengjiu.wang@nxp.com>,
Stephen Boyd <sboyd@kernel.org>,
"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [PATCH] [RFC] soc: imx: gpcv2: Split clock prepare from clock enable in the domain
Date: Mon, 24 Oct 2022 04:45:27 +0200 [thread overview]
Message-ID: <6b0b08ca-767d-64ec-f3c2-4062a5dbf9db@denx.de> (raw)
In-Reply-To: <DU0PR04MB9417315263B3A912BC37AECF882E9@DU0PR04MB9417.eurprd04.prod.outlook.com>
On 10/24/22 02:39, Peng Fan wrote:
> Hi Marek,
Hi,
>> Subject: [PATCH] [RFC] soc: imx: gpcv2: Split clock prepare from clock enable
>> in the domain
>>
>> It is possible for clk_disable_unused() to trigger lockdep warning regarding
>> lock ordering in this driver. This happens in case of the following conditions:
>>
>> A) clock core clk_disable_unused() triggers the following sequence in a
>> driver which also uses GPCv2 domain:
>> - clk_prepare_lock() -> obtains clock core prepare_lock
>> - pm_runtime_get*() -> obtains &blk_ctrl_genpd_lock_class
>>
>> B) driver powers up a power domain and triggers the following sequence
>> in GPCv2:
>> - pm_runtime_get_sync() -> obtains &blk_ctrl_genpd_lock_class
>> - clk_bulk_prepare_enable() -> obtains clock core prepare_lock
>>
>> This can lead to a deadlock in case A and B runs on separate CPUs.
>>
>> To avoid the deadlock, split clk_*prepare() from clk_*enable() and call the
>> former before pm_runtime_get_sync(). This way, the GPCv2 driver always
>> claims the prepare_lock before blk_ctrl_genpd_lock_class and the deadlock
>> is avoided.
>
> Is this trying to address the i.MX8MP audiomix blk ctrl deadlock issue?
See the email from Laurent from 1 hour earlier, there the splat happens
with DRM subsystem (the whole split is included). Audiomix would likely
trigger it too.
prev parent reply other threads:[~2022-10-24 2:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-23 16:40 [PATCH] [RFC] soc: imx: gpcv2: Split clock prepare from clock enable in the domain Marek Vasut
2022-10-23 23:25 ` Laurent Pinchart
2022-10-24 0:39 ` Peng Fan
2022-10-24 2:45 ` Marek Vasut [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=6b0b08ca-767d-64ec-f3c2-4062a5dbf9db@denx.de \
--to=marex@denx.de \
--cc=festevam@denx.de \
--cc=l.stach@pengutronix.de \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=peng.fan@nxp.com \
--cc=ping.bai@nxp.com \
--cc=sboyd@kernel.org \
--cc=shawnguo@kernel.org \
--cc=shengjiu.wang@nxp.com \
/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