public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@sigma-star.at>
To: linux-remoteproc@vger.kernel.org
Cc: andersson@kernel.org, mathieu.poirier@linaro.org,
	p.zabel@pengutronix.de, s-anna@ti.com, t-kristo@ti.com,
	afd@ti.com, linux-kernel@vger.kernel.org,
	upstream+rproc@sigma-star.at
Subject: omap_remoteproc: Deadlock due to runtime PM
Date: Wed, 08 Oct 2025 22:04:57 +0200	[thread overview]
Message-ID: <6460478.iFIW2sfyFC@nailgun> (raw)

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



                 reply	other threads:[~2025-10-08 20:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=6460478.iFIW2sfyFC@nailgun \
    --to=richard@sigma-star.at \
    --cc=afd@ti.com \
    --cc=andersson@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=p.zabel@pengutronix.de \
    --cc=s-anna@ti.com \
    --cc=t-kristo@ti.com \
    --cc=upstream+rproc@sigma-star.at \
    /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