qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] RTC polling mode broken
@ 2009-07-15 10:50 Bernhard Kauer
  2009-08-27 11:18 ` Bernhard Kauer
  0 siblings, 1 reply; 5+ messages in thread
From: Bernhard Kauer @ 2009-07-15 10:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: bochs-developers

The RTC emulation does not set the IRQ flags independent of the IRQ enable bits.

The original MC146818A datasheet from 1964 notes:
	"flag bits in Register C [...] are set independent of the
	state of the corresponding enable bits in Register B"
Similar sections can be found in newer documentation e.g. in rtc82885.

Qemu and Bochs set the IRQ flags only if they are enabled,
which breaks drivers polling on them.

The following patch corrects this for the update-ended-flag in Qemu only.
It currently does not fix the handling of the other flags.


Signed-off-by: Bernhard Kauer <kauer@tudos.org>


diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 2022548..2b040a7 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -421,9 +421,10 @@ static void rtc_update_second2(void *opaque)
     }
 
     /* update ended interrupt */
+    s->cmos_data[RTC_REG_C] |= REG_C_UF;
     if (s->cmos_data[RTC_REG_B] & REG_B_UIE) {
-        s->cmos_data[RTC_REG_C] |= 0x90;
-        rtc_irq_raise(s->irq);
+      s->cmos_data[RTC_REG_C] |= REG_C_IRQF;
+      rtc_irq_raise(s->irq);
     }
 
     /* clear update in progress bit */

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

* Re: [Qemu-devel] RTC polling mode broken
  2009-07-15 10:50 [Qemu-devel] RTC polling mode broken Bernhard Kauer
@ 2009-08-27 11:18 ` Bernhard Kauer
  2009-08-27 12:33   ` Gleb Natapov
  0 siblings, 1 reply; 5+ messages in thread
From: Bernhard Kauer @ 2009-08-27 11:18 UTC (permalink / raw)
  To: qemu-devel

Suppose I have some software that does not run with Qemu 
and I have done the following steps:

	1. found that it is bug in Qemu and not in my software
	2. produced a patch that fixed the problem for my test-case
	3. send the patch with an explanation to the mailinglist
	4. waited 6 weeks for comments or inclusion in Qemu

Now what should I do, to get the bug fixed?


Thanks,


	Bernhard




On Wed, Jul 15, 2009 at 12:50:43PM +0200, Bernhard Kauer wrote:
> The RTC emulation does not set the IRQ flags independent of the IRQ enable bits.
> 
> The original MC146818A datasheet from 1984 notes:
> 	"flag bits in Register C [...] are set independent of the
> 	state of the corresponding enable bits in Register B"
> Similar sections can be found in newer documentation e.g. in rtc82885.
> 
> Qemu and Bochs set the IRQ flags only if they are enabled,
> which breaks drivers polling on them.
> 
> The following patch corrects this for the update-ended-flag in Qemu only.
> It currently does not fix the handling of the other flags.
> 
> 
> Signed-off-by: Bernhard Kauer <kauer@tudos.org>
> 
> 
> diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
> index 2022548..2b040a7 100644
> --- a/hw/mc146818rtc.c
> +++ b/hw/mc146818rtc.c
> @@ -421,9 +421,10 @@ static void rtc_update_second2(void *opaque)
>      }
>  
>      /* update ended interrupt */
> +    s->cmos_data[RTC_REG_C] |= REG_C_UF;
>      if (s->cmos_data[RTC_REG_B] & REG_B_UIE) {
> -        s->cmos_data[RTC_REG_C] |= 0x90;
> -        rtc_irq_raise(s->irq);
> +      s->cmos_data[RTC_REG_C] |= REG_C_IRQF;
> +      rtc_irq_raise(s->irq);
>      }
>  
>      /* clear update in progress bit */

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

* Re: [Qemu-devel] RTC polling mode broken
  2009-08-27 11:18 ` Bernhard Kauer
@ 2009-08-27 12:33   ` Gleb Natapov
  2009-08-27 13:08     ` [Qemu-devel] [PATCH] " Bernhard Kauer
  0 siblings, 1 reply; 5+ messages in thread
From: Gleb Natapov @ 2009-08-27 12:33 UTC (permalink / raw)
  To: Bernhard Kauer; +Cc: qemu-devel

On Thu, Aug 27, 2009 at 01:18:03PM +0200, Bernhard Kauer wrote:
> Suppose I have some software that does not run with Qemu 
> and I have done the following steps:
> 
> 	1. found that it is bug in Qemu and not in my software
> 	2. produced a patch that fixed the problem for my test-case
> 	3. send the patch with an explanation to the mailinglist
> 	4. waited 6 weeks for comments or inclusion in Qemu
> 
> Now what should I do, to get the bug fixed?
> 
Resend the patch? (no need to what for 6 week to do that BTW)

> 
> Thanks,
> 
> 
> 	Bernhard
> 
> 
> 
> 
> On Wed, Jul 15, 2009 at 12:50:43PM +0200, Bernhard Kauer wrote:
> > The RTC emulation does not set the IRQ flags independent of the IRQ enable bits.
> > 
> > The original MC146818A datasheet from 1984 notes:
> > 	"flag bits in Register C [...] are set independent of the
> > 	state of the corresponding enable bits in Register B"
> > Similar sections can be found in newer documentation e.g. in rtc82885.
> > 
> > Qemu and Bochs set the IRQ flags only if they are enabled,
> > which breaks drivers polling on them.
> > 
> > The following patch corrects this for the update-ended-flag in Qemu only.
> > It currently does not fix the handling of the other flags.
> > 
> > 
> > Signed-off-by: Bernhard Kauer <kauer@tudos.org>
> > 
> > 
> > diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
> > index 2022548..2b040a7 100644
> > --- a/hw/mc146818rtc.c
> > +++ b/hw/mc146818rtc.c
> > @@ -421,9 +421,10 @@ static void rtc_update_second2(void *opaque)
> >      }
> >  
> >      /* update ended interrupt */
> > +    s->cmos_data[RTC_REG_C] |= REG_C_UF;
> >      if (s->cmos_data[RTC_REG_B] & REG_B_UIE) {
> > -        s->cmos_data[RTC_REG_C] |= 0x90;
> > -        rtc_irq_raise(s->irq);
> > +      s->cmos_data[RTC_REG_C] |= REG_C_IRQF;
> > +      rtc_irq_raise(s->irq);
> >      }
> >  
> >      /* clear update in progress bit */
> 
> 

--
			Gleb.

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

* [Qemu-devel] [PATCH] Re: RTC polling mode broken
  2009-08-27 12:33   ` Gleb Natapov
@ 2009-08-27 13:08     ` Bernhard Kauer
  2009-08-27 13:17       ` Gleb Natapov
  0 siblings, 1 reply; 5+ messages in thread
From: Bernhard Kauer @ 2009-08-27 13:08 UTC (permalink / raw)
  To: qemu-devel

On Thu, Aug 27, 2009 at 03:33:30PM +0300, Gleb Natapov wrote:
> On Thu, Aug 27, 2009 at 01:18:03PM +0200, Bernhard Kauer wrote:
> > Suppose I have some software that does not run with Qemu 
> > and I have done the following steps:
> > 
> > 	1. found that it is bug in Qemu and not in my software
> > 	2. produced a patch that fixed the problem for my test-case
> > 	3. send the patch with an explanation to the mailinglist
> > 	4. waited 6 weeks for comments or inclusion in Qemu
> > 
> > Now what should I do, to get the bug fixed?
> > 
> Resend the patch? (no need to what for 6 week to do that BTW)

How often?


	Bernhard



> > On Wed, Jul 15, 2009 at 12:50:43PM +0200, Bernhard Kauer wrote:
> > > The RTC emulation does not set the IRQ flags independent of the IRQ enable bits.
> > > 
> > > The original MC146818A datasheet from 1984 notes:
> > > 	"flag bits in Register C [...] are set independent of the
> > > 	state of the corresponding enable bits in Register B"
> > > Similar sections can be found in newer documentation e.g. in rtc82885.
> > > 
> > > Qemu and Bochs set the IRQ flags only if they are enabled,
> > > which breaks drivers polling on them.
> > > 
> > > The following patch corrects this for the update-ended-flag in Qemu only.
> > > It currently does not fix the handling of the other flags.
> > > 
> > > 
> > > Signed-off-by: Bernhard Kauer <kauer@tudos.org>
> > > 
> > > 
> > > diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
> > > index 2022548..2b040a7 100644
> > > --- a/hw/mc146818rtc.c
> > > +++ b/hw/mc146818rtc.c
> > > @@ -421,9 +421,10 @@ static void rtc_update_second2(void *opaque)
> > >      }
> > >  
> > >      /* update ended interrupt */
> > > +    s->cmos_data[RTC_REG_C] |= REG_C_UF;
> > >      if (s->cmos_data[RTC_REG_B] & REG_B_UIE) {
> > > -        s->cmos_data[RTC_REG_C] |= 0x90;
> > > -        rtc_irq_raise(s->irq);
> > > +      s->cmos_data[RTC_REG_C] |= REG_C_IRQF;
> > > +      rtc_irq_raise(s->irq);
> > >      }
> > >  
> > >      /* clear update in progress bit */
> > 

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

* Re: [Qemu-devel] [PATCH] Re: RTC polling mode broken
  2009-08-27 13:08     ` [Qemu-devel] [PATCH] " Bernhard Kauer
@ 2009-08-27 13:17       ` Gleb Natapov
  0 siblings, 0 replies; 5+ messages in thread
From: Gleb Natapov @ 2009-08-27 13:17 UTC (permalink / raw)
  To: Bernhard Kauer; +Cc: qemu-devel

On Thu, Aug 27, 2009 at 03:08:19PM +0200, Bernhard Kauer wrote:
> On Thu, Aug 27, 2009 at 03:33:30PM +0300, Gleb Natapov wrote:
> > On Thu, Aug 27, 2009 at 01:18:03PM +0200, Bernhard Kauer wrote:
> > > Suppose I have some software that does not run with Qemu 
> > > and I have done the following steps:
> > > 
> > > 	1. found that it is bug in Qemu and not in my software
> > > 	2. produced a patch that fixed the problem for my test-case
> > > 	3. send the patch with an explanation to the mailinglist
> > > 	4. waited 6 weeks for comments or inclusion in Qemu
> > > 
> > > Now what should I do, to get the bug fixed?
> > > 
> > Resend the patch? (no need to what for 6 week to do that BTW)
> 
> How often?
> 
> 
Once a week till maintainers notice :)

> 
> > > On Wed, Jul 15, 2009 at 12:50:43PM +0200, Bernhard Kauer wrote:
> > > > The RTC emulation does not set the IRQ flags independent of the IRQ enable bits.
> > > > 
> > > > The original MC146818A datasheet from 1984 notes:
> > > > 	"flag bits in Register C [...] are set independent of the
> > > > 	state of the corresponding enable bits in Register B"
> > > > Similar sections can be found in newer documentation e.g. in rtc82885.
> > > > 
> > > > Qemu and Bochs set the IRQ flags only if they are enabled,
> > > > which breaks drivers polling on them.
> > > > 
> > > > The following patch corrects this for the update-ended-flag in Qemu only.
> > > > It currently does not fix the handling of the other flags.
> > > > 
> > > > 
> > > > Signed-off-by: Bernhard Kauer <kauer@tudos.org>
> > > > 
> > > > 
> > > > diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
> > > > index 2022548..2b040a7 100644
> > > > --- a/hw/mc146818rtc.c
> > > > +++ b/hw/mc146818rtc.c
> > > > @@ -421,9 +421,10 @@ static void rtc_update_second2(void *opaque)
> > > >      }
> > > >  
> > > >      /* update ended interrupt */
> > > > +    s->cmos_data[RTC_REG_C] |= REG_C_UF;
> > > >      if (s->cmos_data[RTC_REG_B] & REG_B_UIE) {
> > > > -        s->cmos_data[RTC_REG_C] |= 0x90;
> > > > -        rtc_irq_raise(s->irq);
> > > > +      s->cmos_data[RTC_REG_C] |= REG_C_IRQF;
> > > > +      rtc_irq_raise(s->irq);
> > > >      }
> > > >  
> > > >      /* clear update in progress bit */
> > > 
> 

--
			Gleb.

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

end of thread, other threads:[~2009-08-27 13:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-15 10:50 [Qemu-devel] RTC polling mode broken Bernhard Kauer
2009-08-27 11:18 ` Bernhard Kauer
2009-08-27 12:33   ` Gleb Natapov
2009-08-27 13:08     ` [Qemu-devel] [PATCH] " Bernhard Kauer
2009-08-27 13:17       ` Gleb Natapov

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