qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] sparc32 fix spurious dma interrupts
@ 2010-02-10 22:40 Artyom Tarasenko
  2010-02-12 18:40 ` [Qemu-devel] " Artyom Tarasenko
  2010-02-12 19:27 ` Blue Swirl
  0 siblings, 2 replies; 5+ messages in thread
From: Artyom Tarasenko @ 2010-02-10 22:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Blue Swirl, Artyom Tarasenko

Don't raise interrupt when not enabled.
Don't set DMA_INTR bit spuriously.
Don't print misleading debug messages "Raise IRQ" when not raising any.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
---
diff --git a/hw/sparc32_dma.c b/hw/sparc32_dma.c
index 6e991e0..b2992ca 100644
--- a/hw/sparc32_dma.c
+++ b/hw/sparc32_dma.c
@@ -125,9 +125,11 @@ static void dma_set_irq(void *opaque, int irq, int level)
 {
     DMAState *s = opaque;
     if (level) {
-        DPRINTF("Raise IRQ\n");
         s->dmaregs[0] |= DMA_INTR;
-        qemu_irq_raise(s->irq);
+        if (s->dmaregs[0] & DMA_INTREN) {
+            DPRINTF("Raise IRQ\n");
+            qemu_irq_raise(s->irq);
+        }
     } else {
         s->dmaregs[0] &= ~DMA_INTR;
         DPRINTF("Lower IRQ\n");
@@ -142,8 +145,6 @@ void espdma_memory_read(void *opaque, uint8_t *buf, int len)
     DPRINTF("DMA read, direction: %c, addr 0x%8.8x\n",
             s->dmaregs[0] & DMA_WRITE_MEM ? 'w': 'r', s->dmaregs[1]);
     sparc_iommu_memory_read(s->iommu, s->dmaregs[1], buf, len);
-    DPRINTF("Raise IRQ\n");
-    s->dmaregs[0] |= DMA_INTR;
     s->dmaregs[1] += len;
 }
 
@@ -154,8 +155,6 @@ void espdma_memory_write(void *opaque, uint8_t *buf, int len)
     DPRINTF("DMA write, direction: %c, addr 0x%8.8x\n",
             s->dmaregs[0] & DMA_WRITE_MEM ? 'w': 'r', s->dmaregs[1]);
     sparc_iommu_memory_write(s->iommu, s->dmaregs[1], buf, len);
-    DPRINTF("Raise IRQ\n");
-    s->dmaregs[0] |= DMA_INTR;
     s->dmaregs[1] += len;
 }
 

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

end of thread, other threads:[~2010-02-13  7:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-10 22:40 [Qemu-devel] sparc32 fix spurious dma interrupts Artyom Tarasenko
2010-02-12 18:40 ` [Qemu-devel] " Artyom Tarasenko
2010-02-12 19:27 ` Blue Swirl
2010-02-12 22:32   ` Artyom Tarasenko
2010-02-13  7:52     ` Blue Swirl

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