qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Sun4m : SCSI ESP controller
@ 2014-02-16 23:13 Olivier Danet
  2014-02-20  8:58 ` Mark Cave-Ayland
  0 siblings, 1 reply; 6+ messages in thread
From: Olivier Danet @ 2014-02-16 23:13 UTC (permalink / raw)
  To: qemu-devel, Blue Swirl, Mark Cave-Ayland, Artyom Tarasenko

Two small fixes for the ESP (AM53C94) SCSI controller

* Signal the end of the DMA transfer after a SCSI command.

* The status register (RSTAT) is cleared after reading the interrupt
status register (RINTR), except for the TC bit (=Count To Zero) and the
scsi phase bits, which mirror SCSI signals levels.

Fixes the bug "esp0: !TC on DATA XFER" with NetBSD
https://bugs.launchpad.net/qemu/+bug/1055090

Signed-off-by: Olivier Danet <odanet@caramail.com>
---
  hw/scsi/esp.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 2d150bf..5e91077 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -246,6 +246,7 @@ static void esp_do_dma(ESPState *s)
          s->cmdlen = 0;
          s->do_cmd = 0;
          do_cmd(s, s->cmdbuf);
+        esp_dma_done(s);
          return;
      }
      if (s->async_len == 0) {
@@ -417,10 +418,9 @@ uint64_t esp_reg_read(ESPState *s, uint32_t saddr)
             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:
          break;
-- 
1.8.1.5

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

end of thread, other threads:[~2014-02-23 17:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-16 23:13 [Qemu-devel] [PATCH] Sun4m : SCSI ESP controller Olivier Danet
2014-02-20  8:58 ` Mark Cave-Ayland
2014-02-20 11:13   ` Paolo Bonzini
2014-02-23 17:25     ` Mark Cave-Ayland
2014-02-21 22:03   ` Olivier Danet
2014-02-23 16:50   ` Mark Cave-Ayland

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