diff mbox series

[Bug,1900155] Re: MIPS Malta fails booting due to IDE error

Message ID 160311734817.8105.14732570041060518142.malone@chaenomeles.canonical.com
State New
Headers show
Series [Bug,1900155] Re: MIPS Malta fails booting due to IDE error | expand

Commit Message

John Snow Oct. 19, 2020, 2:22 p.m. UTC
Yup. Mark Cave-Ayland pointed this out to me. I have a patch ready for
it:
diff mbox series

Patch

diff --git a/hw/ide/core.c b/hw/ide/core.c
index 693b352d5e..98cea7ad45 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2254,10 +2254,8 @@  static void ide_perform_srst(IDEState *s)
      /* Cancel PIO callback, reset registers/signature, etc */
      ide_reset(s);

-    if (s->drive_kind == IDE_CD) {
-        /* ATAPI drives do not set READY or SEEK */
-        s->status = 0x00;
-    }
+    /* perform diagnostic */
+    cmd_exec_dev_diagnostic(s, WIN_DIAGNOSE);
  }

  static void ide_bus_perform_srst(void *opaque)
@@ -2282,9 +2280,7 @@  void ide_ctrl_write(void *opaque, uint32_t addr, uint32_t val)

      /* Device0 and Device1 each have their own control register,
       * but QEMU models it as just one register in the controller. */
-    if ((bus->cmd & IDE_CTRL_RESET) &&
-        !(val & IDE_CTRL_RESET)) {
-        /* SRST triggers on falling edge */
+    if (!(bus->cmd & IDE_CTRL_RESET) && (val & IDE_CTRL_RESET)) {
          for (i = 0; i < 2; i++) {
              s = &bus->ifs[i];
              s->status |= BUSY_STAT;