From 3d78f22409739129b05612697d46495dc11a731d Mon Sep 17 00:00:00 2001 From: Abdur-Rahman Mansoor Date: Fri, 26 Jul 2024 13:14:50 -0400 Subject: [PATCH] make sure interrupts are enabled in PCI header --- drivers/nvme/nvme.asm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/nvme/nvme.asm b/drivers/nvme/nvme.asm index 37157e4..d66c198 100644 --- a/drivers/nvme/nvme.asm +++ b/drivers/nvme/nvme.asm @@ -875,6 +875,13 @@ proc nvme_init stdcall, pci:dword push ebx esi edi mov esi, dword [pci] + + ; Check the PCI header to see if interrupts are disabled, if so + ; we have to re-enable them + invoke PciRead16, dword [esi + pcidev.bus], dword [esi + pcidev.devfn], PCI_header00.command + and eax, not (1 shl 10) + invoke PciWrite16, dword [esi + pcidev.bus], dword [esi + pcidev.devfn], PCI_header00.command, eax + mov edi, dword [esi + pcidev.io_addr] if 0