[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] sparc32 fix spurious dma interrupts
From: |
Artyom Tarasenko |
Subject: |
[Qemu-devel] sparc32 fix spurious dma interrupts |
Date: |
Wed, 10 Feb 2010 23:40:48 +0100 |
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 <address@hidden>
---
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;
}
- [Qemu-devel] sparc32 fix spurious dma interrupts,
Artyom Tarasenko <=