iommu/amd: Add new init-state IOMMU_CMDLINE_DISABLED
authorJoerg Roedel <jroedel@suse.de>
Fri, 16 Jun 2017 14:09:56 +0000 (16:09 +0200)
committerJoerg Roedel <jroedel@suse.de>
Thu, 22 Jun 2017 10:54:20 +0000 (12:54 +0200)
This will be used when during initialization we detect that
the iommu should be disabled.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd_iommu_init.c

index 74f4eea6be775e98e717fcd9e446a47236d9ca22..df9ec85271f56b30ef7bb395dc185f349a74fc47 100644 (file)
@@ -237,6 +237,7 @@ enum iommu_init_state {
        IOMMU_INITIALIZED,
        IOMMU_NOT_FOUND,
        IOMMU_INIT_ERROR,
+       IOMMU_CMDLINE_DISABLED,
 };
 
 /* Early ioapic and hpet maps from kernel command line */
@@ -2452,6 +2453,7 @@ static int __init state_next(void)
                break;
        case IOMMU_NOT_FOUND:
        case IOMMU_INIT_ERROR:
+       case IOMMU_CMDLINE_DISABLED:
                /* Error states => do nothing */
                ret = -EINVAL;
                break;
@@ -2469,8 +2471,9 @@ static int __init iommu_go_to_state(enum iommu_init_state state)
 
        while (init_state != state) {
                ret = state_next();
-               if (init_state == IOMMU_NOT_FOUND ||
-                   init_state == IOMMU_INIT_ERROR)
+               if (init_state == IOMMU_NOT_FOUND         ||
+                   init_state == IOMMU_INIT_ERROR        ||
+                   init_state == IOMMU_CMDLINE_DISABLED)
                        break;
        }