linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/hpet: fix typo from rtc cleanup
@ 2016-08-09 19:54 Arnd Bergmann
  2016-08-10  8:22 ` Jarkko Nikula
  2016-08-10 18:08 ` [tip:timers/urgent] x86/hpet: Fix /dev/rtc breakage caused by RTC cleanup tip-bot for Arnd Bergmann
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2016-08-09 19:54 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86
  Cc: Ville Syrjälä,
	Geert Uytterhoeven, Alexandre Belloni, Alessandro Zummo,
	rtc-linux, Arnd Bergmann, Borislav Petkov, linux-kernel

Ville Syrjälä reports "The first time I run hwclock after rebooting
I get this:

 open("/dev/rtc", O_RDONLY)              = 3
 ioctl(3, PHN_SET_REGS or RTC_UIE_ON, 0) = 0
 select(4, [3], NULL, NULL, {10, 0})     = 0 (Timeout)
 ioctl(3, PHN_NOT_OH or RTC_UIE_OFF, 0)  = 0
 close(3)                                = 0

On all subsequent runs I get this:
 open("/dev/rtc", O_RDONLY)              = 3
 ioctl(3, PHN_SET_REGS or RTC_UIE_ON, 0) = -1 EINVAL (Invalid argument)
 ioctl(3, RTC_RD_TIME, 0x7ffd76b3ae70)   = -1 EINVAL (Invalid argument)
 close(3)                                = 0"

This was caused by a stupid typo in a patch that should have been
a simple rename to move around contents of a header file, but
accidentally wrote zeroes into the rtc rather than reading from
it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Fixes: 463a86304cae ("char/genrtc: x86: remove remnants of asm/rtc.h")
---
 arch/x86/kernel/hpet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index ed16e58658a4..c6dfd801df97 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -1242,7 +1242,7 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
 	memset(&curr_time, 0, sizeof(struct rtc_time));
 
 	if (hpet_rtc_flags & (RTC_UIE | RTC_AIE))
-		mc146818_set_time(&curr_time);
+		mc146818_get_time(&curr_time);
 
 	if (hpet_rtc_flags & RTC_UIE &&
 	    curr_time.tm_sec != hpet_prev_update_sec) {
-- 
2.9.0

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

* Re: [PATCH] x86/hpet: fix typo from rtc cleanup
  2016-08-09 19:54 [PATCH] x86/hpet: fix typo from rtc cleanup Arnd Bergmann
@ 2016-08-10  8:22 ` Jarkko Nikula
  2016-08-10 18:08 ` [tip:timers/urgent] x86/hpet: Fix /dev/rtc breakage caused by RTC cleanup tip-bot for Arnd Bergmann
  1 sibling, 0 replies; 3+ messages in thread
From: Jarkko Nikula @ 2016-08-10  8:22 UTC (permalink / raw)
  To: Arnd Bergmann, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86
  Cc: Ville Syrjälä,
	Geert Uytterhoeven, Alexandre Belloni, Alessandro Zummo,
	rtc-linux, Borislav Petkov, linux-kernel

Hi

On 08/09/2016 10:54 PM, Arnd Bergmann wrote:
> Ville Syrjälä reports "The first time I run hwclock after rebooting
> I get this:
>
>  open("/dev/rtc", O_RDONLY)              = 3
>  ioctl(3, PHN_SET_REGS or RTC_UIE_ON, 0) = 0
>  select(4, [3], NULL, NULL, {10, 0})     = 0 (Timeout)
>  ioctl(3, PHN_NOT_OH or RTC_UIE_OFF, 0)  = 0
>  close(3)                                = 0
>
> On all subsequent runs I get this:
>  open("/dev/rtc", O_RDONLY)              = 3
>  ioctl(3, PHN_SET_REGS or RTC_UIE_ON, 0) = -1 EINVAL (Invalid argument)
>  ioctl(3, RTC_RD_TIME, 0x7ffd76b3ae70)   = -1 EINVAL (Invalid argument)
>  close(3)                                = 0"
>
> This was caused by a stupid typo in a patch that should have been
> a simple rename to move around contents of a header file, but
> accidentally wrote zeroes into the rtc rather than reading from
> it.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Fixes: 463a86304cae ("char/genrtc: x86: remove remnants of asm/rtc.h")
> ---
>  arch/x86/kernel/hpet.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
I started seeing system reboots and lockups during kernel boot on a 
prototype HW this week using v4.8-rc1 and bisected to this same commit.

This patch fixes the issue.

Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>

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

* [tip:timers/urgent] x86/hpet: Fix /dev/rtc breakage caused by RTC cleanup
  2016-08-09 19:54 [PATCH] x86/hpet: fix typo from rtc cleanup Arnd Bergmann
  2016-08-10  8:22 ` Jarkko Nikula
@ 2016-08-10 18:08 ` tip-bot for Arnd Bergmann
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Arnd Bergmann @ 2016-08-10 18:08 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, geert, a.zummo, torvalds, ville.syrjala, hpa,
	alexandre.belloni, jarkko.nikula, linux-kernel, arnd, tglx, bp,
	peterz

Commit-ID:  22cc1ca3c5469cf17e149be232817b9223afa5e4
Gitweb:     http://git.kernel.org/tip/22cc1ca3c5469cf17e149be232817b9223afa5e4
Author:     Arnd Bergmann <arnd@arndb.de>
AuthorDate: Tue, 9 Aug 2016 21:54:53 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 10 Aug 2016 14:37:06 +0200

x86/hpet: Fix /dev/rtc breakage caused by RTC cleanup

Ville Syrjälä reports "The first time I run hwclock after rebooting
I get this:

 open("/dev/rtc", O_RDONLY)              = 3
 ioctl(3, PHN_SET_REGS or RTC_UIE_ON, 0) = 0
 select(4, [3], NULL, NULL, {10, 0})     = 0 (Timeout)
 ioctl(3, PHN_NOT_OH or RTC_UIE_OFF, 0)  = 0
 close(3)                                = 0

On all subsequent runs I get this:

 open("/dev/rtc", O_RDONLY)              = 3
 ioctl(3, PHN_SET_REGS or RTC_UIE_ON, 0) = -1 EINVAL (Invalid argument)
 ioctl(3, RTC_RD_TIME, 0x7ffd76b3ae70)   = -1 EINVAL (Invalid argument)
 close(3)                                = 0"

This was caused by a stupid typo in a patch that should have been
a simple rename to move around contents of a header file, but
accidentally wrote zeroes into the rtc rather than reading from
it:

  463a86304cae ("char/genrtc: x86: remove remnants of asm/rtc.h")

Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: rtc-linux@googlegroups.com
Fixes: 463a86304cae ("char/genrtc: x86: remove remnants of asm/rtc.h")
Link: http://lkml.kernel.org/r/20160809195528.1604312-1-arnd@arndb.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/hpet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index ed16e58..c6dfd80 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -1242,7 +1242,7 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
 	memset(&curr_time, 0, sizeof(struct rtc_time));
 
 	if (hpet_rtc_flags & (RTC_UIE | RTC_AIE))
-		mc146818_set_time(&curr_time);
+		mc146818_get_time(&curr_time);
 
 	if (hpet_rtc_flags & RTC_UIE &&
 	    curr_time.tm_sec != hpet_prev_update_sec) {

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

end of thread, other threads:[~2016-08-10 18:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-09 19:54 [PATCH] x86/hpet: fix typo from rtc cleanup Arnd Bergmann
2016-08-10  8:22 ` Jarkko Nikula
2016-08-10 18:08 ` [tip:timers/urgent] x86/hpet: Fix /dev/rtc breakage caused by RTC cleanup tip-bot for Arnd Bergmann

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).