diff --git a/drivers/accel/amdxdna/amdxdna_pci_drv.c b/drivers/accel/amdxdna/amdxdna_pci_drv.c index c677293c1ae7..1f066ed8d236 100644 --- a/drivers/accel/amdxdna/amdxdna_pci_drv.c +++ b/drivers/accel/amdxdna/amdxdna_pci_drv.c @@ -120,8 +120,14 @@ static int amdxdna_drm_open(struct drm_device *ddev, struct drm_file *filp) if (!amdxdna_iova_on(xdna)) { /* No need to fail open since user may use pa + carveout later. */ - if (amdxdna_sva_init(client)) + if (amdxdna_sva_init(client)) { XDNA_WARN(xdna, "PASID not available for pid %d", client->pid); + if (!amdxdna_use_carveout(xdna)) { + XDNA_ERR(xdna, "PASID unavailable and carveout not configured"); + kfree(client); + return -EINVAL; + } + } } mmgrab(client->mm); init_srcu_struct(&client->hwctx_srcu);