summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLizhi Hou <lizhi.hou@amd.com>2026-06-04 23:28:15 +0300
committerLizhi Hou <lizhi.hou@amd.com>2026-06-10 09:22:33 +0300
commit2db6ddf1cbc84978d1690d574e92626d431e407d (patch)
treeb01ee3204d9f1e895a328de2710397bfe52e8118
parentb08472db93b1ccff84a7adec5779d47f0e9d3a30 (diff)
downloadlinux-2db6ddf1cbc84978d1690d574e92626d431e407d.tar.xz
accel/amdxdna: Clear sva pointer after unbind
Add client->sva = NULL after the unbind makes it consistent with how amdxdna_sva_fini() already clears the pointer after unbinding. The IS_ERR_OR_NULL guard in sva_fini will then correctly skip the second unbind. Fixes: 3cc5d7a59519 ("accel/amdxdna: Add carveout memory support for non-IOMMU systems") Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com> Link: https://patch.msgid.link/20260604202815.2425882-1-lizhi.hou@amd.com
-rw-r--r--drivers/accel/amdxdna/amdxdna_pci_drv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/accel/amdxdna/amdxdna_pci_drv.c b/drivers/accel/amdxdna/amdxdna_pci_drv.c
index 1f066ed8d236..65489bb3f2b0 100644
--- a/drivers/accel/amdxdna/amdxdna_pci_drv.c
+++ b/drivers/accel/amdxdna/amdxdna_pci_drv.c
@@ -87,6 +87,7 @@ static int amdxdna_sva_init(struct amdxdna_client *client)
client->pasid = iommu_sva_get_pasid(client->sva);
if (client->pasid == IOMMU_PASID_INVALID) {
iommu_sva_unbind_device(client->sva);
+ client->sva = NULL;
XDNA_ERR(xdna, "SVA get pasid failed");
return -ENODEV;
}