Re: [PATCH] media: microchip-isc: don't sleep in the clk .is_enabled callback
From: Eugen Hristev
Date: Thu Aug 27 2026 - 01:58:06 EST
On 8/19/26 09:19, Balakrishnan Sambath wrote:
> isc_clk_is_enabled() calls pm_runtime_resume_and_get() and
> pm_runtime_put_sync(), which can sleep and are not safe here, as
> .is_enabled must run in atomic context. clk_disable_unused() calls it so
> at boot, and CONFIG_DEBUG_ATOMIC_SLEEP reports a "sleeping function
> called from invalid context" BUG.
>
> Use the atomic-safe pm_runtime_get_if_active() and pm_runtime_put()
> instead. A suspended ISC has its clocks gated, so report the clock
> disabled when the device is not already active.
>
> Fixes: 01192aa1c5c2 ("media: atmel-isc: Enable the clocks during probe")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Balakrishnan Sambath <balakrishnan.s@xxxxxxxxxxxxx>
> ---
Reviewed-by: Eugen Hristev <ehristev@xxxxxxxxxx>