cf91b1d
From: Paolo Bonzini <pbonzini@redhat.com>
cf91b1d
Date: Tue, 14 Jun 2016 15:10:24 +0200
cf91b1d
Subject: [PATCH] scsi: esp: respect FIFO invariant after message phase
cf91b1d
cf91b1d
The FIFO contains two bytes; hence the write ptr should be two bytes ahead
cf91b1d
of the read pointer.
cf91b1d
cf91b1d
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cf91b1d
(cherry picked from commit d020aa504cec8f525b55ba2ef982c09dc847c72e)
cf91b1d
---
cf91b1d
 hw/scsi/esp.c | 2 +-
cf91b1d
 1 file changed, 1 insertion(+), 1 deletion(-)
cf91b1d
cf91b1d
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
cf91b1d
index c2f6f8f..6407844 100644
cf91b1d
--- a/hw/scsi/esp.c
cf91b1d
+++ b/hw/scsi/esp.c
cf91b1d
@@ -222,7 +222,7 @@ static void write_response(ESPState *s)
cf91b1d
     } else {
cf91b1d
         s->ti_size = 2;
cf91b1d
         s->ti_rptr = 0;
cf91b1d
-        s->ti_wptr = 0;
cf91b1d
+        s->ti_wptr = 2;
cf91b1d
         s->rregs[ESP_RFLAGS] = 2;
cf91b1d
     }
cf91b1d
     esp_raise_irq(s);