[SeaBIOS] Re: [PATCH v2 1/2] esp-scsi: flush FIFO before sending SCSI command

2023-08-02 Thread Philippe Mathieu-Daudé
On 2/8/23 11:48, Mark Cave-Ayland wrote: The ESP FIFO is used as a buffer for DMA requests and so isn't guaranteed to be empty in the case of SCSI errors or a mixed DMA/non-DMA request. Flush the FIFO before sending a SCSI command to guarantee that it is correctly positioned at the start of the

[SeaBIOS] Re: [PATCH 1/2] esp-scsi: flush FIFO before sending SCSI command

2023-08-02 Thread Philippe Mathieu-Daudé
On 29/7/23 15:04, Mark Cave-Ayland wrote: The ESP FIFO is used as a buffer for DMA requests and so isn't guaranteed to be empty in the case of SCSI errors or a mixed DMA/non-DMA request. Flush the FIFO before sending a SCSI command to guarantee that it is correctly positioned at the start of the

[SeaBIOS] [PATCH v2 2/2] esp-scsi: check for INTR_BS/INTR_FC instead of STAT_TC for command completion

2023-08-02 Thread Mark Cave-Ayland
The ESP SELATN command used to send SCSI commands from the ESP to the SCSI bus is not a DMA command and therefore does not affect the STAT_TC bit. The only reason this works at all is due to a bug in QEMU which (currently) always updates the STAT_TC bit in ESP_RSTAT regardless of the state of the

[SeaBIOS] [PATCH v2 1/2] esp-scsi: flush FIFO before sending SCSI command

2023-08-02 Thread Mark Cave-Ayland
The ESP FIFO is used as a buffer for DMA requests and so isn't guaranteed to be empty in the case of SCSI errors or a mixed DMA/non-DMA request. Flush the FIFO before sending a SCSI command to guarantee that it is correctly positioned at the start of the FIFO. Signed-off-by: Mark Cave-Ayland ---

[SeaBIOS] [PATCH v2 0/2] esp-scsi: fix reliance on QEMU ESP SCSI implementation bugs

2023-08-02 Thread Mark Cave-Ayland
Whilst trying to improve QEMU's ESP SCSI implementation with regard to the NCR datasheet, I noticed that SeaBIOS would fail to boot one of my Debian test images with my patches applied. Further investigation revealed that the SeaBIOS esp-scsi driver inadvertently relies on existing bugs in QEMU's

[SeaBIOS] Re: [PATCH 2/2] esp-scsi: check for INTR_BS/INTR_FC instead of STAT_TC for command completion

2023-08-02 Thread Mark Cave-Ayland
On 01/08/2023 03:07, Paul Menzel wrote: Dear Mark, Am 30.07.23 um 10:56 schrieb Mark Cave-Ayland: On 30/07/2023 08:47, Paul Menzel wrote: [Cc: +Paolo as original author of the driver] […] Am 29.07.23 um 15:04 schrieb Mark Cave-Ayland: The ESP SELATN command used to send SCSI commands