[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5A5F45DA.5000104@rock-chips.com>
Date: Wed, 17 Jan 2018 20:47:22 +0800
From: JeffyChen <jeffy.chen@...k-chips.com>
To: Robin Murphy <robin.murphy@....com>, linux-kernel@...r.kernel.org
CC: jcliang@...omium.org, xxm@...k-chips.com, tfiga@...omium.org,
Heiko Stuebner <heiko@...ech.de>,
linux-rockchip@...ts.infradead.org,
iommu@...ts.linux-foundation.org, Joerg Roedel <joro@...tes.org>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v2 09/13] iommu/rockchip: Use iommu_group_get_for_dev()
for add_device
Hi Robin,
On 01/17/2018 08:31 PM, Robin Murphy wrote:
> On 16/01/18 13:25, Jeffy Chen wrote:
>> IOMMU drivers are supposed to call this function instead of manually
>> creating a group in their .add_device callback. This behavior is not
>> strictly required by ARM DMA mapping implementation, but ARM64 already
>> relies on it. This patch fixes the rockchip-iommu driver to comply with
>> this requirement.
>
> FWIW that's not 100% true: what arm64 relies on is the group having a
> default DMA ops domain. Technically, you *could* open-code that in the
> driver's group allocation, but obviously using the appropriate existing
> API is nicer :)
ok, will rewrite the commit message.
>
> [...]
>> @@ -1182,6 +1164,29 @@ static void rk_iommu_remove_device(struct
>> device *dev)
>> iommu_group_remove_device(dev);
>> }
>> +static struct iommu_group *rk_iommu_device_group(struct device *dev)
>> +{
>> + struct iommu_group *group;
>> + int ret;
>> +
>> + group = iommu_group_get(dev);
>> + if (!group) {
>
> This check is pointless - if dev->iommu_group were non-NULL you wouldn't
> have been called in the first place.
right, it's allocated in the probe.
>
> Robin.
Powered by blists - more mailing lists