Re: [PATCH 2/3] remoteproc: qcom_q6v5: Skip handover callback if already issued
From: Stephan Gerhold
Date: Mon Aug 31 2026 - 01:56:36 EST
On Fri, Aug 28, 2026 at 11:43:10PM +0530, Mukesh Ojha wrote:
> When qcom_pas_attach() is called (subsystem already running at kernel
> probe time), it sets handover_issued = true before enabling the handover
> IRQ. The handover line may be high already (from bootloader boot), causing
> the IRQ to fire immediately. Since proxy resources were never acquired via
> qcom_pas_pds_enable() in the attach path, the resulting handover callback
> calls pm_runtime_put() on proxy power domains with usage count = 0:
>
> genpd genpd:0:d00000.remoteproc: Runtime PM usage count underflow!
> genpd genpd:1:d00000.remoteproc: Runtime PM usage count underflow!
>
> Also, because the old code left handover_irq_enabled = false after attach
> (fixed separately), the handover IRQ was never disabled inside the handler,
> allowing it to fire repeatedly and generating multiple underflows.
>
> Fix by recording whether handover_issued was already set before the IRQ
> fires and skipping the handover callback in that case. The callback
> releases proxy resources that are only held when the normal start path
> ran qcom_pas_pds_enable(); if handover was already marked as issued,
> those resources were never acquired and must not be released.
>
> Fixes: 16472c99f469 ("remoteproc: qcom: pas: Add late attach support for subsystems")
> Signed-off-by: Mukesh Ojha <mukesh.ojha@xxxxxxxxxxxxxxxx>
Shawn sent the same patch already and the same comment applies here:
https://lore.kernel.org/linux-arm-msm/amxf7MODINj26a4m@xxxxxxxxxx/
v2 fixes it properly:
https://lore.kernel.org/linux-arm-msm/20260801011731.1084591-1-shengchao.guo@xxxxxxxxxxxxxxxx/
Thanks,
Stephan