linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] powerpc/configs: enable RTC class support
@ 2015-07-03  5:11 Vaibhav Jain
  2015-07-03  6:59 ` [RESEND] " Michael Ellerman
  2015-08-19 23:14 ` Michael Ellerman
  0 siblings, 2 replies; 4+ messages in thread
From: Vaibhav Jain @ 2015-07-03  5:11 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: benh, Michael Ellerman, Neelesh Gupta, Vaibhav Jain

A working rtc kernel driver is needed so that hwclock can synchronize
system clock to rtc during shutdown/boot. We already have a powernv
platform rtc driver located at drivers/rtc/rtc-opal.c. However it depends
on CONFIG_RTC_CLASS which is disabled by default. Hence the driver isn't
enabled and not compiled for the powernv kernel.

We fix this by enabling rtc class support in pseries defconfig which
enables this driver and compiles it into the pseries kernel. In case
CONFIG_PPC_POWERNV is not enabled we fallback to 'Generic RTC support'
driver which emulates the legacy 'PC RTC driver'.

Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
---
 arch/powerpc/configs/pseries_defconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig
index 0d9efce..2404271e 100644
--- a/arch/powerpc/configs/pseries_defconfig
+++ b/arch/powerpc/configs/pseries_defconfig
@@ -190,7 +190,8 @@ CONFIG_HVC_RTAS=y
 CONFIG_HVCS=m
 CONFIG_VIRTIO_CONSOLE=m
 CONFIG_IBM_BSR=m
-CONFIG_GEN_RTC=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_GENERIC=y
 CONFIG_RAW_DRIVER=y
 CONFIG_MAX_RAW_DEVS=1024
 CONFIG_FB=y
-- 
2.2.1

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

* Re: [RESEND] powerpc/configs: enable RTC class support
  2015-07-03  5:11 [RESEND PATCH] powerpc/configs: enable RTC class support Vaibhav Jain
@ 2015-07-03  6:59 ` Michael Ellerman
  2015-07-06  7:27   ` Vaibhav
  2015-08-19 23:14 ` Michael Ellerman
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Ellerman @ 2015-07-03  6:59 UTC (permalink / raw)
  To: Vaibhav Jain, linuxppc-dev; +Cc: Neelesh Gupta, Vaibhav Jain

On Fri, 2015-03-07 at 05:11:20 UTC, Vaibhav Jain wrote:
> A working rtc kernel driver is needed so that hwclock can synchronize
> system clock to rtc during shutdown/boot. We already have a powernv
> platform rtc driver located at drivers/rtc/rtc-opal.c. However it depends
> on CONFIG_RTC_CLASS which is disabled by default. Hence the driver isn't
> enabled and not compiled for the powernv kernel.
> 
> We fix this by enabling rtc class support in pseries defconfig which
> enables this driver and compiles it into the pseries kernel. In case
> CONFIG_PPC_POWERNV is not enabled we fallback to 'Generic RTC support'
> driver which emulates the legacy 'PC RTC driver'.

You still haven't told me what happens on a pseries machine when this is
applied.

cheers

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

* Re: [RESEND] powerpc/configs: enable RTC class support
  2015-07-03  6:59 ` [RESEND] " Michael Ellerman
@ 2015-07-06  7:27   ` Vaibhav
  0 siblings, 0 replies; 4+ messages in thread
From: Vaibhav @ 2015-07-06  7:27 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, Neelesh Gupta

On Fri, 2015-07-03 at 16:59 +1000, Michael Ellerman wrote:
> You still haven't told me what happens on a pseries machine when this
is
> applied.

Was finally able to get my hand over a pseries guest lpar today so
dumping the results below. I have aggregated results for each
configuration namely host & guest version; with each with/without the
patch. So in all results for 4 different configurations.

-------------------------
*host-kernel/without patch
-------------------------

Without the patch the hwclock fails with an error message:

[root@tul169p1 ~]# hwclock
hwclock: Timed out waiting for time change.
hwclock: The Hardware Clock registers contain values that are either
invalid (e.g. 50th day of month) or beyond the range we can handle (e.g.
Year 2095).

Debug message of hwclock reveal that hwclock cannot detect any tick in
the RTC clock. This is due to older genrtc driver being used instead of
newer rtc-opal driver.

-------------------------
*host-kernel/with patch
-------------------------

The patch enables the rtc-opal driver by enabling CONFIG_RTC_CLASS. So
the hwclock starts working. Below is the command log:

[root@tul169p1 ~]# hwclock -r
Fri 03 Jul 2015 03:54:31 AM CDT  -0.876949 seconds

--------------------------
*guest-kernel/without patch
---------------------------
Without the patch hwclock still works but uses the legacy generic-rtc.
Below is the output indicating that:

linux-3bot:/ # hwclock -r
Sun Jul  5 21:19:51 2015  -0.885070 seconds

linux-3bot:/ # ls /dev/class/rtc
ls: cannot access /dev/class/rtc: No such file or directory

--------------------------
*guest-kernel/with patch
---------------------------
With the patch, which enables the new rtc_class framework, the legacy
behavior is still used preserved. Below is the output indicating that:
linux-3bot:~ # hwclock -r
Sun Jul  5 21:36:53 2015  -0.704169 seconds

linux-3bot:~ # ls /sys/class/rtc
rtc0

~Vaibhav

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

* Re: [RESEND] powerpc/configs: enable RTC class support
  2015-07-03  5:11 [RESEND PATCH] powerpc/configs: enable RTC class support Vaibhav Jain
  2015-07-03  6:59 ` [RESEND] " Michael Ellerman
@ 2015-08-19 23:14 ` Michael Ellerman
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2015-08-19 23:14 UTC (permalink / raw)
  To: Vaibhav Jain, linuxppc-dev; +Cc: Neelesh Gupta, Vaibhav Jain

On Fri, 2015-03-07 at 05:11:20 UTC, Vaibhav Jain wrote:
> A working rtc kernel driver is needed so that hwclock can synchronize
> system clock to rtc during shutdown/boot. We already have a powernv
> platform rtc driver located at drivers/rtc/rtc-opal.c. However it depends
> on CONFIG_RTC_CLASS which is disabled by default. Hence the driver isn't
> enabled and not compiled for the powernv kernel.
> 
> We fix this by enabling rtc class support in pseries defconfig which
> enables this driver and compiles it into the pseries kernel. In case
> CONFIG_PPC_POWERNV is not enabled we fallback to 'Generic RTC support'
> driver which emulates the legacy 'PC RTC driver'.
> 
> Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/e0ad784b65a64a617179

cheers

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

end of thread, other threads:[~2015-08-19 23:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-03  5:11 [RESEND PATCH] powerpc/configs: enable RTC class support Vaibhav Jain
2015-07-03  6:59 ` [RESEND] " Michael Ellerman
2015-07-06  7:27   ` Vaibhav
2015-08-19 23:14 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).