mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 02:17:36 -04:00
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: 3cc5d7a595 ("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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user