[PATCH 01/88] esp: don't clear cmdfifo when esp_select() fails in get_cmd()

Mark Cave-Ayland posted 88 patches 10 months ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>
[PATCH 01/88] esp: don't clear cmdfifo when esp_select() fails in get_cmd()
Posted by Mark Cave-Ayland 10 months ago
The FIFO contents should not be affected if the target selection fails.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/scsi/esp.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 3a1c9f7c3b..68d07edc05 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -252,11 +252,9 @@ static uint32_t get_cmd(ESPState *s, uint32_t maxlen)
             fifo8_push_all(&s->cmdfifo, buf, dmalen);
         } else {
             if (esp_select(s) < 0) {
-                fifo8_reset(&s->cmdfifo);
                 return -1;
             }
             esp_raise_drq(s);
-            fifo8_reset(&s->cmdfifo);
             return 0;
         }
     } else {
@@ -271,7 +269,6 @@ static uint32_t get_cmd(ESPState *s, uint32_t maxlen)
     trace_esp_get_cmd(dmalen, target);
 
     if (esp_select(s) < 0) {
-        fifo8_reset(&s->cmdfifo);
         return -1;
     }
     return dmalen;
-- 
2.39.2
Re: [PATCH 01/88] esp: don't clear cmdfifo when esp_select() fails in get_cmd()
Posted by Helge Deller 10 months ago
On 1/12/24 13:52, Mark Cave-Ayland wrote:
> The FIFO contents should not be affected if the target selection fails.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

I built and tested this series together with your "esp-pci: fixes for
Linux and MS-DOS" on top of git head and they fixed all outstanding issues.

So, you may add
Tested-by: Helge Deller <deller@gmx.de>
to both.

Thanks!
Helge