linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/rockchip: Check iommu itself instead of it's parent for device_is_available
@ 2021-06-27  8:47 Andy Yan
  2021-06-28  9:54 ` Robin Murphy
  2021-09-21 10:03 ` Heiko Stuebner
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Yan @ 2021-06-27  8:47 UTC (permalink / raw)
  To: hjc, heiko, dri-devel, linux-rockchip
  Cc: linux-arm-kernel, linux-kernel, Andy Yan

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)) {
 			DRM_DEV_DEBUG(dev,
 				      "no iommu attached for %pOF, using non-iommu buffers\n",
 				      port->parent);
-- 
2.25.1




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

* Re: [PATCH] drm/rockchip: Check iommu itself instead of it's parent for device_is_available
  2021-06-27  8:47 [PATCH] drm/rockchip: Check iommu itself instead of it's parent for device_is_available Andy Yan
@ 2021-06-28  9:54 ` Robin Murphy
  2021-06-29 11:18   ` Andy Yan
  2021-09-21 10:03 ` Heiko Stuebner
  1 sibling, 1 reply; 4+ messages in thread
From: Robin Murphy @ 2021-06-28  9:54 UTC (permalink / raw)
  To: Andy Yan, hjc, heiko, dri-devel, linux-rockchip
  Cc: linux-arm-kernel, linux-kernel

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?

Robin.

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

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

* Re: [PATCH] drm/rockchip: Check iommu itself instead of it's parent for device_is_available
  2021-06-28  9:54 ` Robin Murphy
@ 2021-06-29 11:18   ` Andy Yan
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Yan @ 2021-06-29 11:18 UTC (permalink / raw)
  To: Robin Murphy, hjc, heiko, dri-devel, linux-rockchip
  Cc: linux-arm-kernel, linux-kernel

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);
>>
>
>
>



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

* Re: [PATCH] drm/rockchip: Check iommu itself instead of it's parent for device_is_available
  2021-06-27  8:47 [PATCH] drm/rockchip: Check iommu itself instead of it's parent for device_is_available Andy Yan
  2021-06-28  9:54 ` Robin Murphy
@ 2021-09-21 10:03 ` Heiko Stuebner
  1 sibling, 0 replies; 4+ messages in thread
From: Heiko Stuebner @ 2021-09-21 10:03 UTC (permalink / raw)
  To: hjc, linux-rockchip, Andy Yan, dri-devel
  Cc: Heiko Stuebner, linux-arm-kernel, linux-kernel

On Sun, 27 Jun 2021 16:47:37 +0800, Andy Yan wrote:
> When iommu itself is disabled in dts, we should
> fallback to non-iommu buffer, check iommu parent
> is meanless here.

Applied, thanks!

[1/1] drm/rockchip: Check iommu itself instead of it's parent for device_is_available
      commit: e1202c7a65b10258f9a11c1d2613c2aa91fe11cd

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

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

end of thread, other threads:[~2021-09-21 10:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-27  8:47 [PATCH] drm/rockchip: Check iommu itself instead of it's parent for device_is_available Andy Yan
2021-06-28  9:54 ` Robin Murphy
2021-06-29 11:18   ` Andy Yan
2021-09-21 10:03 ` Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).