Subject: Re: [RFC net] net: make page pool stall netdev unregistration to avoid IOMMU crashes

From: Jakub Kicinski <[email-masked]>
Date: Thu, 8 Aug 2024 06:52:28 -0700

On Thu, 8 Aug 2024 14:12:34 +0300 Ilias Apalodimas wrote:
> In any case why do you want to hold on the IOMMU? The network
> interface -- at least in theory -- should be down and we wont be
> processing any more packets.

I should have you a link to Yonglong's report:

https://lore.kernel.org/all/[email-masked]/

we get_device() hoping that it will keep the IOMMU machinery active
(even if the device won't use the page we need to unmap it when it's
freed), but it sounds like IOMMU dies when driver is unbound. Even if
there are outstanding references to the device.

I occasionally hit this problem reloading drivers during development,
TBH, too. And we have been told we "use the API wrong" so let's fix
it on our end?..