[PATCH] [RFC] soc: imx: gpcv2: Split clock prepare from clock enable in the domain

Marek Vasut marex at denx.de
Sun Oct 23 19:45:27 PDT 2022


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.



More information about the linux-arm-kernel mailing list