Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] slimbus: qcom-ngd-ctrl: Restore the interrupt and RX queue setup on resume
@ 2026-12-04  1:28 Fabricio Akio via B4 Relay
  2026-12-04  1:40 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Fabricio Akio via B4 Relay @ 2026-12-04  1:28 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: linux-arm-msm, linux-sound, Fabricio Akio

From: Fabricio Akio <fabricioakio@gmail.com>

When the NGD resumes with its logical address retained, the driver only
sets the DMA and the message queues up again. On SDM630 the NGD's
interrupt enable and RX message queue configuration registers read zero
at that point, so no reply is received: after the first runtime suspend,
a message waiting for one times out.

Program both registers again when the interrupt enable register reads
zero, as is done when the logical address is lost.

Signed-off-by: Fabricio Akio <fabricioakio@gmail.com>
---
Tested on a Motorola Moto X4 (SDM630), whose board file is not in
mainline yet, on sdm660-mainline's kernel: with the patch switched off a
logical address query after the controller's first runtime suspend times
out waiting for its reply, five times of five, with it each is answered.

The vendor's driver does the same when the NGD kept its logical address
and its interrupt enable register reads zero:
https://github.com/LineageOS/android_kernel_motorola_msm8998/blob/ce9ea8f125c7302ae9b2fec84f23a69271e957c3/drivers/slimbus/slim-msm-ngd.c#L1351-L1385
---
 drivers/slimbus/qcom-ngd-ctrl.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index a29e57303046..284a9e3cc2fb 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1292,6 +1292,15 @@ static int qcom_slim_ngd_power_up(struct qcom_slim_ngd_ctrl *ctrl)
 			dev_info(ctrl->dev, "Subsys restart: ADSP active framer\n");
 			return 0;
 		}
+
+		/* The NGD can keep its logical address and lose these */
+		if (!readl_relaxed(ngd->base + NGD_INT_EN)) {
+			writel_relaxed(DEF_NGD_INT_MASK, ngd->base + NGD_INT_EN);
+			rx_msgq = readl_relaxed(ngd->base + NGD_RX_MSGQ_CFG);
+			writel_relaxed(rx_msgq | SLIM_RX_MSGQ_TIMEOUT_VAL,
+				       ngd->base + NGD_RX_MSGQ_CFG);
+		}
+
 		qcom_slim_ngd_setup(ctrl);
 		return 0;
 	}

---
base-commit: 799dd936553182df5770dde7f38d94c8337df75a
change-id: 20261203-slim-ngd-resume-irq-32fef64ba481

Best regards,
--  
Fabricio Akio <fabricioakio@gmail.com>



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

end of thread, other threads:[~2026-12-04  1:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  1:28 [PATCH] slimbus: qcom-ngd-ctrl: Restore the interrupt and RX queue setup on resume Fabricio Akio via B4 Relay
2026-12-04  1:40 ` sashiko-bot

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