RE: [PATCH 1/7] iommu/vt-d: Allocate pasid table in device probe path

From: Tian, Kevin
Date: Fri Nov 04 2022 - 21:34:05 EST


> From: Baolu Lu <baolu.lu@xxxxxxxxxxxxxxx>
> Sent: Saturday, November 5, 2022 9:10 AM
>
> On 2022/11/4 10:06, Tian, Kevin wrote:
> >> From: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> >> Sent: Thursday, November 3, 2022 1:53 PM
> >>
> >> @@ -4513,6 +4506,16 @@ static struct iommu_device
> >> *intel_iommu_probe_device(struct device *dev)
> >>
> >> dev_iommu_priv_set(dev, info);
> >>
> >> + if (sm_supported(iommu) && !dev_is_real_dma_subdevice(dev)) {
> >> + ret = intel_pasid_alloc_table(dev);
> >> + if (ret) {
> >> + dev_err(dev, "PASID table allocation failed\n");
> >> + dev_iommu_priv_set(dev, NULL);
> >> + kfree(info);
> >> + return ERR_PTR(ret);
> >> + }
> >> + }
> >> +
> >
> > move the added lines before dev_iommu_priv_set()
>
> intel_pasid_alloc_table() needs to reference info and store the pasid
> table into it.
>

Yes, I overlooked it.

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>