esp: defer command completion interrupt on incoming data transfers
commit4e78f3bf357e0ef2f67e372097f2be8fe0521814
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Thu, 4 Mar 2021 22:10:54 +0000 (4 22:10 +0000)
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Sun, 7 Mar 2021 10:39:05 +0000 (7 10:39 +0000)
tree6da0b82ffb14348e67f566bc6d8fc993789e7142
parentcf47a41e055f6f90a2cecdb9eb3c4cebfde23f2a
esp: defer command completion interrupt on incoming data transfers

The MacOS toolbox ROM issues a command to the ESP controller as part of its
"FAST" SCSI routines and then proceeds to read the incoming data soon after
receiving the command completion interrupt.

Unfortunately due to SCSI block transfers being asynchronous the incoming data
may not yet be present causing an underflow error. Resolve this by waiting for
the SCSI subsystem transfer_data callback before raising the command completion
interrupt.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-34-mark.cave-ayland@ilande.co.uk>
hw/scsi/esp.c
include/hw/scsi/esp.h