Re: [PATCH v6 2/2] accel/rocket: Fix iommu_group leak and unsafe IRQ register access

From: Sidong Yang

Date: Sat Oct 17 2026 - 01:30:41 EST


On Wed, Jun 10, 2026 at 03:10:45PM +0800, ZhaoJinming wrote:
> - iommu_detach_group(NULL, iommu_group_get(core->dev));
> + iommu_detach_group(NULL, core->iommu_group);

Looks right. I agree with Igor that this should go on its own; for a
standalone version:

Reviewed-by: Sidong Yang <sidong.yang@xxxxxxxxxx>

> device on the same IRQ line triggers an interrupt while the NPU is
> suspended, register reads return 0xffffffff, spuriously triggering
> WARN_ON macros and falsely returning IRQ_WAKE_THREAD.

On RK3588 the line is shared with the core's own IOMMU, so the guard
makes sense. But it's worse than a WARN: on a ROCK 5B+, reading
INTERRUPT_RAW_STATUS through /dev/mem while the core was runtime
suspended hung the board. Please mention both in the commit message.

> + ret = pm_runtime_get_if_active(core->dev);
> + if (ret == 0)
> + return IRQ_NONE;

This returns -EINVAL while runtime PM is disabled (e.g. during
pm_runtime_force_suspend()), and then the registers are read anyway.
Returning IRQ_NONE for ret <= 0, as rk_iommu_irq() does, covers that
and drops the "if (ret > 0)" checks.

With that, this part looks good to me too.

Thanks,
Sidong