Repository navigation
Fixes for crash seen in fastrpc testcases. - #1612
Merged
Salendarsingh Gaud (sgaud-quic) merged 2 commits intoDec 2, 2026
Merged
Salendarsingh Gaud (sgaud-quic) merged 2 commits into
Salendarsingh Gaud (sgaud-quic) merged 2 commits into
Conversation
fastrpc_context_schedule_put_work() guards the once-only schedule_work() with fl->lock. That helper is called from fastrpc_rpmsg_callback(), which runs in hard-IRQ context on the glink rx interrupt, while every other user of fl->lock takes it with a plain spin_lock() in process context with interrupts enabled. If the glink interrupt fires on a CPU that is already holding fl->lock, for example fastrpc_context_put_wq() -> fastrpc_context_free() or fastrpc_free_map() running in a kworker on that CPU, the handler spins on the lock the interrupted code holds. The holder can never run again, so the CPU hangs with interrupts masked, an RCU stall is reported for it, and the system is eventually reset by the watchdog. It is easy to hit because schedule_work() queues onto the local CPU's worker pool, so the worker that takes fl->lock tends to run on the very CPU that receives the glink interrupt. The same helper is also called by fastrpc_notify_users() while it holds user->lock, and ctx->fl == user, so a context left on fl->pending or fl->interrupted when the channel is removed deadlocks on the same lock there too. The flag is only used to make sure put_work is queued once, so no lock is needed. Turn it into an atomic_t and claim it with atomic_xchg(). Whichever caller sees the old value 0 queues the work; any later or racing caller sees 1 and does nothing. This makes the helper safe from hard-IRQ context and with fl->lock already held. Link: https://lore.kernel.org/all/20261127-fix-put-work-irq-deadlock-v1-1-3aa66fe4f2c9@oss.qualcomm.com/ Fixes: 3f645f6884b5 ("misc: fastrpc: fix context leak and hang on signal-interrupted invoke") Cc: stable@vger.kernel.org Tested-by: Shawn Guo <shengchao.guo@oss.qualcomm.com> Reviewed-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com> Signed-off-by: Vinayak Katoch <vinayak.katoch@oss.qualcomm.com>
The put_work_scheduled field was converted to atomic_t, but fastrpc_notify_users() still accesses it directly as a boolean. This results in build errors due to the incompatible atomic_t type. Use fastrpc_context_schedule_put_work() to atomically test and set the state before scheduling the work. Fixes: qualcomm-linux#1606 Signed-off-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com>
|
Merge Check Failed: No CR Numbers Found Error: No Change Request numbers were found. Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests. |
Salendarsingh Gaud (sgaud-quic)
merged commit Dec 2, 2026
27cd2ba
into
qualcomm-linux:qcom-next
1 of 4 checks passed
|
VSF scan completed: no known CVEs found in the files this change touched. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1606