2022-04-22 18:14:04

by Sasha Levin

[permalink] [raw]
Subject: [PATCH AUTOSEL 5.4 11/14] drm/msm: Stop using iommu_present()

From: Robin Murphy <[email protected]>

[ Upstream commit e2a88eabb02410267519b838fb9b79f5206769be ]

Even if some IOMMU has registered itself on the platform "bus", that
doesn't necessarily mean it provides translation for the device we
care about. Replace iommu_present() with a more appropriate check.

Signed-off-by: Robin Murphy <[email protected]>
Reviewed-by: Rob Clark <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/480707/
Link: https://lore.kernel.org/r/5ab4f4574d7f3e042261da702d493ee40d003356.1649168268.git.robin.murphy@arm.com
Signed-off-by: Dmitry Baryshkov <[email protected]>
Signed-off-by: Rob Clark <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/gpu/drm/msm/msm_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 407b51cf6790..7322df9cf673 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -303,7 +303,7 @@ bool msm_use_mmu(struct drm_device *dev)
struct msm_drm_private *priv = dev->dev_private;

/* a2xx comes with its own MMU */
- return priv->is_a2xx || iommu_present(&platform_bus_type);
+ return priv->is_a2xx || device_iommu_mapped(dev->dev);
}

static int msm_init_vram(struct drm_device *dev)
--
2.35.1


2022-04-22 18:44:27

by Rob Clark

[permalink] [raw]
Subject: Re: [PATCH AUTOSEL 5.4 11/14] drm/msm: Stop using iommu_present()

You might want to drop this one, it seems to be causing some issues on
older generations.. I'll be sending another PR shortly with a revert.

https://patchwork.freedesktop.org/patch/482453

BR,
-R

On Tue, Apr 19, 2022 at 11:15 AM Sasha Levin <[email protected]> wrote:
>
> From: Robin Murphy <[email protected]>
>
> [ Upstream commit e2a88eabb02410267519b838fb9b79f5206769be ]
>
> Even if some IOMMU has registered itself on the platform "bus", that
> doesn't necessarily mean it provides translation for the device we
> care about. Replace iommu_present() with a more appropriate check.
>
> Signed-off-by: Robin Murphy <[email protected]>
> Reviewed-by: Rob Clark <[email protected]>
> Patchwork: https://patchwork.freedesktop.org/patch/480707/
> Link: https://lore.kernel.org/r/5ab4f4574d7f3e042261da702d493ee40d003356.1649168268.git.robin.murphy@arm.com
> Signed-off-by: Dmitry Baryshkov <[email protected]>
> Signed-off-by: Rob Clark <[email protected]>
> Signed-off-by: Sasha Levin <[email protected]>
> ---
> drivers/gpu/drm/msm/msm_drv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index 407b51cf6790..7322df9cf673 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -303,7 +303,7 @@ bool msm_use_mmu(struct drm_device *dev)
> struct msm_drm_private *priv = dev->dev_private;
>
> /* a2xx comes with its own MMU */
> - return priv->is_a2xx || iommu_present(&platform_bus_type);
> + return priv->is_a2xx || device_iommu_mapped(dev->dev);
> }
>
> static int msm_init_vram(struct drm_device *dev)
> --
> 2.35.1
>

2022-04-23 14:05:03

by Sasha Levin

[permalink] [raw]
Subject: Re: [PATCH AUTOSEL 5.4 11/14] drm/msm: Stop using iommu_present()

On Tue, Apr 19, 2022 at 11:53:23AM -0700, Rob Clark wrote:
>You might want to drop this one, it seems to be causing some issues on
>older generations.. I'll be sending another PR shortly with a revert.
>
>https://patchwork.freedesktop.org/patch/482453

Dropped, thanks!

--
Thanks,
Sasha