On 5/20/26 17:35, Lizhi Hou wrote:
The AIE2 device firmware requires IOMMU on.

Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5319
Signed-off-by: Lizhi Hou <[email protected]>
---
  drivers/accel/amdxdna/aie2_pci.c | 5 +++++
  1 file changed, 5 insertions(+)

diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c
index c4d345d4c76b..22f66c7f534d 100644
--- a/drivers/accel/amdxdna/aie2_pci.c
+++ b/drivers/accel/amdxdna/aie2_pci.c
@@ -490,6 +490,11 @@ static int aie2_init(struct amdxdna_dev *xdna)
                return -EINVAL;
        }
+ if (!xdna->group) {
+               XDNA_ERR(xdna, "Running without IOMMU not supported");
+               return -EINVAL;
+       }
+
        ndev = drmm_kzalloc(&xdna->ddev, sizeof(*ndev), GFP_KERNEL);
        if (!ndev)
                return -ENOMEM;

I think it would be better to change the return for amdxdna_iommu_init().

This has a check that lets !xdna->group pass; which can be turned into an error code instead.

Reply via email to