[SeaBIOS] [PATCH v2 8/9] lsi-scsi: reset in case of a serious problem

Roman Kagan posted 9 patches 8 years, 9 months ago
[SeaBIOS] [PATCH v2 8/9] lsi-scsi: reset in case of a serious problem
Posted by Roman Kagan 8 years, 9 months ago
When the device reports a serious problem via SIST[01] registers, it
needs to be reset, otherwise the following requests will most likely
fail, too.

In particular, REPORT LUNS which fails (wrongly) with underflow in QEMU
makes all the following requests fail, too, rendering the device
unusable.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
---
 src/hw/lsi-scsi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/hw/lsi-scsi.c b/src/hw/lsi-scsi.c
index b63430d..d264993 100644
--- a/src/hw/lsi-scsi.c
+++ b/src/hw/lsi-scsi.c
@@ -116,6 +116,8 @@ lsi_scsi_process_op(struct disk_op_s *op)
         u8 sist0 = inb(iobase + LSI_REG_SIST0);
         u8 sist1 = inb(iobase + LSI_REG_SIST1);
         if (sist0 || sist1) {
+            /* serious problem, can't continue w/o reset */
+            outb(LSI_ISTAT0_SRST, iobase + LSI_REG_ISTAT0);
             goto fail;
         }
         if (dstat & 0x04) {
-- 
2.9.3


_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios