Linux IOMMU Development
 help / color / mirror / Atom feed
* [PATCH] iommu: Use dev_iommu_ops() for probe_finalize
@ 2022-04-22 12:33 Robin Murphy
  2022-04-22 12:57 ` Lu Baolu
  0 siblings, 1 reply; 2+ messages in thread
From: Robin Murphy @ 2022-04-22 12:33 UTC (permalink / raw)
  To: joro, will; +Cc: iommu, linux-kernel

The ->probe_finalize hook only runs after ->probe_device succeeds,
so we can move that over to the new dev_iommu_ops() as well.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---

Another cheeky little one which doesn't need to wait...

 drivers/iommu/iommu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 1b8dcda5fbe4..8825a4628e46 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -315,7 +315,7 @@ static int __iommu_probe_device(struct device *dev, struct list_head *group_list
 
 int iommu_probe_device(struct device *dev)
 {
-	const struct iommu_ops *ops = dev->bus->iommu_ops;
+	const struct iommu_ops *ops;
 	struct iommu_group *group;
 	int ret;
 
@@ -352,6 +352,7 @@ int iommu_probe_device(struct device *dev)
 	mutex_unlock(&group->mutex);
 	iommu_group_put(group);
 
+	ops = dev_iommu_ops(dev);
 	if (ops->probe_finalize)
 		ops->probe_finalize(dev);
 
-- 
2.35.3.dirty

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iommu: Use dev_iommu_ops() for probe_finalize
  2022-04-22 12:33 [PATCH] iommu: Use dev_iommu_ops() for probe_finalize Robin Murphy
@ 2022-04-22 12:57 ` Lu Baolu
  0 siblings, 0 replies; 2+ messages in thread
From: Lu Baolu @ 2022-04-22 12:57 UTC (permalink / raw)
  To: Robin Murphy, joro, will; +Cc: iommu, linux-kernel

On 2022/4/22 20:33, Robin Murphy wrote:
> The ->probe_finalize hook only runs after ->probe_device succeeds,
> so we can move that over to the new dev_iommu_ops() as well.
> 
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>

Best regards,
baolu

> ---
> 
> Another cheeky little one which doesn't need to wait...
> 
>   drivers/iommu/iommu.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 1b8dcda5fbe4..8825a4628e46 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -315,7 +315,7 @@ static int __iommu_probe_device(struct device *dev, struct list_head *group_list
>   
>   int iommu_probe_device(struct device *dev)
>   {
> -	const struct iommu_ops *ops = dev->bus->iommu_ops;
> +	const struct iommu_ops *ops;
>   	struct iommu_group *group;
>   	int ret;
>   
> @@ -352,6 +352,7 @@ int iommu_probe_device(struct device *dev)
>   	mutex_unlock(&group->mutex);
>   	iommu_group_put(group);
>   
> +	ops = dev_iommu_ops(dev);
>   	if (ops->probe_finalize)
>   		ops->probe_finalize(dev);
>   
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-22 12:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-22 12:33 [PATCH] iommu: Use dev_iommu_ops() for probe_finalize Robin Murphy
2022-04-22 12:57 ` Lu Baolu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox