From 9f8c87f2ed610f5035c33bfafcd4ce21b0c43336 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Fri, 26 Sep 2014 09:29:40 +0200 Subject: [PATCH] ahci: ignore spurious interrupts Qemu 2.0 makes trouble when using seoul-disc.run - related to #1261 --- .../drivers/ahci/include/ahci_device_base.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/repos/os/src/drivers/ahci/include/ahci_device_base.h b/repos/os/src/drivers/ahci/include/ahci_device_base.h index d487755e93..6e8e5297f5 100644 --- a/repos/os/src/drivers/ahci/include/ahci_device_base.h +++ b/repos/os/src/drivers/ahci/include/ahci_device_base.h @@ -449,15 +449,19 @@ class Ahci_device_base /* write CI (command issue) slot 0 */ _port->cmd_issue(1); - /* wait for interrupt */ - _irq->wait_for_irq(); + uint32_t status = 0; + while (!status) { - if (verbose) - PDBG("Int status (IRQ): global: %x port: %x error: %x", - _ctrl->hba_intr_status(), _port->intr_status(), _port->err()); + /* wait for interrupt */ + _irq->wait_for_irq(); - /* acknowledge interrupt */ - uint32_t status = _port->interrupt_ack(); + if (verbose) + PDBG("Int status (IRQ): global: %x port: %x error: %x", + _ctrl->hba_intr_status(), _port->intr_status(), _port->err()); + + /* acknowledge interrupt */ + status = _port->interrupt_ack(); + } /* check for error */ enum {