diff --git a/Kernel/Devices/PATAChannel.cpp b/Kernel/Devices/PATAChannel.cpp index d75a9292ee..877412741c 100644 --- a/Kernel/Devices/PATAChannel.cpp +++ b/Kernel/Devices/PATAChannel.cpp @@ -183,12 +183,19 @@ void PATAChannel::wait_for_irq() void PATAChannel::handle_irq(const RegisterState&) { - // FIXME: We might get random interrupts due to malfunctioning hardware, so we should check that we actually requested something to happen. - u8 status = m_io_base.offset(ATA_REG_STATUS).in(); m_entropy_source.add_random_event(status); + u8 bstatus = m_bus_master_base.offset(2).in(); + if (!(bstatus & 0x4)) { + // interrupt not from this device, ignore +#ifdef PATA_DEBUG + klog() << "PATAChannel: ignore interrupt"; +#endif + return; + } + if (status & ATA_SR_ERR) { print_ide_status(status); m_device_error = m_io_base.offset(ATA_REG_ERROR).in();