[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9fb1c0dd-ea78-a3f7-9eac-3154f5d08ad5@linux.intel.com>
Date: Wed, 3 May 2023 14:37:16 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: "Tian, Kevin" <kevin.tian@...el.com>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>,
LKML <linux-kernel@...r.kernel.org>,
"iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
Robin Murphy <robin.murphy@....com>,
Jason Gunthorpe <jgg@...dia.com>,
Joerg Roedel <joro@...tes.org>,
"dmaengine@...r.kernel.org" <dmaengine@...r.kernel.org>,
"vkoul@...nel.org" <vkoul@...nel.org>
Cc: baolu.lu@...ux.intel.com, Will Deacon <will@...nel.org>,
David Woodhouse <dwmw2@...radead.org>,
"Raj, Ashok" <ashok.raj@...el.com>,
"Liu, Yi L" <yi.l.liu@...el.com>,
"Yu, Fenghua" <fenghua.yu@...el.com>,
"Jiang, Dave" <dave.jiang@...el.com>,
"Luck, Tony" <tony.luck@...el.com>,
"Zanussi, Tom" <tom.zanussi@...el.com>,
"Ranganathan, Narayan" <narayan.ranganathan@...el.com>
Subject: Re: [PATCH v5 4/7] iommu/vt-d: Factoring out PASID set up helper
function
On 4/28/23 5:47 PM, Tian, Kevin wrote:
>> From: Jacob Pan <jacob.jun.pan@...ux.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
Powered by blists - more mailing lists