Re: [PATCH v4 19/19] iommu: Remove detach_dev callback

From: Jason Gunthorpe
Date: Wed Jan 04 2023 - 08:23:43 EST


On Wed, Jan 04, 2023 at 08:57:25PM +0800, Lu Baolu wrote:
> The detach_dev callback of domain ops is not called in the IOMMU core.
> Remove this callback to avoid dead code. The trace event for detaching
> domain from device is removed accordingly.
>
> Signed-off-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> ---
> include/linux/iommu.h | 2 --
> include/trace/events/iommu.h | 7 -------
> drivers/iommu/iommu-traces.c | 1 -
> drivers/iommu/iommu.c | 29 +++++------------------------
> 4 files changed, 5 insertions(+), 34 deletions(-)
>
> diff --git a/include/linux/iommu.h b/include/linux/iommu.h
> index 0d10566b3cb2..a8063f26ff69 100644
> --- a/include/linux/iommu.h
> +++ b/include/linux/iommu.h
> @@ -299,7 +299,6 @@ struct iommu_ops {
> * * EBUSY - device is attached to a domain and cannot be changed
> * * ENODEV - device specific errors, not able to be attached
> * * <others> - treated as ENODEV by the caller. Use is discouraged
> - * @detach_dev: detach an iommu domain from a device
> * @set_dev_pasid: set an iommu domain to a pasid of device
> * @map: map a physically contiguous memory region to an iommu domain
> * @map_pages: map a physically contiguous set of pages of the same size to
> @@ -320,7 +319,6 @@ struct iommu_ops {
> */
> struct iommu_domain_ops {
> int (*attach_dev)(struct iommu_domain *domain, struct device *dev);
> - void (*detach_dev)(struct iommu_domain *domain, struct device *dev);
> int (*set_dev_pasid)(struct iommu_domain *domain, struct device *dev,
> ioasid_t pasid);
>
> diff --git a/include/trace/events/iommu.h b/include/trace/events/iommu.h
> index 29096fe12623..70743db1fb75 100644
> --- a/include/trace/events/iommu.h
> +++ b/include/trace/events/iommu.h
> @@ -76,13 +76,6 @@ DEFINE_EVENT(iommu_device_event, attach_device_to_domain,
> TP_ARGS(dev)
> );
>
> -DEFINE_EVENT(iommu_device_event, detach_device_from_domain,
> -
> - TP_PROTO(struct device *dev),
> -
> - TP_ARGS(dev)
> -);
> -

did you want to add a trace for the set_platform_dma_ops in the
earlier patch?

Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>

Jason