All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Fam Zheng <fam@euphon.net>, Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, Jason Wang <jasowang@redhat.com>,
	Laurent Vivier <laurent@vivier.eu>, Max Reitz <mreitz@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [PULL 01/11] esp: move handle_ti_cmd() cleanup code to esp_do_dma().
Date: Mon, 28 Oct 2019 19:16:33 +0100	[thread overview]
Message-ID: <20191028181643.5143-2-laurent@vivier.eu> (raw)
In-Reply-To: <20191028181643.5143-1-laurent@vivier.eu>

To prepare following patches move do_cmd and DMA special case
from handle_ti() to esp_do_dma().

This part of the code must be only executed with real DMA, not with
pseudo-DMA. And PDMA is detected in esp_do_dma(), so move this part
of the code in esp_do_dma(). We keep the code in handle_ti_cmd()
in the case no DMA is done.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20191026164546.30020-2-laurent@vivier.eu>
---
 hw/scsi/esp.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 841d79b60e..09b28cba17 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -249,10 +249,19 @@ static void esp_do_dma(ESPState *s)
 
     len = s->dma_left;
     if (s->do_cmd) {
+        /*
+         * handle_ti_cmd() case: esp_do_dma() is called only from
+         * handle_ti_cmd() with do_cmd != NULL (see the assert())
+         */
         trace_esp_do_dma(s->cmdlen, len);
         assert (s->cmdlen <= sizeof(s->cmdbuf) &&
                 len <= sizeof(s->cmdbuf) - s->cmdlen);
         s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], len);
+        trace_esp_handle_ti_cmd(s->cmdlen);
+        s->ti_size = 0;
+        s->cmdlen = 0;
+        s->do_cmd = 0;
+        do_cmd(s, s->cmdbuf);
         return;
     }
     if (s->async_len == 0) {
@@ -373,8 +382,7 @@ static void handle_ti(ESPState *s)
         s->dma_left = minlen;
         s->rregs[ESP_RSTAT] &= ~STAT_TC;
         esp_do_dma(s);
-    }
-    if (s->do_cmd) {
+    } else if (s->do_cmd) {
         trace_esp_handle_ti_cmd(s->cmdlen);
         s->ti_size = 0;
         s->cmdlen = 0;
-- 
2.21.0



  reply	other threads:[~2019-10-28 19:23 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-28 18:16 [PULL 00/11] Q800 branch patches Laurent Vivier
2019-10-28 18:16 ` Laurent Vivier [this message]
2019-10-28 18:16 ` [PULL 02/11] esp: move get_cmd() post-DMA code to get_cmd_cb() Laurent Vivier
2019-10-28 18:16 ` [PULL 03/11] esp: add pseudo-DMA as used by Macintosh Laurent Vivier
2019-10-28 18:16 ` [PULL 04/11] dp8393x: manage big endian bus Laurent Vivier
2019-10-28 18:16 ` [PULL 05/11] hw/m68k: add VIA support Laurent Vivier
2019-10-28 18:16 ` [PULL 06/11] hw/m68k: implement ADB bus support for via Laurent Vivier
2019-10-28 18:16 ` [PULL 07/11] hw/m68k: add Nubus support Laurent Vivier
2019-10-28 18:16 ` [PULL 08/11] hw/m68k: add Nubus macfb video card Laurent Vivier
2019-10-28 18:16 ` [PULL 09/11] hw/m68k: add a dummy SWIM floppy controller Laurent Vivier
2019-10-28 18:16 ` [PULL 10/11] hw/m68k: define Macintosh Quadra 800 Laurent Vivier
2019-10-28 18:16 ` [PULL 11/11] BootLinuxConsoleTest: Test the " Laurent Vivier
2019-10-29 23:23   ` [PATCH 0/2] Acceptance test: update kernel used on m68k/q800 test Cleber Rosa
2019-10-29 23:23     ` [PATCH 1/2] Acceptance test: cancel test if m68k kernel packages goes missing Cleber Rosa
2019-10-31  8:06       ` Alex Bennée
2019-10-29 23:23     ` [PATCH 2/2] Acceptance test: update kernel for m68k/q800 test Cleber Rosa
2019-10-31  6:08       ` Alex Bennée
2019-11-07 15:08         ` Wainer dos Santos Moschetta
2019-10-31  8:06       ` Alex Bennée
2019-10-31  9:57     ` [PATCH 0/2] Acceptance test: update kernel used on " Alex Bennée
2019-11-07 15:43     ` Eric Blake
2019-11-07 16:38       ` Cleber Rosa
2019-11-07 17:18         ` Laurent Vivier
2019-11-07 18:00           ` Philippe Mathieu-Daudé
2019-11-07 18:25             ` Laurent Vivier
2019-10-28 23:55 ` [PULL 00/11] Q800 branch patches no-reply
2019-10-29 18:06 ` Peter Maydell

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=20191028181643.5143-2-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=fam@euphon.net \
    --cc=jasowang@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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.