Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1458873 > unrolled thread

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

Started byVille Syrjälä <ville.syrjala@linux.intel.com>
First post2016-08-09 18:00 +0200
Last post2016-08-09 19:00 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  rtc regression [463a86304cae ("char/genrtc: x86: remove remnants of  asm/rtc.h")] Ville Syrjälä <ville.syrjala@linux.intel.com> - 2016-08-09 18:00 +0200
    Re: rtc regression [463a86304cae ("char/genrtc: x86: remove remnants of asm/rtc.h")] Arnd Bergmann <arnd@arndb.de> - 2016-08-09 18:20 +0200
      Re: rtc regression [463a86304cae ("char/genrtc: x86: remove remnants  of asm/rtc.h")] Ville Syrjälä <ville.syrjala@linux.intel.com> - 2016-08-09 19:00 +0200

#1458873 — rtc regression [463a86304cae ("char/genrtc: x86: remove remnants of asm/rtc.h")]

FromVille Syrjälä <ville.syrjala@linux.intel.com>
Date2016-08-09 18:00 +0200
Subjectrtc regression [463a86304cae ("char/genrtc: x86: remove remnants of asm/rtc.h")]
Message-ID<s4hBE-16y-11@gated-at.bofh.it>
Hi,

commit 463a86304cae ("char/genrtc: x86: remove remnants of asm/rtc.h")
broke rtc for me. Neither hwclock or rtcwake work anymore. This is just
a very standard x86-64 IVB box, and it was reported that machines in
our i915 test farm are having rtc related problems as well.

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

463a86304cae^ gets me back to working condition:
 open("/dev/rtc", O_RDONLY)              = 3
 ioctl(3, PHN_SET_REGS or RTC_UIE_ON, 0) = 0
 select(4, [3], NULL, NULL, {10, 0})     = 1 (in [3], left {9, 530998})
 ioctl(3, PHN_NOT_OH or RTC_UIE_OFF, 0)  = 0
 ioctl(3, RTC_RD_TIME, {tm_sec=20, tm_min=17, tm_hour=15, tm_mday=9, tm_mon=7, tm_year=116, ...}) = 0
 close(3)                                = 0

-- 
Ville Syrjälä
Intel OTC

[toc] | [next] | [standalone]


#1458905 — Re: rtc regression [463a86304cae ("char/genrtc: x86: remove remnants of asm/rtc.h")]

FromArnd Bergmann <arnd@arndb.de>
Date2016-08-09 18:20 +0200
SubjectRe: rtc regression [463a86304cae ("char/genrtc: x86: remove remnants of asm/rtc.h")]
Message-ID<s4hV0-1tf-27@gated-at.bofh.it>
In reply to#1458873
On Tuesday, August 9, 2016 6:56:49 PM CEST Ville Syrjälä wrote:
> Hi,
> 
> commit 463a86304cae ("char/genrtc: x86: remove remnants of asm/rtc.h")
> broke rtc for me. Neither hwclock or rtcwake work anymore. This is just
> a very standard x86-64 IVB box, and it was reported that machines in
> our i915 test farm are having rtc related problems as well.
> 
> 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
> 
> 463a86304cae^ gets me back to working condition:
>  open("/dev/rtc", O_RDONLY)              = 3
>  ioctl(3, PHN_SET_REGS or RTC_UIE_ON, 0) = 0
>  select(4, [3], NULL, NULL, {10, 0})     = 1 (in [3], left {9, 530998})
>  ioctl(3, PHN_NOT_OH or RTC_UIE_OFF, 0)  = 0
>  ioctl(3, RTC_RD_TIME, {tm_sec=20, tm_min=17, tm_hour=15, tm_mday=9, tm_mon=7, tm_year=116, ...}) = 0
>  close(3)                                = 0

That commit was supposed to have no effect on the binary, but it
seems I had a typo in one file. Can you try this patch on top
of mainline?

	Arnd

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

[toc] | [prev] | [next] | [standalone]


#1458982 — Re: rtc regression [463a86304cae ("char/genrtc: x86: remove remnants of asm/rtc.h")]

FromVille Syrjälä <ville.syrjala@linux.intel.com>
Date2016-08-09 19:00 +0200
SubjectRe: rtc regression [463a86304cae ("char/genrtc: x86: remove remnants of asm/rtc.h")]
Message-ID<s4ixI-1HG-33@gated-at.bofh.it>
In reply to#1458905
On Tue, Aug 09, 2016 at 06:09:27PM +0200, Arnd Bergmann wrote:
> On Tuesday, August 9, 2016 6:56:49 PM CEST Ville Syrjälä wrote:
> > Hi,
> > 
> > commit 463a86304cae ("char/genrtc: x86: remove remnants of asm/rtc.h")
> > broke rtc for me. Neither hwclock or rtcwake work anymore. This is just
> > a very standard x86-64 IVB box, and it was reported that machines in
> > our i915 test farm are having rtc related problems as well.
> > 
> > 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
> > 
> > 463a86304cae^ gets me back to working condition:
> >  open("/dev/rtc", O_RDONLY)              = 3
> >  ioctl(3, PHN_SET_REGS or RTC_UIE_ON, 0) = 0
> >  select(4, [3], NULL, NULL, {10, 0})     = 1 (in [3], left {9, 530998})
> >  ioctl(3, PHN_NOT_OH or RTC_UIE_OFF, 0)  = 0
> >  ioctl(3, RTC_RD_TIME, {tm_sec=20, tm_min=17, tm_hour=15, tm_mday=9, tm_mon=7, tm_year=116, ...}) = 0
> >  close(3)                                = 0
> 
> That commit was supposed to have no effect on the binary, but it
> seems I had a typo in one file. Can you try this patch on top
> of mainline?
> 
> 	Arnd
> 
> 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);

Heh. Pretty obvious once you see it :)

Works for me.
Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  
>  	if (hpet_rtc_flags & RTC_UIE &&
>  	    curr_time.tm_sec != hpet_prev_update_sec) {

-- 
Ville Syrjälä
Intel OTC

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web