Skip to content
  • Mark Cave-Ayland's avatar
    06a28b78
    hw/scsi/esp-pci: synchronise setting of DMA_STAT_DONE with ESP completion interrupt · 06a28b78
    Mark Cave-Ayland authored
    
    
    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: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
    Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Message-ID: <20240112131529.515642-4-mark.cave-ayland@ilande.co.uk>
    Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
    (cherry picked from commit 1e8e6644e063b20ad391140fae13d00ad7750b33)
    Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
    06a28b78
    hw/scsi/esp-pci: synchronise setting of DMA_STAT_DONE with ESP completion interrupt
    Mark Cave-Ayland authored
    
    
    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: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
    Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Message-ID: <20240112131529.515642-4-mark.cave-ayland@ilande.co.uk>
    Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
    (cherry picked from commit 1e8e6644e063b20ad391140fae13d00ad7750b33)
    Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
Loading