[SeaBIOS] [PATCH] esp-scsi: terminate DMA transfer when ESP data transfer completes

Mark Cave-Ayland posted 1 patch 3 months, 4 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/seabios tags/patchew/20240101121942.383191-1-mark.cave-ayland@ilande.co.uk
src/hw/esp-scsi.c | 2 ++
1 file changed, 2 insertions(+)
[SeaBIOS] [PATCH] esp-scsi: terminate DMA transfer when ESP data transfer completes
Posted by Mark Cave-Ayland 3 months, 4 weeks ago
When the ESP data transfer completes indicated by the STAT_TC flag being set,
terminate the DMA transfer by issuing a DMA IDLE command. Otherwise in the case
where the guest sends a reset followed by an ESP command, the DMA signal remains
enabled and so the next SeaBIOS DMA transfer begins immediately when the next
ESP command is received rather than waiting until the data is ready and the DMA
command is issued.

With this fix it is possible to boot a Windows XP ISO to the installer and
complete a full installation within QEMU directly using SeaBIOS.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 src/hw/esp-scsi.c | 2 ++
 1 file changed, 2 insertions(+)

[This fixes the Windows XP setup issue reported by Paolo when DC390 support was
first added to QEMU (see https://lore.kernel.org/all/501A94D0.3080502@redhat.com/
for the original thread) way back in 2012.]  

diff --git a/src/hw/esp-scsi.c b/src/hw/esp-scsi.c
index f19804f..8612069 100644
--- a/src/hw/esp-scsi.c
+++ b/src/hw/esp-scsi.c
@@ -147,6 +147,8 @@ esp_scsi_process_op(struct disk_op_s *op)
         /* At end of DMA TC is set again -> complete command.  */
         if (state == 1 && (stat & ESP_STAT_TC)) {
             state++;
+            /* Terminate esp_scsi_dma() command */
+            outb(0, iobase + ESP_DMA_CMD);
             continue;
         }
 
-- 
2.39.2

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH] esp-scsi: terminate DMA transfer when ESP data transfer completes
Posted by Gerd Hoffmann 3 months ago
On Mon, Jan 01, 2024 at 12:19:42PM +0000, Mark Cave-Ayland wrote:
> When the ESP data transfer completes indicated by the STAT_TC flag being set,
> terminate the DMA transfer by issuing a DMA IDLE command. Otherwise in the case
> where the guest sends a reset followed by an ESP command, the DMA signal remains
> enabled and so the next SeaBIOS DMA transfer begins immediately when the next
> ESP command is received rather than waiting until the data is ready and the DMA
> command is issued.
> 
> With this fix it is possible to boot a Windows XP ISO to the installer and
> complete a full installation within QEMU directly using SeaBIOS.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
>  src/hw/esp-scsi.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> [This fixes the Windows XP setup issue reported by Paolo when DC390 support was
> first added to QEMU (see https://lore.kernel.org/all/501A94D0.3080502@redhat.com/
> for the original thread) way back in 2012.]  
> 
> diff --git a/src/hw/esp-scsi.c b/src/hw/esp-scsi.c
> index f19804f..8612069 100644
> --- a/src/hw/esp-scsi.c
> +++ b/src/hw/esp-scsi.c
> @@ -147,6 +147,8 @@ esp_scsi_process_op(struct disk_op_s *op)
>          /* At end of DMA TC is set again -> complete command.  */
>          if (state == 1 && (stat & ESP_STAT_TC)) {
>              state++;
> +            /* Terminate esp_scsi_dma() command */
> +            outb(0, iobase + ESP_DMA_CMD);
>              continue;
>          }

Patch applied to master branch.

thanks,
  Gerd

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org