lkml.org 
[lkml]   [2023]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v5 4/7] iommu/vt-d: Factoring out PASID set up helper function
From
On 4/28/23 5:47 PM, Tian, Kevin wrote:
>> From: Jacob Pan <jacob.jun.pan@linux.intel.com>
>> Sent: Friday, April 28, 2023 1:50 AM
>>
>>
>> +static int dmar_domain_attach_device_pasid(struct dmar_domain *domain,
>> + struct intel_iommu *iommu,
>> + struct device *dev, ioasid_t pasid)
>> +{
>> + int ret;
>> +
>> + /* PASID table is mandatory for a PCI device in scalable mode. */
>> + if (!sm_supported(iommu) && dev_is_real_dma_subdevice(dev))
>> + return -EOPNOTSUPP;
>
> "&&" should be "||"
>

Also should return success instead if this is a RID case. Perhaps,

if (!sm_supported(iommu) || dev_is_real_dma_subdevice(dev))
return pasid == RID2PASID ? 0 : -EOPNOTSUPP;

Best regards,
baolu

\
 
 \ /
  Last update: 2023-05-03 08:38    [W:0.169 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site