qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [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

* Re: [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
  2012-09-30 15:02   ` Blue Swirl
  0 siblings, 1 reply; 4+ messages in thread
From: Ryo ONODERA @ 2012-09-25 18:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: ryo_on

Hi,

From: Ryo ONODERA <ryo_on@yk.rim.or.jp>, Date: Wed, 26 Sep 2012 02:44:35 +0900

> 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;

Sadly I have gotten same errors on NetBSD/sparc just after the report.

esp0: !TC on DATA XFER [intr 10, stat 83, step 0] prevphase 2, resid 0

Could qemu experts investigate this problem?

Thank you.

--
Ryo ONODERA // ryo_on@yk.rim.or.jp
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3

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

* Re: [Qemu-devel] [PATCH] esp: On qemu-system-sparc's esp, TC is not set properly
  2012-09-25 18:15 ` Ryo ONODERA
@ 2012-09-30 15:02   ` Blue Swirl
  0 siblings, 0 replies; 4+ messages in thread
From: Blue Swirl @ 2012-09-30 15:02 UTC (permalink / raw)
  To: Ryo ONODERA; +Cc: qemu-devel

On Tue, Sep 25, 2012 at 6:15 PM, Ryo ONODERA <ryo_on@yk.rim.or.jp> wrote:
> Hi,
>
> From: Ryo ONODERA <ryo_on@yk.rim.or.jp>, Date: Wed, 26 Sep 2012 02:44:35 +0900
>
>> 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;
>
> Sadly I have gotten same errors on NetBSD/sparc just after the report.
>
> esp0: !TC on DATA XFER [intr 10, stat 83, step 0] prevphase 2, resid 0
>
> Could qemu experts investigate this problem?

The error seems to be harmless, I was able to install NetBSD/sparc
5.1.2 and boot the installed system.

But the patch looks OK too except maybe RSTAT may need to be set
instead of ORed, possibly with other bits like other cases.

>
> Thank you.
>
> --
> Ryo ONODERA // ryo_on@yk.rim.or.jp
> PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3
>
>
>

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

* 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

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