All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olivier Danet <odanet@caramail.com>
To: qemu-devel <qemu-devel@nongnu.org>,
	Blue Swirl <blauwirbel@gmail.com>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	Artyom Tarasenko <atar4qemu@gmail.com>
Subject: [Qemu-devel] [PATCH] Sun4m : SCSI ESP controller
Date: Mon, 17 Feb 2014 00:13:42 +0100	[thread overview]
Message-ID: <53014626.20009@caramail.com> (raw)

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

             reply	other threads:[~2014-02-16 23:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-16 23:13 Olivier Danet [this message]
2014-02-20  8:58 ` [Qemu-devel] [PATCH] Sun4m : SCSI ESP controller 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53014626.20009@caramail.com \
    --to=odanet@caramail.com \
    --cc=atar4qemu@gmail.com \
    --cc=blauwirbel@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.