Re: [PATCH] mtd: rawnand: tegra: drain the IRQ before disabling the clock

From: Miquel Raynal

Date: Thu Nov 26 2026 - 13:02:06 EST


On 08/11/2026 at 14:05:55 -07, James Hilliard <james.hilliard1@xxxxxxxxx> wrote:

> The managed IRQ handler remains installed until devres cleanup, after
> removal or a late probe failure has suspended the controller and disabled
> its clock. The handler can still be accessing registers at that point:
> it signals the command and DMA completions before its final register
> accesses, so waiting for a NAND operation does not drain the IRQ handler.
>
> Mask controller interrupts and release the managed IRQ before dropping
> the runtime PM reference. Apply the same ordering when chip initialization
> fails after the IRQ has been requested.

Can we instead include power mangement in the devres logic? In general
when one need to manually devm_remove/freee/unregister(), it means there
is problem and the solution is incorrect.