]> xenbits.xensource.com Git - seabios.git/commitdiff
lsi-scsi: reset in case of a serious problem
authorRoman Kagan <rkagan@virtuozzo.com>
Wed, 26 Apr 2017 14:18:08 +0000 (17:18 +0300)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 2 May 2017 23:57:04 +0000 (19:57 -0400)
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

index b63430dc9cc2cfffb7f6bc9351d40757e8be1ea9..d2649930c3e57b4ecd46a70d9dae05a85ac8a57f 100644 (file)
@@ -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) {