All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [PATCH] esp: On qemu-system-sparc's esp, TC is not set properly
@ 2012-10-02 20:46 odanet
  0 siblings, 0 replies; 4+ messages in thread
From: odanet @ 2012-10-02 20:46 UTC (permalink / raw)
  To: qemu-devel


Could you please try this patch. The TC (count to zero) flag is wrongly
cleared after reading the RINTR register. (contradicting the comment
just above the patch in the source file.)

Regards
Olivier

diff --rup a/hw/esp.c b/hw/esp.c
--- a/hw/esp.c  2012-10-01 22:06:39.000000000 +0200
+++ b/hw/esp.c  2012-10-02 22:22:53.000000000 +0200
@@ -417,9 +417,9 @@ uint64_t esp_reg_read(ESPState *s, uint3
            except TC */
         old_val = s->rregs[ESP_RINTR];
         s->rregs[ESP_RINTR] = 0;
-        s->rregs[ESP_RSTAT] &= ~STAT_TC;
         s->rregs[ESP_RSEQ] = SEQ_CD;
         esp_lower_irq(s);
+        s->rregs[ESP_RSTAT] &= STAT_TC | STAT_MI;
 
         return old_val;
     default:


 

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH] esp: On qemu-system-sparc's esp, TC is not set properly
@ 2012-09-25 17:44 Ryo ONODERA
  2012-09-25 18:15 ` Ryo ONODERA
  0 siblings, 1 reply; 4+ messages in thread
From: Ryo ONODERA @ 2012-09-25 17:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: Ryo ONODERA

I does not understand hw/esp.c fully.
This patch supresses esp/TC related errors on NetBSD/sparc 5.1.2 or 6.0_RC2.

Please review the patch.

This is patch for https://bugs.launchpad.net/qemu/+bug/1055090 .

Signed-off-by: Ryo ONODERA <ryo_on@yk.rim.or.jp>
---
 hw/esp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/esp.c b/hw/esp.c
index 84a4e74..cd14ed1 100644
--- a/hw/esp.c
+++ b/hw/esp.c
@@ -91,6 +91,10 @@ static uint32_t get_cmd(ESPState *s, uint8_t *buf)
         dmalen |= s->rregs[ESP_TCMID] << 8;
         dmalen |= s->rregs[ESP_TCHI] << 16;
         s->dma_memory_read(s->dma_opaque, buf, dmalen);
+        s->rregs[ESP_RSTAT] |= STAT_TC;
+        s->rregs[ESP_TCLO] = 0;
+        s->rregs[ESP_TCMID] = 0;
+        s->rregs[ESP_TCHI] = 0;
     } else {
         dmalen = s->ti_size;
         memcpy(buf, s->ti_buf, dmalen);
@@ -242,6 +246,10 @@ static void esp_do_dma(ESPState *s)
     if (s->do_cmd) {
         trace_esp_do_dma(s->cmdlen, len);
         s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], len);
+        s->rregs[ESP_RSTAT] |= STAT_TC;
+        s->rregs[ESP_TCLO] = 0;
+        s->rregs[ESP_TCMID] = 0;
+        s->rregs[ESP_TCHI] = 0;
         s->ti_size = 0;
         s->cmdlen = 0;
         s->do_cmd = 0;
-- 
1.7.12

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

end of thread, other threads:[~2012-10-02 20:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-02 20:46 [Qemu-devel] [PATCH] esp: On qemu-system-sparc's esp, TC is not set properly odanet
  -- strict thread matches above, loose matches on Subject: below --
2012-09-25 17:44 Ryo ONODERA
2012-09-25 18:15 ` Ryo ONODERA
2012-09-30 15:02   ` Blue Swirl

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.