Skip to content

Commit

Permalink
esp.c: update condition for esp_dma_done() in esp_do_dma() from devic…
Browse files Browse the repository at this point in the history
…e path

No change to the condition itself, other than to clarify that esp_dma_done()
must be called when TC is zero.

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-21-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  • Loading branch information
mcayland committed Feb 13, 2024
1 parent 27bd0cc commit 6b7b003
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions hw/scsi/esp.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,19 +743,13 @@ static void esp_do_dma(ESPState *s)

if (s->async_len == 0) {
scsi_req_continue(s->current_req);
/*
* If there is still data to be read from the device then
* complete the DMA operation immediately. Otherwise defer
* until the scsi layer has completed.
*/
if (esp_get_tc(s) != 0) {
return;
}
}

/* Partially filled a scsi buffer. Complete immediately. */
esp_dma_done(s);
esp_lower_drq(s);
if (esp_get_tc(s) == 0) {
/* Partially filled a scsi buffer. Complete immediately. */
esp_dma_done(s);
esp_lower_drq(s);
}
} else {
/* Adjust TC for any leftover data in the FIFO */
if (!fifo8_is_empty(&s->fifo)) {
Expand Down

0 comments on commit 6b7b003

Please sign in to comment.