x86/olpc: Indicate that legacy PC XO-1 platform should not register RTC
authorLubomir Rintel <lkundrak@v3.sk>
Thu, 4 Oct 2018 16:08:08 +0000 (18:08 +0200)
committerBorislav Petkov <bp@suse.de>
Fri, 5 Oct 2018 10:29:20 +0000 (12:29 +0200)
On OLPC XO-1, the RTC is discovered via device tree from the arch
initcall. Don't let the PC platform register another one from its device
initcall, it's not going to work:

  sysfs: cannot create duplicate filename '/devices/platform/rtc_cmos'
  CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.0-rc6 #12
  Hardware name: OLPC XO/XO, BIOS OLPC Ver 1.00.01 06/11/2014
  Call Trace:
   ? __schedule+0x3fa/0x447
   ? insert_resource_conflict+0x2a/0x3e
   ? io_delay_init+0x19/0x19
   ? do_early_param+0x75/0x75
   ? rest_init+0xa2/0xa2
  kobject_add_internal failed for rtc_cmos with -EEXIST, don't try to
    register things with the same name in the same directory.
  platform rtc_cmos: registered platform RTC device (no PNP device found)

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Ingo Molnar <mingo@redhat.com>
CC: x86-ml <x86@kernel.org>
Link: http://lkml.kernel.org/r/20181004160808.307738-1-lkundrak@v3.sk

index a2b4efddd61a58de2ec0fcf4fdc47f0a4dd45ebb..8e7ddd7e313a40c4d06624df085341fc3fcf0cee 100644 (file)
@@ -16,6 +16,7 @@
 #include <asm/msr.h>
 #include <asm/olpc.h>
 #include <asm/msr.h>
 #include <asm/olpc.h>
+#include <asm/x86_init.h>
 static void rtc_wake_on(struct device *dev)
 static void rtc_wake_on(struct device *dev)
@@ -75,6 +76,8 @@ static int __init xo1_rtc_init(void)
        if (r)
                return r;
        if (r)
                return r;
+       x86_platform.legacy.rtc = 0;
        device_init_wakeup(&xo1_rtc_device.dev, 1);
        return 0;
        device_init_wakeup(&xo1_rtc_device.dev, 1);
        return 0;