From 8f5199f019e558c6a995a80037ec4b6c4262e1aa Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 18 Oct 2021 16:23:40 -0400 Subject: [PATCH] nvme_disk: Unconditionally mask off PCI_command_int_disable. Otherwise legacy interrupts do not work at all on x86. This fixes hrev55299, which contrary to the commit message, did not "add" legacy interrupts support; it was already there, and in fact that commit broke it on x86. --- src/add-ons/kernel/drivers/disk/nvme/nvme_disk.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/add-ons/kernel/drivers/disk/nvme/nvme_disk.cpp b/src/add-ons/kernel/drivers/disk/nvme/nvme_disk.cpp index 1d24e69ec0..5477d80ba1 100644 --- a/src/add-ons/kernel/drivers/disk/nvme/nvme_disk.cpp +++ b/src/add-ons/kernel/drivers/disk/nvme/nvme_disk.cpp @@ -295,6 +295,10 @@ nvme_disk_init_device(void* _info, void** _cookie) sPCIx86Module = NULL; } + command = pci->read_pci_config(pcidev, PCI_command, 2); + command &= ~(PCI_command_int_disable); + pci->write_pci_config(pcidev, PCI_command, 2, command); + uint8 irq = info->info.u.h0.interrupt_line; if (sPCIx86Module != NULL) { if (sPCIx86Module->get_msix_count(info->info.bus, info->info.device, @@ -318,10 +322,6 @@ nvme_disk_init_device(void* _info, void** _cookie) irq = msiVector; } } - } else { - uint16 command = pci->read_pci_config(pcidev, PCI_command, 2); - command &= ~(PCI_command_int_disable); - pci->write_pci_config(pcidev, PCI_command, 2, command); } if (irq == 0 || irq == 0xFF) {