Re: [PATCH] nvme: stop asynchronous event work before ANA teardown
From: Yaohan Li
Date: Wed Nov 11 2026 - 21:03:26 EST
Hi Hannes,
That's a fair point. I agree that we shouldn't submit new AER requests once teardown has started.
The case I was trying to cover is a completion for an AER that was already outstanding. nvme_stop_ctrl() flushes async_event_work, but a completion can still queue it again before the transport has finished shutting down the admin queue.
In v2, I added the final cancellation in nvme_uninit_ctrl(), after the transport teardown, and kept the separate cancellation of ana_work before releasing its resources. Keith has since applied that version to nvme-7.4.
I agree that stopping the producer is preferable where possible. I don't think the final cancellation should be treated as a substitute for quiescing the completion path, and I'll check whether any transport can still deliver a callback beyond that point.
Thanks,
Yaohan