Re: [PATCH V1] accel/amdxdna: Clear sva pointer after unbind

From: Lizhi Hou

Date: Wed Jun 10 2026 - 02:28:32 EST


Applied to drm-misc-next-fixes

On 6/9/26 15:44, Mario Limonciello wrote:


On 6/4/26 15:28, Lizhi Hou wrote:
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")
Signed-off-by: Lizhi Hou <lizhi.hou@xxxxxxx>
Reviewed-by: Mario Limonciello (AMD) <superm1@xxxxxxxxxx>
---
  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;
      }