Re: [PATCH 3/3] iommu: Clean up release_device checks

2022-06-22 Thread Baolu Lu

On 2022/6/22 15:17, Robin Murphy wrote:

On 2022-06-22 02:36, Baolu Lu wrote:

On 2022/6/21 23:14, Robin Murphy wrote:

Since .release_device is now called through per-device ops, any call
which gets as far as a driver definitely*is*  for that driver, for a
device which has successfully passed .probe_device, so all the checks to
that effect are now redundant and can be removed. In the same vein we
can also skip freeing fwspecs which are now managed by core code.


Does this depend on any other series? I didn't see iommu_fwspec_free()
called in the core code. Or I missed anything?


dev_iommu_free() cleans up param->fwspec directly (see b54240ad4943). 
FWIW the plan is that iommu_fwspec_free() should eventually go away - of 
the remaining uses after this, two are in fact similarly redundant 
already, since there's also a dev_iommu_free() in the probe failure 
path, and the other two should disappear in part 2 of fixing the bus 
probing mess (wherein the of_xlate step gets pulled into 
iommu_probe_device as well, and finally works correctly again).


Yes, it is. Thanks for the explanation.

Reviewed-by: Lu Baolu 

Best regards,
baolu
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH 3/3] iommu: Clean up release_device checks

2022-06-22 Thread Robin Murphy

On 2022-06-22 02:36, Baolu Lu wrote:

On 2022/6/21 23:14, Robin Murphy wrote:

Since .release_device is now called through per-device ops, any call
which gets as far as a driver definitely*is*  for that driver, for a
device which has successfully passed .probe_device, so all the checks to
that effect are now redundant and can be removed. In the same vein we
can also skip freeing fwspecs which are now managed by core code.


Does this depend on any other series? I didn't see iommu_fwspec_free()
called in the core code. Or I missed anything?


dev_iommu_free() cleans up param->fwspec directly (see b54240ad4943). 
FWIW the plan is that iommu_fwspec_free() should eventually go away - of 
the remaining uses after this, two are in fact similarly redundant 
already, since there's also a dev_iommu_free() in the probe failure 
path, and the other two should disappear in part 2 of fixing the bus 
probing mess (wherein the of_xlate step gets pulled into 
iommu_probe_device as well, and finally works correctly again).


Cheers,
Robin.





Signed-off-by: Robin Murphy
---
  drivers/iommu/apple-dart.c  |  3 ---
  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c |  8 +---
  drivers/iommu/arm/arm-smmu/arm-smmu.c   | 14 +++---
  drivers/iommu/arm/arm-smmu/qcom_iommu.c | 11 ---
  drivers/iommu/exynos-iommu.c    |  3 ---
  drivers/iommu/mtk_iommu.c   |  5 -
  drivers/iommu/mtk_iommu_v1.c    |  5 -
  drivers/iommu/sprd-iommu.c  | 11 ---
  drivers/iommu/virtio-iommu.c    |  8 +---
  9 files changed, 5 insertions(+), 63 deletions(-)


Best regards,
baolu

___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH 3/3] iommu: Clean up release_device checks

2022-06-21 Thread Baolu Lu

On 2022/6/21 23:14, Robin Murphy wrote:

Since .release_device is now called through per-device ops, any call
which gets as far as a driver definitely*is*  for that driver, for a
device which has successfully passed .probe_device, so all the checks to
that effect are now redundant and can be removed. In the same vein we
can also skip freeing fwspecs which are now managed by core code.


Does this depend on any other series? I didn't see iommu_fwspec_free()
called in the core code. Or I missed anything?



Signed-off-by: Robin Murphy
---
  drivers/iommu/apple-dart.c  |  3 ---
  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c |  8 +---
  drivers/iommu/arm/arm-smmu/arm-smmu.c   | 14 +++---
  drivers/iommu/arm/arm-smmu/qcom_iommu.c | 11 ---
  drivers/iommu/exynos-iommu.c|  3 ---
  drivers/iommu/mtk_iommu.c   |  5 -
  drivers/iommu/mtk_iommu_v1.c|  5 -
  drivers/iommu/sprd-iommu.c  | 11 ---
  drivers/iommu/virtio-iommu.c|  8 +---
  9 files changed, 5 insertions(+), 63 deletions(-)


Best regards,
baolu
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu