[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/33] esp: correctly accumulate extended messages for PDMA
From: |
Paolo Bonzini |
Subject: |
[PULL 12/33] esp: correctly accumulate extended messages for PDMA |
Date: |
Tue, 15 Jun 2021 15:38:34 +0200 |
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Commit 799d90d818 "esp: transition to message out phase after SATN and stop
command" added logic to correctly handle extended messages for DMA requests
but not for PDMA requests.
Apply the same logic in esp_do_dma() to do_dma_pdma_cb() so that extended
messages terminated with a PDMA request are accumulated correctly. This allows
the ESP device to respond correctly to the SDTR negotiation initiated by the
NetBSD ESP driver without causing errors and timeouts on boot.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20210519100803.10293-6-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/scsi/esp.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 16e4b7ead6..3e6f4094fc 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -492,9 +492,26 @@ static void do_dma_pdma_cb(ESPState *s)
}
s->ti_size = 0;
- s->do_cmd = 0;
- do_cmd(s);
- esp_lower_drq(s);
+ if ((s->rregs[ESP_RSTAT] & 7) == STAT_CD) {
+ /* No command received */
+ if (s->cmdfifo_cdb_offset == fifo8_num_used(&s->cmdfifo)) {
+ return;
+ }
+
+ /* Command has been received */
+ s->do_cmd = 0;
+ do_cmd(s);
+ } else {
+ /*
+ * Extra message out bytes received: update cmdfifo_cdb_offset
+ * and then switch to commmand phase
+ */
+ s->cmdfifo_cdb_offset = fifo8_num_used(&s->cmdfifo);
+ s->rregs[ESP_RSTAT] = STAT_TC | STAT_CD;
+ s->rregs[ESP_RSEQ] = SEQ_CD;
+ s->rregs[ESP_RINTR] |= INTR_BS;
+ esp_raise_irq(s);
+ }
return;
}
--
2.31.1
- [PULL 10/33] esp: ensure PDMA write transfers are flushed from the FIFO to the target immediately, (continued)
- [PULL 10/33] esp: ensure PDMA write transfers are flushed from the FIFO to the target immediately, Paolo Bonzini, 2021/06/15
- [PULL 16/33] softmmu/physmem: Fix ram_block_discard_range() to handle shared anonymous memory, Paolo Bonzini, 2021/06/15
- [PULL 11/33] esp: revert 75ef849696 "esp: correctly fill bus id with requested lun", Paolo Bonzini, 2021/06/15
- [PULL 04/33] block/scsi: correctly emulate the VPD block limits page, Paolo Bonzini, 2021/06/15
- [PULL 15/33] softmmu/physmem: Mark shared anonymous memory RAM_SHARED, Paolo Bonzini, 2021/06/15
- [PULL 17/33] softmmu/physmem: Fix qemu_ram_remap() to handle shared anonymous memory, Paolo Bonzini, 2021/06/15
- [PULL 09/33] esp: handle non-DMA transfers from the target one byte at a time, Paolo Bonzini, 2021/06/15
- [PULL 23/33] softmmu/memory: Pass ram_flags to qemu_ram_alloc() and qemu_ram_alloc_internal(), Paolo Bonzini, 2021/06/15
- [PULL 22/33] softmmu/memory: Pass ram_flags to memory_region_init_ram_shared_nomigrate(), Paolo Bonzini, 2021/06/15
- [PULL 03/33] qemu-config: use qemu_opts_from_qdict, Paolo Bonzini, 2021/06/15
- [PULL 12/33] esp: correctly accumulate extended messages for PDMA,
Paolo Bonzini <=
- [PULL 14/33] esp: store lun coming from the MESSAGE OUT phase, Paolo Bonzini, 2021/06/15
- [PULL 19/33] util/mmap-alloc: Factor out reserving of a memory region to mmap_reserve(), Paolo Bonzini, 2021/06/15
- [PULL 20/33] util/mmap-alloc: Factor out activating of memory to mmap_activate(), Paolo Bonzini, 2021/06/15
- [PULL 25/33] memory: Introduce RAM_NORESERVE and wire it up in qemu_ram_mmap(), Paolo Bonzini, 2021/06/15
- [PULL 33/33] configure: map x32 to cpu_family x86_64 for meson, Paolo Bonzini, 2021/06/15
- [PULL 30/33] hmp: Print "share" property of memory backends with "info memdev", Paolo Bonzini, 2021/06/15
- [PULL 18/33] util/mmap-alloc: Factor out calculation of the pagesize for the guard page, Paolo Bonzini, 2021/06/15
- [PULL 21/33] softmmu/memory: Pass ram_flags to qemu_ram_alloc_from_fd(), Paolo Bonzini, 2021/06/15
- [PULL 29/33] qmp: Include "share" property of memory backends, Paolo Bonzini, 2021/06/15
- [PULL 26/33] util/mmap-alloc: Support RAM_NORESERVE via MAP_NORESERVE under Linux, Paolo Bonzini, 2021/06/15