lkml.org 
[lkml]   [2018]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RESEND PATCH v6 14/14] iommu/rockchip: Support sharing IOMMU between masters
Hi Robin,

On 03/01/2018 07:03 PM, Robin Murphy wrote:
>>
>> +static struct iommu_group *rk_iommu_device_group(struct device *dev)
>> +{
>> + struct rk_iommu *iommu;
>> +
>> + iommu = rk_iommu_from_dev(dev);
>> +
>> + return iommu->group;
>
> Oops, seems I overlooked this in my previous review - it should really be:
>
> return iommu_group_get(iommu->group);
>
> or the refcounting will be unbalanced on those future systems where it
> really will be called more than once.
>
hmmm, right, it should be return iommu_group_ref_get(iommu->group);

i was following omap iommu:
static struct iommu_group *omap_iommu_device_group(struct device *dev)
{
struct omap_iommu_arch_data *arch_data = dev->archdata.iommu;
struct iommu_group *group = ERR_PTR(-EINVAL);

if (arch_data->iommu_dev)
group = arch_data->iommu_dev->group;

return group;
}

will fix it too in the version.

> Robin.


\
 
 \ /
  Last update: 2018-03-01 12:15    [W:0.054 / U:1.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site