On Mon, Aug 31, 2026 at 07:52:32AM +0200, Stephan Gerhold wrote:
> 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 <[email protected]>
>
> Shawn sent the same patch already and the same comment applies here:
> https://lore.kernel.org/linux-arm-msm/[email protected]/
>
> v2 fixes it properly:
> https://lore.kernel.org/linux-arm-msm/[email protected]/
>
Thanks for the pointer, Stephan. That looks better.
Regards,
Bjorn
> Thanks,
> Stephan