lkml.org 
[lkml]   [2019]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 1/1] iommu: Bind process address spaces to devices
Date
Hi Joerg,

On 25/03/2019 14:44, Joerg Roedel wrote:
> Hey Jean-Philippe,
>
> thanks for the patch, I think we are on the finish line with this
> interface. Just one small question below.
>
> On Wed, Mar 20, 2019 at 03:02:58PM +0000, Jean-Philippe Brucker wrote:
>> +int iommu_sva_set_ops(struct iommu_sva *handle,
>> + const struct iommu_sva_ops *sva_ops)
>> +{
>> + const struct iommu_ops *ops = handle->dev->bus->iommu_ops;
>> +
>> + if (!ops || !ops->sva_set_ops)
>> + return -ENODEV;
>> +
>> + return ops->sva_set_ops(handle, sva_ops);
>> +}
>
> What is the purpose of the sva_set_ops call-back in iommu-ops? Is the
> IOMMU driver supposed to do some extra setup work with the provided ops?
> Otherwise we can just store the pointer in 'struct iommu_sva' without
> calling into the iommu driver.

Right that would be simpler. I added the sva_set_ops callback so that
IOMMU driver can use the same lock in unbind() and sva_set_ops(). But I
think it's safe to assume that device drivers don't call unbind() before
setting the ops.

Thanks,
Jean

\
 
 \ /
  Last update: 2019-04-01 12:11    [W:0.033 / U:8.784 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site