[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c815fa2b-00df-91e1-8353-8258773957e4@linux.intel.com>
Date: Wed, 12 Jul 2023 10:43:46 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: "Tian, Kevin" <kevin.tian@...el.com>,
Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>,
Jason Gunthorpe <jgg@...pe.ca>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
Nicolin Chen <nicolinc@...dia.com>
Cc: baolu.lu@...ux.intel.com, "Liu, Yi L" <yi.l.liu@...el.com>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>,
"iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 5/9] iommu: Make fault_param generic
On 2023/7/11 14:14, Tian, Kevin wrote:
>> From: Lu Baolu <baolu.lu@...ux.intel.com>
>> Sent: Tuesday, July 11, 2023 9:07 AM
>>
>> @@ -299,7 +299,15 @@ static int dev_iommu_get(struct device *dev)
>> return -ENOMEM;
>>
>> mutex_init(¶m->lock);
>> + param->fault_param = kzalloc(sizeof(*param->fault_param),
>> GFP_KERNEL);
>> + if (!param->fault_param) {
>> + kfree(param);
>> + return -ENOMEM;
>> + }
>> + mutex_init(¶m->fault_param->lock);
>> + INIT_LIST_HEAD(¶m->fault_param->faults);
>> dev->iommu = param;
>> +
>> return 0;
>> }
>
> Upon above changes is it slightly cleaner to call it dev_iommu_init()
> to better pair with dev_iommu_free()?
dev_iommu_init() was introduced in Jason's series. It's not landed yet.
https://lore.kernel.org/linux-iommu/0-v3-328044aa278c+45e49-iommu_probe_jgg@nvidia.com/
Sure. Should refine this code after above patches are landed.
Best regards,
baolu
Powered by blists - more mailing lists