Re: [PATCH V1] accel/amdxdna: Clear sva pointer after unbind
From: Mario Limonciello
Date: Tue Jun 09 2026 - 18:48:11 EST
On 6/4/26 15:28, Lizhi Hou wrote:
Add client->sva = NULL after the unbind makes it consistent with howReviewed-by: Mario Limonciello (AMD) <superm1@xxxxxxxxxx>
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")
Signed-off-by: Lizhi Hou <lizhi.hou@xxxxxxx>
---
drivers/accel/amdxdna/amdxdna_pci_drv.c | 1 +
1 file changed, 1 insertion(+)
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;
}