lkml.org 
[lkml]   [2023]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 1/8] iommu: Decouple iommu_present() from bus ops
From
On 2023-01-30 17:31, Jason Gunthorpe wrote:
> On Thu, Jan 26, 2023 at 06:26:16PM +0000, Robin Murphy wrote:
>> Much as I'd like to remove iommu_present(), the final remaining users
>> are proving stubbornly difficult to clean up, so kick that can down
>> the road and just rework it to preserve the current behaviour without
>> depending on bus ops.
>>
>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
>> ---
>
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
>
> This below might help. You might need to ask Thierry for help on the
> problematic stuff in tegra. Really we should finish the series here
> and organize things so that the domain allocation is defered until a
> client is present.

mrk_drm doesn't even allocate, it relies on the DMA API domain; it also
only runs on DT systems where IOMMU dependency ordering has been
enforced by core code for a very long time now. I sent a patch simply
removing that check back at the time of the rest of my iommu_present()
cleanup, and it just got resoundingly ignored :(

Thanks,
Robin.

> https://lore.kernel.org/linux-iommu/20220106022053.2406748-1-baolu.lu@linux.intel.com/
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> index cd5b18ef79512c..e5c257e41f4933 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -353,9 +353,6 @@ static int mtk_drm_kms_init(struct drm_device *drm)
> if (drm_firmware_drivers_only())
> return -ENODEV;
>
> - if (!iommu_present(&platform_bus_type))
> - return -EPROBE_DEFER;
> -
> pdev = of_find_device_by_node(private->mutex_node);
> if (!pdev) {
> dev_err(drm->dev, "Waiting for disp-mutex device %pOF\n",
> @@ -709,6 +706,9 @@ static int mtk_drm_probe(struct platform_device *pdev)
> int ret;
> int i;
>
> + if (!device_iommu_mapped(dev))
> + return -EPROBE_DEFER;
> +
> private = devm_kzalloc(dev, sizeof(*private), GFP_KERNEL);
> if (!private)
> return -ENOMEM;

\
 
 \ /
  Last update: 2023-03-27 00:02    [W:0.606 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site