From 24ce4e1826ecd9940512378a2cf298de063fc8a4 Mon Sep 17 00:00:00 2001 From: Oleksandr Tyshchenko Date: Sun, 9 Oct 2022 12:52:12 +0300 Subject: [PATCH] iommu/arm: Always return -ENODEV if !num_iommus in iommu_hardware_setup() Before current patch we only returned -ENODEV if deferred list was empty, otherwise we returned -EAGAIN which was treated by the upper layer as a reason to panic (see start_xen()). But even if the deferred list is not empty at this point, this likely means that either the required device is not present at all (has never showed up) or it is present but cannot be used by Xen (driver has returned -ENODEV explicitly). So always return -ENODEV if there are no initialized devices. Signed-off-by: Oleksandr Tyshchenko --- xen/drivers/passthrough/arm/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/arm/iommu.c b/xen/drivers/passthrough/arm/iommu.c index fc453180f0..58f594a238 100644 --- a/xen/drivers/passthrough/arm/iommu.c +++ b/xen/drivers/passthrough/arm/iommu.c @@ -85,7 +85,7 @@ int __init iommu_hardware_setup(void) /* Return immediately if there are no initialized devices. */ if ( !num_iommus ) - return list_empty(&deferred_probe_list) ? -ENODEV : -EAGAIN; + return -ENODEV; rc = 0; -- 2.25.1