Linux real-time development
 help / color / mirror / Atom feed
* [PATCH 0/2] mailbox: qcom-cpucp: fix two PREEMPT_RT bugs in IRQ handler
@ 2026-08-06  7:03 Jia Yang
  2026-08-06  7:03 ` [PATCH 1/2] mailbox: qcom-cpucp: fix PREEMPT_RT self-deadlock " Jia Yang
  2026-08-06  7:03 ` [PATCH 2/2] mailbox: qcom-cpucp: handle NULL data in send_data callback Jia Yang
  0 siblings, 2 replies; 4+ messages in thread
From: Jia Yang @ 2026-08-06  7:03 UTC (permalink / raw)
  To: Sibi Sankar, Jassi Brar, Sebastian Andrzej Siewior,
	Clark Williams, Steven Rostedt, Bjorn Andersson, Konrad Dybcio,
	Dmitry Baryshkov, jie.gan
  Cc: linux-arm-msm, linux-kernel, linux-rt-devel, Jia Yang

This series fixes two bugs in the qcom-cpucp mailbox driver that cause
kernel instability under PREEMPT_RT.

The first patch fixes a self-deadlock: the IRQ handler calls
mbox_chan_received_data() while holding chan->lock. Under PREEMPT_RT,
spin_lock_irqsave() is converted to an rt_spinlock (rtmutex-based). The
callback chain triggered by mbox_chan_received_data() re-acquires the
same lock, causing a permanent deadlock. The fix moves the callback
invocation to after the lock is released.

The second patch fixes a NULL pointer dereference that was masked by
the first bug: mailbox_clear_channel() calls mbox_send_message() with
NULL data, and qcom_cpucp_mbox_send_data() dereferences it without a
NULL check.

Both bugs were reproduced on Kaanapali (SM8850) with CONFIG_PREEMPT_RT=y.

Signed-off-by: Jia Yang <jia.yang@oss.qualcomm.com>
---
Jia Yang (2):
      mailbox: qcom-cpucp: fix PREEMPT_RT self-deadlock in IRQ handler
      mailbox: qcom-cpucp: handle NULL data in send_data callback

 drivers/mailbox/qcom-cpucp-mbox.c | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)
---
base-commit: 3df25501ceec0d590d3ad416b571563beb364fb7
change-id: 20260806-mailbox-qcom-cpucp-preempt-rt-fix-36472b46a378

Best regards,
-- 
Jia Yang <jia.yang@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-06  7:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06  7:03 [PATCH 0/2] mailbox: qcom-cpucp: fix two PREEMPT_RT bugs in IRQ handler Jia Yang
2026-08-06  7:03 ` [PATCH 1/2] mailbox: qcom-cpucp: fix PREEMPT_RT self-deadlock " Jia Yang
2026-08-06  7:16   ` sashiko-bot
2026-08-06  7:03 ` [PATCH 2/2] mailbox: qcom-cpucp: handle NULL data in send_data callback Jia Yang

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