mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Yan <andy.yan@rock-chips.com>
To: Robin Murphy <robin.murphy@arm.com>,
	hjc@rock-chips.com, heiko@sntech.de,
	dri-devel@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/rockchip: Check iommu itself instead of it's parent for device_is_available
Date: Tue, 29 Jun 2021 19:18:29 +0800	[thread overview]
Message-ID: <f20e1547-649e-2d9b-cd90-7b8291d505a6@rock-chips.com> (raw)
In-Reply-To: <66fb4977-4e6f-f7ed-0dac-18710ebd782a@arm.com>

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



  reply	other threads:[~2021-06-29 11:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-27  8:47 Andy Yan
2021-06-28  9:54 ` Robin Murphy
2021-06-29 11:18   ` Andy Yan [this message]
2021-09-21 10:03 ` Heiko Stuebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f20e1547-649e-2d9b-cd90-7b8291d505a6@rock-chips.com \
    --to=andy.yan@rock-chips.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=robin.murphy@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®