[PATCH 04/10] scsi:ncr710: Fix DMA State machine and flow control

Soumyajyotii Ssarkar posted 10 patches 1 month, 2 weeks ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Helge Deller <deller@gmx.de>, Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>
[PATCH 04/10] scsi:ncr710: Fix DMA State machine and flow control
Posted by Soumyajyotii Ssarkar 1 month, 2 weeks ago
Set waiting state and return after scsi_req_continue() to prevent
re entrancy when DMA transfer completes.

Signed-off-by: Soumyajyotii Ssarkar<soumyajyotisarkar23@gmail.com>
---
 hw/scsi/ncr53c710.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c
index 0b7734a129..e17d1f3fb8 100644
--- a/hw/scsi/ncr53c710.c
+++ b/hw/scsi/ncr53c710.c
@@ -718,7 +718,9 @@ static void ncr710_do_dma(NCR710State *s, int out)
     if (s->current->dma_len == 0) {
         s->current->dma_buf = NULL;
         s->current->pending = 0;
+        s->waiting = NCR710_WAIT_DMA;
         scsi_req_continue(s->current->req);
+        return;
     } else {
         s->current->dma_buf += count;
         s->waiting = NCR710_WAIT_NONE;
-- 
2.49.0
Re: [PATCH 04/10] scsi:ncr710: Fix DMA State machine and flow control
Posted by Helge Deller 1 month, 2 weeks ago
On 12/21/25 15:23, Soumyajyotii Ssarkar wrote:
> Set waiting state and return after scsi_req_continue() to prevent
> re entrancy when DMA transfer completes.
> 
> Signed-off-by: Soumyajyotii Ssarkar<soumyajyotisarkar23@gmail.com>

Reviewed-by: Helge Deller <deller@gmx.de>

> ---
>   hw/scsi/ncr53c710.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c
> index 0b7734a129..e17d1f3fb8 100644
> --- a/hw/scsi/ncr53c710.c
> +++ b/hw/scsi/ncr53c710.c
> @@ -718,7 +718,9 @@ static void ncr710_do_dma(NCR710State *s, int out)
>       if (s->current->dma_len == 0) {
>           s->current->dma_buf = NULL;
>           s->current->pending = 0;
> +        s->waiting = NCR710_WAIT_DMA;
>           scsi_req_continue(s->current->req);
> +        return;
>       } else {
>           s->current->dma_buf += count;
>           s->waiting = NCR710_WAIT_NONE;