]> git.proxmox.com Git - mirror_qemu.git/commit
hw/scsi/esp-pci: synchronise setting of DMA_STAT_DONE with ESP completion interrupt
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Fri, 12 Jan 2024 13:15:28 +0000 (13:15 +0000)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 19 Jan 2024 11:28:59 +0000 (12:28 +0100)
commit1e8e6644e063b20ad391140fae13d00ad7750b33
treed7bd3b09ab561ba2fd647da012183f5ed92c4332
parent6b41417d934b2640b7ccf893544d656eea92a2e7
hw/scsi/esp-pci: synchronise setting of DMA_STAT_DONE with ESP completion interrupt

The setting of DMA_STAT_DONE at the end of a DMA transfer can be configured to
generate an interrupt, however the Linux driver manually checks for DMA_STAT_DONE
being set and if it is, considers that a DMA transfer has completed.

If DMA_STAT_DONE is set but the ESP device isn't indicating an interrupt then
the Linux driver considers this to be a spurious interrupt. However this can
occur in QEMU as there is a delay between the end of DMA transfer where
DMA_STAT_DONE is set, and the ESP device raising its completion interrupt.

This appears to be an incorrect assumption in the Linux driver as the ESP and
PCI DMA interrupt sources are separate (and may not be raised exactly
together), however we can work around this by synchronising the setting of
DMA_STAT_DONE at the end of a DMA transfer with the ESP completion interrupt.

In conjunction with the previous commit Linux is now able to correctly boot
from an am53c974 PCI SCSI device on the hppa C3700 machine without emitting
"iget: checksum invalid" and "Spurious irq, sreg=10" errors.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Message-ID: <20240112131529.515642-4-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
hw/scsi/esp-pci.c