public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* omap_remoteproc: Deadlock due to runtime PM
@ 2025-10-08 20:04 Richard Weinberger
  0 siblings, 0 replies; only message in thread
From: Richard Weinberger @ 2025-10-08 20:04 UTC (permalink / raw)
  To: linux-remoteproc
  Cc: andersson, mathieu.poirier, p.zabel, s-anna, t-kristo, afd,
	linux-kernel, upstream+rproc

Hi!

I'm seeing a reproducible deadlock in omap_remoteproc during system
reboot or shutdown while the remote processor is running.

The deadlock occurs as follows:
rproc_cdev_release() -> rproc_shutdown() -> mutex_lock_interruptible(&rproc->lock)
-> rproc_stop() -> omap_rproc_stop() -> pm_runtime_get_sync()

pm_runtime_get_sync() triggers omap_rproc_runtime_resume(),
which attempts to take rproc->lock again, leading to a deadlock.

In other words, rproc->lock is being used within the omap_remoteproc
runtime PM ops, which can conflict with other call paths that already
hold the same lock.

It was introduced with the following change:

commit 5f31b232c67434199558fd236e7644b432636b76
Author: Suman Anna <s-anna@ti.com>
Date:   Tue Mar 24 13:00:32 2020 +0200

    remoteproc/omap: Add support for runtime auto-suspend/resume

It seems the lock is taken in the PM ops likely because rproc->state 
is accessed, but perhaps this can be relaxed or refactored to avoid
the circular dependency.

Has anyone else encountered this issue,
or is there a known fix or approach to address it?

Thanks,
//richard



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-10-08 20:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-08 20:04 omap_remoteproc: Deadlock due to runtime PM Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox