* [PATCH rc] iommu/sva: Fix SVA handle sharing in multi device case
@ 2024-02-27 6:48 Zhangfei Gao
2024-02-27 6:51 ` Baolu Lu
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Zhangfei Gao @ 2024-02-27 6:48 UTC (permalink / raw)
To: Joerg Roedel, Will Deacon, jean-philippe, Jason Gunthorpe,
baolu.lu, Zhang, Tina, kevin.tian
Cc: iommu, linux-kernel, Zhangfei Gao
iommu_sva_bind_device will directly goto out in multi-device
case when found existing domain, ignoring list_add handle,
which causes the handle to fail to be shared.
Fixes: 65d4418c5002 ("iommu/sva: Restore SVA handle sharing")
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
---
Based on rc6
drivers/iommu/iommu-sva.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/iommu-sva.c b/drivers/iommu/iommu-sva.c
index 7f91c8d0064b..65814cbc8402 100644
--- a/drivers/iommu/iommu-sva.c
+++ b/drivers/iommu/iommu-sva.c
@@ -117,11 +117,11 @@ struct iommu_sva *iommu_sva_bind_device(struct device *dev, struct mm_struct *mm
if (ret)
goto out_free_domain;
domain->users = 1;
- refcount_set(&handle->users, 1);
list_add(&domain->next, &mm->iommu_mm->sva_domains);
- list_add(&handle->handle_item, &mm->iommu_mm->sva_handles);
out:
+ refcount_set(&handle->users, 1);
+ list_add(&handle->handle_item, &mm->iommu_mm->sva_handles);
mutex_unlock(&iommu_sva_lock);
handle->dev = dev;
handle->domain = domain;
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH rc] iommu/sva: Fix SVA handle sharing in multi device case
2024-02-27 6:48 [PATCH rc] iommu/sva: Fix SVA handle sharing in multi device case Zhangfei Gao
@ 2024-02-27 6:51 ` Baolu Lu
2024-02-27 7:42 ` Tian, Kevin
2024-03-01 12:54 ` Joerg Roedel
2 siblings, 0 replies; 4+ messages in thread
From: Baolu Lu @ 2024-02-27 6:51 UTC (permalink / raw)
To: Zhangfei Gao, Joerg Roedel, Will Deacon, jean-philippe,
Jason Gunthorpe, Zhang, Tina, kevin.tian
Cc: baolu.lu, iommu, linux-kernel
On 2/27/24 2:48 PM, Zhangfei Gao wrote:
> iommu_sva_bind_device will directly goto out in multi-device
> case when found existing domain, ignoring list_add handle,
> which causes the handle to fail to be shared.
>
> Fixes: 65d4418c5002 ("iommu/sva: Restore SVA handle sharing")
> Signed-off-by: Zhangfei Gao<zhangfei.gao@linaro.org>
> Reviewed-by: Jason Gunthorpe<jgg@nvidia.com>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Best regards,
baolu
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH rc] iommu/sva: Fix SVA handle sharing in multi device case
2024-02-27 6:48 [PATCH rc] iommu/sva: Fix SVA handle sharing in multi device case Zhangfei Gao
2024-02-27 6:51 ` Baolu Lu
@ 2024-02-27 7:42 ` Tian, Kevin
2024-03-01 12:54 ` Joerg Roedel
2 siblings, 0 replies; 4+ messages in thread
From: Tian, Kevin @ 2024-02-27 7:42 UTC (permalink / raw)
To: Zhangfei Gao, Joerg Roedel, Will Deacon, jean-philippe,
Jason Gunthorpe, baolu.lu@linux.intel.com, Zhang, Tina
Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org
> From: Zhangfei Gao <zhangfei.gao@linaro.org>
> Sent: Tuesday, February 27, 2024 2:48 PM
>
> iommu_sva_bind_device will directly goto out in multi-device
> case when found existing domain, ignoring list_add handle,
> which causes the handle to fail to be shared.
>
> Fixes: 65d4418c5002 ("iommu/sva: Restore SVA handle sharing")
> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH rc] iommu/sva: Fix SVA handle sharing in multi device case
2024-02-27 6:48 [PATCH rc] iommu/sva: Fix SVA handle sharing in multi device case Zhangfei Gao
2024-02-27 6:51 ` Baolu Lu
2024-02-27 7:42 ` Tian, Kevin
@ 2024-03-01 12:54 ` Joerg Roedel
2 siblings, 0 replies; 4+ messages in thread
From: Joerg Roedel @ 2024-03-01 12:54 UTC (permalink / raw)
To: Zhangfei Gao
Cc: Will Deacon, jean-philippe, Jason Gunthorpe, baolu.lu,
Zhang, Tina, kevin.tian, iommu, linux-kernel
On Tue, Feb 27, 2024 at 06:48:21AM +0000, Zhangfei Gao wrote:
> iommu_sva_bind_device will directly goto out in multi-device
> case when found existing domain, ignoring list_add handle,
> which causes the handle to fail to be shared.
>
> Fixes: 65d4418c5002 ("iommu/sva: Restore SVA handle sharing")
> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-03-01 12:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-27 6:48 [PATCH rc] iommu/sva: Fix SVA handle sharing in multi device case Zhangfei Gao
2024-02-27 6:51 ` Baolu Lu
2024-02-27 7:42 ` Tian, Kevin
2024-03-01 12:54 ` Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox