iommu: Use EINVAL for incompatible device/domain in ->attach_dev
authorNicolin Chen <nicolinc@nvidia.com>
Mon, 17 Oct 2022 23:02:21 +0000 (16:02 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 1 Nov 2022 17:39:59 +0000 (14:39 -0300)
commitf4a14773579302e5f0c4bf80b03f0db7ce67f2ce
treeb3a260911369cf6b131b7926874c4ae69cd005c6
parentbd7ebb7719356d750b1b4d671535922bae43fb3b
iommu: Use EINVAL for incompatible device/domain in ->attach_dev

Following the new rules in include/linux/iommu.h kdocs, update all drivers
->attach_dev callback functions to return EINVAL in the failure paths that
are related to domain incompatibility.

Also, drop adjacent error prints to prevent a kernel log spam.

Link: https://lore.kernel.org/r/f52a07f7320da94afe575c9631340d0019a203a7.1666042873.git.nicolinc@nvidia.com
Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
drivers/iommu/arm/arm-smmu/arm-smmu.c
drivers/iommu/arm/arm-smmu/qcom_iommu.c
drivers/iommu/intel/iommu.c
drivers/iommu/ipmmu-vmsa.c
drivers/iommu/omap-iommu.c
drivers/iommu/sprd-iommu.c
drivers/iommu/tegra-gart.c
drivers/iommu/virtio-iommu.c