]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ACPI / PAD: don't register acpi_pad driver if running as Xen dom0
authorJuergen Gross <jgross@suse.com>
Wed, 12 Oct 2016 11:11:45 +0000 (13:11 +0200)
committerJack Vogel <jack.vogel@oracle.com>
Thu, 5 Apr 2018 21:20:56 +0000 (14:20 -0700)
When running as Xen dom0 a special processor_aggregator driver is
needed.  Don't register the standard driver in this case.

Without that check an error message:

"Error: Driver 'processor_aggregator' is already registered,
aborting..."

will be displayed.

Signed-off-by: Juergen Gross <jgross@suse.com>
[ rjw: Minor fixups ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit e311404f7925f6879817ebf471651c0bb5935604)
Orabug: 27796473
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Tested-by: Sriharsha NS <sriharsha.ns@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/acpi/acpi_pad.c

index 6bc9cbc01ad6a3f20c27740ebbf1a919e7c74d0d..eb5d44a7edf233e354eb6c537c42697de12b5908 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/slab.h>
 #include <linux/acpi.h>
 #include <asm/mwait.h>
+#include <xen/xen.h>
 
 #define ACPI_PROCESSOR_AGGREGATOR_CLASS        "acpi_pad"
 #define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
@@ -483,6 +484,10 @@ static struct acpi_driver acpi_pad_driver = {
 
 static int __init acpi_pad_init(void)
 {
+       /* Xen ACPI PAD is used when running as Xen Dom0. */
+       if (xen_initial_domain())
+               return -ENODEV;
+
        power_saving_mwait_init();
        if (power_saving_mwait_eax == 0)
                return -EINVAL;