All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86, olpc: Indicate that legacy PC platform should not register RTC
@ 2018-10-04 16:08 Lubomir Rintel
  2018-10-05 10:45 ` [tip:x86/olpc] x86/olpc: Indicate that legacy PC XO-1 " tip-bot for Lubomir Rintel
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Lubomir Rintel @ 2018-10-04 16:08 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin, x86
  Cc: linux-kernel, Lubomir Rintel

On OLPC XO-1 we're discovering the RTC 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:
   dump_stack+0x16/0x18
   sysfs_warn_dup+0x46/0x58
   sysfs_create_dir_ns+0x76/0x9b
   kobject_add_internal+0xed/0x209
   ? __schedule+0x3fa/0x447
   kobject_add+0x5b/0x66
   device_add+0x298/0x535
   ? insert_resource_conflict+0x2a/0x3e
   platform_device_add+0x14d/0x192
   ? io_delay_init+0x19/0x19
   platform_device_register+0x1c/0x1f
   add_rtc_cmos+0x16/0x31
   do_one_initcall+0x78/0x14a
   ? do_early_param+0x75/0x75
   kernel_init_freeable+0x152/0x1e0
   ? rest_init+0xa2/0xa2
   kernel_init+0x8/0xd5
   ret_from_fork+0x2e/0x38
  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>
---
 arch/x86/platform/olpc/olpc-xo1-rtc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/platform/olpc/olpc-xo1-rtc.c b/arch/x86/platform/olpc/olpc-xo1-rtc.c
index a2b4efddd61a..8e7ddd7e313a 100644
--- a/arch/x86/platform/olpc/olpc-xo1-rtc.c
+++ b/arch/x86/platform/olpc/olpc-xo1-rtc.c
@@ -16,6 +16,7 @@
 
 #include <asm/msr.h>
 #include <asm/olpc.h>
+#include <asm/x86_init.h>
 
 static void rtc_wake_on(struct device *dev)
 {
@@ -75,6 +76,8 @@ static int __init xo1_rtc_init(void)
 	if (r)
 		return r;
 
+	x86_platform.legacy.rtc = 0;
+
 	device_init_wakeup(&xo1_rtc_device.dev, 1);
 	return 0;
 }
-- 
2.19.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip:x86/olpc] x86/olpc: Indicate that legacy PC XO-1 platform should not register RTC
  2018-10-04 16:08 [PATCH] x86, olpc: Indicate that legacy PC platform should not register RTC Lubomir Rintel
@ 2018-10-05 10:45 ` tip-bot for Lubomir Rintel
  2018-10-05 13:17 ` [PATCH] x86/olpc: Fix build error with CONFIG_MFD_CS5535=m Borislav Petkov
  2018-11-04 11:29 ` [PATCH] x86, olpc: Indicate that legacy PC platform should not register RTC Pavel Machek
  2 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Lubomir Rintel @ 2018-10-05 10:45 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, x86, lkundrak, bp, linux-kernel, mingo, mingo, tglx

Commit-ID:  d92116b800fb79a72ad26121f5011f6aa3ad94c2
Gitweb:     https://git.kernel.org/tip/d92116b800fb79a72ad26121f5011f6aa3ad94c2
Author:     Lubomir Rintel <lkundrak@v3.sk>
AuthorDate: Thu, 4 Oct 2018 18:08:08 +0200
Committer:  Borislav Petkov <bp@suse.de>
CommitDate: Fri, 5 Oct 2018 12:29:20 +0200

x86/olpc: Indicate that legacy PC XO-1 platform should not register RTC

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:
   dump_stack+0x16/0x18
   sysfs_warn_dup+0x46/0x58
   sysfs_create_dir_ns+0x76/0x9b
   kobject_add_internal+0xed/0x209
   ? __schedule+0x3fa/0x447
   kobject_add+0x5b/0x66
   device_add+0x298/0x535
   ? insert_resource_conflict+0x2a/0x3e
   platform_device_add+0x14d/0x192
   ? io_delay_init+0x19/0x19
   platform_device_register+0x1c/0x1f
   add_rtc_cmos+0x16/0x31
   do_one_initcall+0x78/0x14a
   ? do_early_param+0x75/0x75
   kernel_init_freeable+0x152/0x1e0
   ? rest_init+0xa2/0xa2
   kernel_init+0x8/0xd5
   ret_from_fork+0x2e/0x38
  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
---
 arch/x86/platform/olpc/olpc-xo1-rtc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/platform/olpc/olpc-xo1-rtc.c b/arch/x86/platform/olpc/olpc-xo1-rtc.c
index a2b4efddd61a..8e7ddd7e313a 100644
--- a/arch/x86/platform/olpc/olpc-xo1-rtc.c
+++ b/arch/x86/platform/olpc/olpc-xo1-rtc.c
@@ -16,6 +16,7 @@
 
 #include <asm/msr.h>
 #include <asm/olpc.h>
+#include <asm/x86_init.h>
 
 static void rtc_wake_on(struct device *dev)
 {
@@ -75,6 +76,8 @@ static int __init xo1_rtc_init(void)
 	if (r)
 		return r;
 
+	x86_platform.legacy.rtc = 0;
+
 	device_init_wakeup(&xo1_rtc_device.dev, 1);
 	return 0;
 }

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] x86/olpc: Fix build error with CONFIG_MFD_CS5535=m
  2018-10-04 16:08 [PATCH] x86, olpc: Indicate that legacy PC platform should not register RTC Lubomir Rintel
  2018-10-05 10:45 ` [tip:x86/olpc] x86/olpc: Indicate that legacy PC XO-1 " tip-bot for Lubomir Rintel
@ 2018-10-05 13:17 ` Borislav Petkov
  2018-10-06 18:45   ` [tip:x86/platform] " tip-bot for Borislav Petkov
  2018-11-04 11:29 ` [PATCH] x86, olpc: Indicate that legacy PC platform should not register RTC Pavel Machek
  2 siblings, 1 reply; 5+ messages in thread
From: Borislav Petkov @ 2018-10-05 13:17 UTC (permalink / raw)
  To: Lubomir Rintel
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel

On Thu, Oct 04, 2018 at 06:08:08PM +0200, Lubomir Rintel wrote:
> On OLPC XO-1 we're discovering the RTC 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:

Btw, a build fix ontop:

---
From: Borislav Petkov <bp@suse.de>
Date: Fri, 5 Oct 2018 15:13:07 +0200

When building a 32-bit config which has the above MFD item as module
but OLPC_XO1_PM is enabled =y - which is bool, btw - the kernel fails
building with:

  ld: arch/x86/platform/olpc/olpc-xo1-pm.o: in function `xo1_pm_remove':
  /home/boris/kernel/linux/arch/x86/platform/olpc/olpc-xo1-pm.c:159: undefined reference to `mfd_cell_disable'
  ld: arch/x86/platform/olpc/olpc-xo1-pm.o: in function `xo1_pm_probe':
  /home/boris/kernel/linux/arch/x86/platform/olpc/olpc-xo1-pm.c:133: undefined reference to `mfd_cell_enable'
  make: *** [Makefile:1030: vmlinux] Error 1

Force MFD_CS5535 to y if OLPC_XO1_PM is enabled.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Lubomir Rintel <lkundrak@v3.sk>
Cc: x86@kernel.org
---
 arch/x86/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 1a0be022f91d..285b5d6a5ea5 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2742,8 +2742,7 @@ config OLPC
 
 config OLPC_XO1_PM
 	bool "OLPC XO-1 Power Management"
-	depends on OLPC && MFD_CS5535 && PM_SLEEP
-	select MFD_CORE
+	depends on OLPC && MFD_CS5535=y && PM_SLEEP
 	---help---
 	  Add support for poweroff and suspend of the OLPC XO-1 laptop.
 
-- 
2.19.0.271.gfe8321ec057f

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip:x86/platform] x86/olpc: Fix build error with CONFIG_MFD_CS5535=m
  2018-10-05 13:17 ` [PATCH] x86/olpc: Fix build error with CONFIG_MFD_CS5535=m Borislav Petkov
@ 2018-10-06 18:45   ` tip-bot for Borislav Petkov
  0 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Borislav Petkov @ 2018-10-06 18:45 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: mingo, bp, linux-kernel, hpa, tglx, lkundrak

Commit-ID:  fa112cf1e8bc693d5a666b1c479a2859c8b6e0f1
Gitweb:     https://git.kernel.org/tip/fa112cf1e8bc693d5a666b1c479a2859c8b6e0f1
Author:     Borislav Petkov <bp@suse.de>
AuthorDate: Fri, 5 Oct 2018 15:13:07 +0200
Committer:  Borislav Petkov <bp@suse.de>
CommitDate: Sat, 6 Oct 2018 20:40:43 +0200

x86/olpc: Fix build error with CONFIG_MFD_CS5535=m

When building a 32-bit config which has the above MFD item as module
but OLPC_XO1_PM is enabled =y - which is bool, btw - the kernel fails
building with:

  ld: arch/x86/platform/olpc/olpc-xo1-pm.o: in function `xo1_pm_remove':
  /home/boris/kernel/linux/arch/x86/platform/olpc/olpc-xo1-pm.c:159: undefined reference to `mfd_cell_disable'
  ld: arch/x86/platform/olpc/olpc-xo1-pm.o: in function `xo1_pm_probe':
  /home/boris/kernel/linux/arch/x86/platform/olpc/olpc-xo1-pm.c:133: undefined reference to `mfd_cell_enable'
  make: *** [Makefile:1030: vmlinux] Error 1

Force MFD_CS5535 to y if OLPC_XO1_PM is enabled.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Lubomir Rintel <lkundrak@v3.sk>
Cc: x86@kernel.org
Link: http://lkml.kernel.org/r/20181005131750.GA5366@zn.tnic
---
 arch/x86/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 1a0be022f91d..285b5d6a5ea5 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2742,8 +2742,7 @@ config OLPC
 
 config OLPC_XO1_PM
 	bool "OLPC XO-1 Power Management"
-	depends on OLPC && MFD_CS5535 && PM_SLEEP
-	select MFD_CORE
+	depends on OLPC && MFD_CS5535=y && PM_SLEEP
 	---help---
 	  Add support for poweroff and suspend of the OLPC XO-1 laptop.
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86, olpc: Indicate that legacy PC platform should not register RTC
  2018-10-04 16:08 [PATCH] x86, olpc: Indicate that legacy PC platform should not register RTC Lubomir Rintel
  2018-10-05 10:45 ` [tip:x86/olpc] x86/olpc: Indicate that legacy PC XO-1 " tip-bot for Lubomir Rintel
  2018-10-05 13:17 ` [PATCH] x86/olpc: Fix build error with CONFIG_MFD_CS5535=m Borislav Petkov
@ 2018-11-04 11:29 ` Pavel Machek
  2 siblings, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2018-11-04 11:29 UTC (permalink / raw)
  To: Lubomir Rintel
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin,
	x86, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1502 bytes --]

On Thu 2018-10-04 18:08:08, Lubomir Rintel wrote:
> On OLPC XO-1 we're discovering the RTC 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:
>    dump_stack+0x16/0x18
>    sysfs_warn_dup+0x46/0x58
>    sysfs_create_dir_ns+0x76/0x9b
>    kobject_add_internal+0xed/0x209
>    ? __schedule+0x3fa/0x447
>    kobject_add+0x5b/0x66
>    device_add+0x298/0x535
>    ? insert_resource_conflict+0x2a/0x3e
>    platform_device_add+0x14d/0x192
>    ? io_delay_init+0x19/0x19
>    platform_device_register+0x1c/0x1f
>    add_rtc_cmos+0x16/0x31
>    do_one_initcall+0x78/0x14a
>    ? do_early_param+0x75/0x75
>    kernel_init_freeable+0x152/0x1e0
>    ? rest_init+0xa2/0xa2
>    kernel_init+0x8/0xd5
>    ret_from_fork+0x2e/0x38
>   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>

Acked-by: Pavel Machek <pavel@ucw.cz>


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-11-04 11:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-04 16:08 [PATCH] x86, olpc: Indicate that legacy PC platform should not register RTC Lubomir Rintel
2018-10-05 10:45 ` [tip:x86/olpc] x86/olpc: Indicate that legacy PC XO-1 " tip-bot for Lubomir Rintel
2018-10-05 13:17 ` [PATCH] x86/olpc: Fix build error with CONFIG_MFD_CS5535=m Borislav Petkov
2018-10-06 18:45   ` [tip:x86/platform] " tip-bot for Borislav Petkov
2018-11-04 11:29 ` [PATCH] x86, olpc: Indicate that legacy PC platform should not register RTC Pavel Machek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.