Alex, is any trick behind checking -ENODEV overlooked here?
From: Jason Gunthorpe jgg@nvidia.com Sent: Tuesday, November 8, 2022 1:55 AM
rc = iommu_get_msi_cookie(hwpt->domain, sw_msi_start);
if (rc && rc != -ENODEV)
return rc;
I know this is copied from VFIO but a comment is appreciated why -ENODEV is considered sane to move forward.
Huh. I actually don't know. It looks like it is here to detect that the static inline for !CONFIG_IOMMU_DMA returns it.
However, if we have !CONFIG_IOMMU_DMA then I think we also don't get interrupts at all. Ie iommu_dma_prepare_msi() becomes a NOP and nothing will map the ITS page into the iomm_domain.
So let's drop the ENODEV check, it looks wrong.