* [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
* [Qemu-devel] Re: sparc32 fix spurious dma interrupts
2010-02-10 22:40 [Qemu-devel] sparc32 fix spurious dma interrupts Artyom Tarasenko
@ 2010-02-12 18:40 ` Artyom Tarasenko
2010-02-12 19:27 ` Blue Swirl
1 sibling, 0 replies; 5+ messages in thread
From: Artyom Tarasenko @ 2010-02-12 18:40 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-devel
2010/2/10 Artyom Tarasenko <atar4qemu@googlemail.com>:
> 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.
Haven't noticed that these were introduced recently.
Shall we revert 787cfbc432bf1d353a77cbdb613754f3963371a3 and rebase?
>
> 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;
> }
>
>
--
Regards,
Artyom Tarasenko
solaris/sparc under qemu blog: http://tyom.blogspot.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] Re: sparc32 fix spurious dma interrupts
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
1 sibling, 1 reply; 5+ messages in thread
From: Blue Swirl @ 2010-02-12 19:27 UTC (permalink / raw)
To: Artyom Tarasenko; +Cc: qemu-devel, Artyom Tarasenko
On Thu, Feb 11, 2010 at 12:40 AM, Artyom Tarasenko
<atar4qemu@googlemail.com> wrote:
> 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.
This breaks most of my Linux tests. *BSD are unaffected. For example
sparc-test 2.0:
eth0: LANCE 52:54:00:12:34:56
esp0: IRQ 36 SCSI ID 7 Clk 40MHz CCYC=25000 CCF=8 TOut 167 NCR53C9XF(espfast)
ESP: Total of 1 ESP hosts found, 1 actually in use.
scsi0 : Sparc ESP100A-FAST
esp0: Aborting command
esp0: dumping state
esp0: dma -- cond_reg<a4400311> addr<f0010e64>
esp0: SW [sreg<11> sstep<04> ireg<18>]
esp0: HW reread [sreg<93> sstep<00> ireg<10>]
esp0: current command [tgt<02> lun<00> pphase<CLUELESS> cphase<DATAIN>]
esp0: disconnected
esp0: Aborting command
esp0: dumping state
esp0: dma -- cond_reg<a4400310> addr<f0010e64>
esp0: SW [sreg<11> sstep<04> ireg<18>]
esp0: HW reread [sreg<03> sstep<04> ireg<00>]
esp0: current command [tgt<02> lun<00> pphase<UNISSUED> cphase<UNISSUED>]
esp0: disconnected
esp0: Resetting scsi bus
esp0: SCSI bus reset interrupt
esp0: Aborting command
esp0: dumping state
esp0: dma -- cond_reg<a4400211> addr<f000d007>
esp0: SW [sreg<03> sstep<04> ireg<80>]
esp0: HW reread [sreg<91> sstep<04> ireg<18>]
esp0: current command [tgt<02> lun<00> pphase<UNISSUED> cphase<UNISSUED>]
esp0: disconnected
scsi: Device offlined - not ready after error recovery: host 0 channel
0 id 2 lun 0
Since Open/NetBSD still works, there may be yet again another bug that
your patch uncovers.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] Re: sparc32 fix spurious dma interrupts
2010-02-12 19:27 ` Blue Swirl
@ 2010-02-12 22:32 ` Artyom Tarasenko
2010-02-13 7:52 ` Blue Swirl
0 siblings, 1 reply; 5+ messages in thread
From: Artyom Tarasenko @ 2010-02-12 22:32 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-devel
2010/2/12 Blue Swirl <blauwirbel@gmail.com>:
> On Thu, Feb 11, 2010 at 12:40 AM, Artyom Tarasenko
> <atar4qemu@googlemail.com> wrote:
>> 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.
>
> This breaks most of my Linux tests. *BSD are unaffected. For example
> sparc-test 2.0:
>
> eth0: LANCE 52:54:00:12:34:56
> esp0: IRQ 36 SCSI ID 7 Clk 40MHz CCYC=25000 CCF=8 TOut 167 NCR53C9XF(espfast)
> ESP: Total of 1 ESP hosts found, 1 actually in use.
> scsi0 : Sparc ESP100A-FAST
> esp0: Aborting command
> esp0: dumping state
> esp0: dma -- cond_reg<a4400311> addr<f0010e64>
> esp0: SW [sreg<11> sstep<04> ireg<18>]
> esp0: HW reread [sreg<93> sstep<00> ireg<10>]
> esp0: current command [tgt<02> lun<00> pphase<CLUELESS> cphase<DATAIN>]
> esp0: disconnected
> esp0: Aborting command
> esp0: dumping state
> esp0: dma -- cond_reg<a4400310> addr<f0010e64>
> esp0: SW [sreg<11> sstep<04> ireg<18>]
> esp0: HW reread [sreg<03> sstep<04> ireg<00>]
> esp0: current command [tgt<02> lun<00> pphase<UNISSUED> cphase<UNISSUED>]
> esp0: disconnected
> esp0: Resetting scsi bus
> esp0: SCSI bus reset interrupt
> esp0: Aborting command
> esp0: dumping state
> esp0: dma -- cond_reg<a4400211> addr<f000d007>
> esp0: SW [sreg<03> sstep<04> ireg<80>]
> esp0: HW reread [sreg<91> sstep<04> ireg<18>]
> esp0: current command [tgt<02> lun<00> pphase<UNISSUED> cphase<UNISSUED>]
> esp0: disconnected
> scsi: Device offlined - not ready after error recovery: host 0 channel
> 0 id 2 lun 0
>
> Since Open/NetBSD still works, there may be yet again another bug that
> your patch uncovers.
Looks like Linux has problems with the fist part of the patch: not
raising irqs when they are not enabled.
The part is actually not relevant for Solaris, so we could just skip
it. But it would be nicer to find this another bug.
It seems that there is some asymmetry: Solaris complained about
spurious interrupts only on write operations.
Do you have an idea why setting the DMA_INTR bit and raising the irq
was split between multiple functions?
--
Regards,
Artyom Tarasenko
solaris/sparc under qemu blog: http://tyom.blogspot.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] Re: sparc32 fix spurious dma interrupts
2010-02-12 22:32 ` Artyom Tarasenko
@ 2010-02-13 7:52 ` Blue Swirl
0 siblings, 0 replies; 5+ messages in thread
From: Blue Swirl @ 2010-02-13 7:52 UTC (permalink / raw)
To: Artyom Tarasenko; +Cc: qemu-devel
On Sat, Feb 13, 2010 at 12:32 AM, Artyom Tarasenko
<atar4qemu@googlemail.com> wrote:
> 2010/2/12 Blue Swirl <blauwirbel@gmail.com>:
>> On Thu, Feb 11, 2010 at 12:40 AM, Artyom Tarasenko
>> <atar4qemu@googlemail.com> wrote:
>>> 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.
>>
>> This breaks most of my Linux tests. *BSD are unaffected. For example
>> sparc-test 2.0:
>>
>> eth0: LANCE 52:54:00:12:34:56
>> esp0: IRQ 36 SCSI ID 7 Clk 40MHz CCYC=25000 CCF=8 TOut 167 NCR53C9XF(espfast)
>> ESP: Total of 1 ESP hosts found, 1 actually in use.
>> scsi0 : Sparc ESP100A-FAST
>> esp0: Aborting command
>> esp0: dumping state
>> esp0: dma -- cond_reg<a4400311> addr<f0010e64>
>> esp0: SW [sreg<11> sstep<04> ireg<18>]
>> esp0: HW reread [sreg<93> sstep<00> ireg<10>]
>> esp0: current command [tgt<02> lun<00> pphase<CLUELESS> cphase<DATAIN>]
>> esp0: disconnected
>> esp0: Aborting command
>> esp0: dumping state
>> esp0: dma -- cond_reg<a4400310> addr<f0010e64>
>> esp0: SW [sreg<11> sstep<04> ireg<18>]
>> esp0: HW reread [sreg<03> sstep<04> ireg<00>]
>> esp0: current command [tgt<02> lun<00> pphase<UNISSUED> cphase<UNISSUED>]
>> esp0: disconnected
>> esp0: Resetting scsi bus
>> esp0: SCSI bus reset interrupt
>> esp0: Aborting command
>> esp0: dumping state
>> esp0: dma -- cond_reg<a4400211> addr<f000d007>
>> esp0: SW [sreg<03> sstep<04> ireg<80>]
>> esp0: HW reread [sreg<91> sstep<04> ireg<18>]
>> esp0: current command [tgt<02> lun<00> pphase<UNISSUED> cphase<UNISSUED>]
>> esp0: disconnected
>> scsi: Device offlined - not ready after error recovery: host 0 channel
>> 0 id 2 lun 0
>>
>> Since Open/NetBSD still works, there may be yet again another bug that
>> your patch uncovers.
>
> Looks like Linux has problems with the fist part of the patch: not
> raising irqs when they are not enabled.
> The part is actually not relevant for Solaris, so we could just skip
> it. But it would be nicer to find this another bug.
> It seems that there is some asymmetry: Solaris complained about
> spurious interrupts only on write operations.
> Do you have an idea why setting the DMA_INTR bit and raising the irq
> was split between multiple functions?
I'd suspect my sloppiness. ;-)
^ permalink raw reply [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).