lkml.org 
[lkml]   [2021]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] drm/rockchip: Check iommu itself instead of it's parent for device_is_available
From
Date
Hi Robin:

On 6/28/21 5:54 PM, Robin Murphy wrote:
> On 2021-06-27 09:47, Andy Yan wrote:
>> When iommu itself is disabled in dts, we should
>> fallback to non-iommu buffer, check iommu parent
>> is meanless here.
>>
>> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
>> ---
>>
>>   drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
>> b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
>> index 212bd87c0c4a..0d20c8cc1ffa 100644
>> --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
>> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
>> @@ -366,7 +366,7 @@ static int rockchip_drm_platform_of_probe(struct
>> device *dev)
>>           }
>>             iommu = of_parse_phandle(port->parent, "iommus", 0);
>> -        if (!iommu || !of_device_is_available(iommu->parent)) {
>> +        if (!iommu || !of_device_is_available(iommu)) {
>
> Just wondering, could you use device_iommu_mapped() to avoid poking at
> the DT at all here, or is it that you need to check remote graph
> endpoints whose struct device may not be ready yet?


device_iommu_mapped(dev)  can't be called from rockchip_drm_init_iommu,
as there is no  iommu dev(vop) in these function.

>
> Robin.
>
>>               DRM_DEV_DEBUG(dev,
>>                         "no iommu attached for %pOF, using non-iommu
>> buffers\n",
>>                         port->parent);
>>
>
>
>


\
 
 \ /
  Last update: 2021-06-29 13:26    [W:0.114 / U:0.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site