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


Groups > linux.kernel > #1477238 > unrolled thread

Re: [PATCH V3 2/2] rtc/rtc-cmos: Initialize software counters before irq is registered

Started byThomas Gleixner <tglx@linutronix.de>
First post2016-09-06 12:10 +0200
Last post2016-09-06 12:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH V3 2/2] rtc/rtc-cmos: Initialize software counters before  irq is registered Thomas Gleixner <tglx@linutronix.de> - 2016-09-06 12:10 +0200
    Re: [PATCH V3 2/2] rtc/rtc-cmos: Initialize software counters before  irq is registered Pratyush Anand <panand@redhat.com> - 2016-09-06 12:50 +0200

#1477238 — Re: [PATCH V3 2/2] rtc/rtc-cmos: Initialize software counters before irq is registered

FromThomas Gleixner <tglx@linutronix.de>
Date2016-09-06 12:10 +0200
SubjectRe: [PATCH V3 2/2] rtc/rtc-cmos: Initialize software counters before irq is registered
Message-ID<selui-En-13@gated-at.bofh.it>
On Tue, 16 Aug 2016, Pratyush Anand wrote:

That's a lot of churn to fix that simple problem. The two liner below
should fix that as well, right?

Thanks,

	tglx

diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 43745cac0141..cb8dfc3ee012 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -707,6 +707,7 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
 		goto cleanup1;
 	}
 
+	hpet_rtc_timer_init();
 	if (is_valid_irq(rtc_irq)) {
 		irq_handler_t rtc_cmos_int_handler;
 
@@ -714,6 +715,7 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
 			rtc_cmos_int_handler = hpet_rtc_interrupt;
 			retval = hpet_register_irq_handler(cmos_interrupt);
 			if (retval) {
+				hpet_mask_rtc_irq_bit(RTC_IRQMASK);
 				dev_warn(dev, "hpet_register_irq_handler "
 						" failed in rtc_init().");
 				goto cleanup1;
@@ -729,7 +731,6 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
 			goto cleanup1;
 		}
 	}
-	hpet_rtc_timer_init();
 
 	/* export at least the first block of NVRAM */
 	nvram.size = address_space - NVRAM_OFFSET;

[toc] | [next] | [standalone]


#1477272

FromPratyush Anand <panand@redhat.com>
Date2016-09-06 12:50 +0200
Message-ID<sem6Z-SU-17@gated-at.bofh.it>
In reply to#1477238
Hi Thomas,

On 06/09/2016:11:58:08 AM, Thomas Gleixner wrote:
> On Tue, 16 Aug 2016, Pratyush Anand wrote:
> 
> That's a lot of churn to fix that simple problem. The two liner below
> should fix that as well, right?

Thanks a lot for your reply.

Yes, that should fix. I was n't sure if "setting HPET_TN_ENABLE before IRQ is
registered" would be a right step.
I can give it a try, however it is pretty obvious that these two liners should
be able to solve the issue. So, if this solution will not have any side effect
then, it is fine for me as well.

~Pratyush

> 
> Thanks,
> 
> 	tglx
> 
> diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
> index 43745cac0141..cb8dfc3ee012 100644
> --- a/drivers/rtc/rtc-cmos.c
> +++ b/drivers/rtc/rtc-cmos.c
> @@ -707,6 +707,7 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
>  		goto cleanup1;
>  	}
>  
> +	hpet_rtc_timer_init();
>  	if (is_valid_irq(rtc_irq)) {
>  		irq_handler_t rtc_cmos_int_handler;
>  
> @@ -714,6 +715,7 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
>  			rtc_cmos_int_handler = hpet_rtc_interrupt;
>  			retval = hpet_register_irq_handler(cmos_interrupt);
>  			if (retval) {
> +				hpet_mask_rtc_irq_bit(RTC_IRQMASK);
>  				dev_warn(dev, "hpet_register_irq_handler "
>  						" failed in rtc_init().");
>  				goto cleanup1;
> @@ -729,7 +731,6 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
>  			goto cleanup1;
>  		}
>  	}
> -	hpet_rtc_timer_init();
>  
>  	/* export at least the first block of NVRAM */
>  	nvram.size = address_space - NVRAM_OFFSET;
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web