[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230504143905.66fd14c7@jacob-builder>
Date: Thu, 4 May 2023 14:39:05 -0700
From: Jacob Pan <jacob.jun.pan@...ux.intel.com>
To: Baolu Lu <baolu.lu@...ux.intel.com>
Cc: "Tian, Kevin" <kevin.tian@...el.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>,
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>,
jacob.jun.pan@...ux.intel.com
Subject: Re: [PATCH v5 4/7] iommu/vt-d: Factoring out PASID set up helper
function
Hi Baolu,
On Wed, 3 May 2023 14:37:16 +0800, Baolu Lu <baolu.lu@...ux.intel.com>
wrote:
> 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;
>
Yeah, I think this is better. will do.
I was hoping not to treat RIDPASID special here. The caller of this
function does the check if that is RIDPASID but code is duplicated.
Thanks,
Jacob
Powered by blists - more mailing lists