From 4bacba431b45aa2d632dca7f3a5042ff7453f67e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Thu, 17 Nov 2022 13:49:28 +0100 Subject: [PATCH] nvme_drv: do not mask interrupts During interrupt handling the driver masked and cleared interrupts as recommended in the spec to prevent spurious or unnecessary interrupts from occurring. Due to the way the current implementation operates new Block requests got submitted while handling completions for already finished ones. Since interrupts where masked at this point the controller did not generate interrupts when the newly submitted requests got completed. As the mask/clear optimization is apparently not strictly needed and according to the spec undefined when using MSI-X it is removed. Fixes #4684 --- repos/os/src/drivers/nvme/main.cc | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/repos/os/src/drivers/nvme/main.cc b/repos/os/src/drivers/nvme/main.cc index 44ed8d7ffb..3b3d55ac98 100644 --- a/repos/os/src/drivers/nvme/main.cc +++ b/repos/os/src/drivers/nvme/main.cc @@ -1082,11 +1082,12 @@ class Nvme::Controller : Platform::Device, /** * Clean interrupts */ - void clear_intr() - { - write(1); - ack(); - } + void clear_intr() { write(1); } + + /** + * Acknowledge interrupt + */ + void ack_irq() { Platform::Device::Irq::ack(); } /* * Identify NVM system @@ -1798,14 +1799,9 @@ class Nvme::Driver : Genode::Noncopyable _submits_pending = true; } - void mask_irq() - { - _nvme_ctrlr.mask_intr(); - } - void ack_irq() { - _nvme_ctrlr.clear_intr(); + _nvme_ctrlr.ack_irq(); } bool execute() @@ -1869,7 +1865,6 @@ struct Nvme::Main : Rpc_object> void _handle_irq() { - _driver.mask_irq(); _handle_requests(); _driver.ack_irq(); }