qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v15 01/11] esp: move handle_ti_cmd() cleanup code to esp_do_d


From: Paolo Bonzini
Subject: Re: [PATCH v15 01/11] esp: move handle_ti_cmd() cleanup code to esp_do_dma().
Date: Sun, 27 Oct 2019 18:02:31 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 26/10/19 18:45, Laurent Vivier wrote:
> 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 <address@hidden>
> ---
>  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;
> 

Acked-by: Paolo Bonzini <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]