[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/88] esp.c: decrement the TC during MESSAGE OUT and COMMAND phas
From: |
Mark Cave-Ayland |
Subject: |
[PULL 13/88] esp.c: decrement the TC during MESSAGE OUT and COMMAND phases |
Date: |
Tue, 13 Feb 2024 19:39:37 +0000 |
This is to ensure that STAT_TC is triggered during the right parts of the
transfer when it is controlled exclusively by the TC.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tested-by: Helge Deller <deller@gmx.de>
Tested-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20240112125420.514425-14-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/scsi/esp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 9e9bbe8431..f08b816aba 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -259,6 +259,7 @@ static uint32_t get_cmd(ESPState *s, uint32_t maxlen)
s->dma_memory_read(s->dma_opaque, buf, dmalen);
dmalen = MIN(fifo8_num_free(&s->cmdfifo), dmalen);
fifo8_push_all(&s->cmdfifo, buf, dmalen);
+ esp_set_tc(s, esp_get_tc(s) - dmalen);
} else {
return 0;
}
@@ -657,6 +658,7 @@ static void esp_do_dma(ESPState *s)
len = MIN(len, fifo8_num_free(&s->cmdfifo));
s->dma_memory_read(s->dma_opaque, buf, len);
fifo8_push_all(&s->cmdfifo, buf, len);
+ esp_set_tc(s, esp_get_tc(s) - len);
} else {
esp_set_pdma_cb(s, DO_DMA_PDMA_CB);
esp_raise_drq(s);
--
2.39.2
- [PULL 02/88] esp.c: move existing request cancel check into esp_select(), (continued)
- [PULL 02/88] esp.c: move existing request cancel check into esp_select(), Mark Cave-Ayland, 2024/02/13
- [PULL 03/88] esp.c: add FIFO wraparound support to esp_fifo_pop_buf(), Mark Cave-Ayland, 2024/02/13
- [PULL 04/88] esp.c: remove FIFO clear from esp_select(), Mark Cave-Ayland, 2024/02/13
- [PULL 05/88] esp.c: move esp_select() to ESP selection commands from get_cmd(), Mark Cave-Ayland, 2024/02/13
- [PULL 06/88] esp.c: update esp_set_tc() to set STAT_TC flag, Mark Cave-Ayland, 2024/02/13
- [PULL 08/88] esp.c: move command execution logic to new esp_run_cmd() function, Mark Cave-Ayland, 2024/02/13
- [PULL 07/88] esp.c: start removal of manual STAT_TC setting when transfer counter reaches zero, Mark Cave-Ayland, 2024/02/13
- [PULL 09/88] esp.c: update TC check logic in do_dma_pdma_cb() to check for TC == 0, Mark Cave-Ayland, 2024/02/13
- [PULL 10/88] esp.c: move buffer and TC logic into separate to/from device paths in esp_do_dma(), Mark Cave-Ayland, 2024/02/13
- [PULL 11/88] esp.c: remove unused case from esp_pdma_read(), Mark Cave-Ayland, 2024/02/13
- [PULL 13/88] esp.c: decrement the TC during MESSAGE OUT and COMMAND phases,
Mark Cave-Ayland <=
- [PULL 12/88] esp.c: don't accumulate directly into cmdfifo, Mark Cave-Ayland, 2024/02/13
- [PULL 14/88] esp.c: introduce esp_set_phase() helper function, Mark Cave-Ayland, 2024/02/13
- [PULL 16/88] esp.c: remove MacOS TI workaround that pads FIFO transfers to ESP_FIFO_SZ, Mark Cave-Ayland, 2024/02/13
- [PULL 15/88] esp.c: remove another set of manual STAT_TC updates, Mark Cave-Ayland, 2024/02/13
- [PULL 19/88] esp.c: remove zero transfer size check from esp_do_dma(), Mark Cave-Ayland, 2024/02/13
- [PULL 18/88] esp.c: don't clear RFLAGS register when DMA is complete, Mark Cave-Ayland, 2024/02/13
- [PULL 17/88] esp.c: don't reset the TC and ESP_RSEQ state when executing a SCSI command, Mark Cave-Ayland, 2024/02/13
- [PULL 20/88] esp.c: update condition for esp_dma_done() in esp_do_dma() from device path, Mark Cave-Ayland, 2024/02/13
- [PULL 22/88] esp.c: ensure that the PDMA callback is called for every device read, Mark Cave-Ayland, 2024/02/13
- [PULL 21/88] esp.c: update condition for esp_dma_done() in esp_do_dma() to device path, Mark Cave-Ayland, 2024/02/13