All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] [RESEND] RTC polling mode broken
@ 2009-09-02  7:49 Bernhard Kauer
  2009-09-09 12:18 ` [Qemu-devel] [PATCH] [RESEND2] Qemu unmaintained? Bernhard Kauer
  0 siblings, 1 reply; 51+ messages in thread
From: Bernhard Kauer @ 2009-09-02  7:49 UTC (permalink / raw)
  To: qemu-devel

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 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] 51+ messages in thread

end of thread, other threads:[~2009-09-14  7:59 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-02  7:49 [Qemu-devel] [PATCH] [RESEND] RTC polling mode broken Bernhard Kauer
2009-09-09 12:18 ` [Qemu-devel] [PATCH] [RESEND2] Qemu unmaintained? Bernhard Kauer
2009-09-09 12:23   ` Amit Shah
2009-09-09 12:58     ` Bernhard Kauer
2009-09-09 12:25   ` Kevin Wolf
2009-09-09 13:00   ` Anthony Liguori
2009-09-09 13:26     ` Gleb Natapov
2009-09-09 13:45       ` Anthony Liguori
2009-09-09 14:31       ` Avi Kivity
2009-09-09 13:34     ` Bernhard Kauer
2009-09-10  7:03     ` Amit Shah
2009-09-10  7:56       ` Reimar Döffinger
2009-09-10 10:08         ` Amit Shah
2009-09-10 11:47           ` Luiz Capitulino
2009-09-10 12:01             ` [Qemu-devel] QEMU patch management Amit Shah
2009-09-10 12:29               ` [Qemu-devel] " Luiz Capitulino
2009-09-10 12:51                 ` Reimar Döffinger
2009-09-10 13:11                   ` Luiz Capitulino
2009-09-10 17:24                     ` Reimar Döffinger
2009-09-10 13:58             ` [Qemu-devel] [PATCH] [RESEND2] Qemu unmaintained? Anthony Liguori
2009-09-10 13:56       ` Anthony Liguori
2009-09-10 14:04         ` Amit Shah
2009-09-10 14:12           ` Anthony Liguori
2009-09-10 15:15             ` Amit Shah
2009-09-10 14:38         ` Avi Kivity
2009-09-10 15:54           ` Anthony Liguori
2009-09-10 16:09             ` Avi Kivity
2009-09-10 16:22               ` Anthony Liguori
2009-09-10 16:35                 ` Avi Kivity
2009-09-10 16:38                   ` Anthony Liguori
2009-09-10 16:46                     ` Avi Kivity
2009-09-10 17:19                       ` Reimar Döffinger
2009-09-11 12:39                         ` Amit Shah
2009-09-12  5:55                         ` Blue Swirl
2009-09-13 15:44                           ` Avi Kivity
2009-09-13 16:30                             ` Blue Swirl
2009-09-11  7:06                     ` Gerd Hoffmann
2009-09-10 18:29                   ` Mark McLoughlin
2009-09-10 18:40                     ` Avi Kivity
2009-09-10 19:31                       ` Anthony Liguori
2009-09-13 15:49                         ` Avi Kivity
2009-09-10 20:36                       ` Mark McLoughlin
2009-09-13 16:19                         ` Avi Kivity
2009-09-14  7:49                           ` Mark McLoughlin
2009-09-14  7:59                             ` Avi Kivity
2009-09-10 18:59                     ` Reimar Döffinger
2009-09-10 16:05           ` Anthony Liguori
2009-09-10 16:14             ` Avi Kivity
2009-09-11  9:16           ` [Qemu-devel] commit e09a5267 (was: [PATCH] [RESEND2] Qemu unmaintained?) Jan Kiszka
2009-09-11 12:56             ` [Qemu-devel] Re: commit e09a5267 Anthony Liguori
2009-09-11 13:04               ` Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.