From b4d3c8248003478b6eccccaae75b191d1099b1b5 Mon Sep 17 00:00:00 2001 From: Abdur-Rahman Mansoor Date: Tue, 25 Jun 2024 14:29:09 -0400 Subject: [PATCH] fix: comment out excessive debug lines Printing too many messages to the screen much causes KolibriOS to crash, so we have to remove them for now --- drivers/nvme/nvme.asm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/nvme/nvme.asm b/drivers/nvme/nvme.asm index 81ce42b..c841aa6 100644 --- a/drivers/nvme/nvme.asm +++ b/drivers/nvme/nvme.asm @@ -179,7 +179,6 @@ proc is_active_namespace stdcall, pci:dword, nsid:dword @@: mov esi, eax invoke GetPhysAddr - DEBUGF DBG_INFO, "Identify Namespace: %u\n", [nsid] stdcall nvme_identify, [pci], [nsid], eax, CNS_IDNS xor ecx, ecx @@ -192,16 +191,13 @@ proc is_active_namespace stdcall, pci:dword, nsid:dword jne @b .not_active_nsid: - DEBUGF DBG_INFO, "Not an active NSID\n" invoke KernelFree, esi pop edi esi xor eax, eax ret .is_active_nsid: - ;DEBUGF DBG_INFO, "ACTIVE NSID: %u\n", [nsid] - ;cmp [nsid], 1 - ;jne @b + DEBUGF DBG_INFO, "(NVMe) Active NSID: %u\n", [nsid] invoke KernelFree, esi pop edi esi xor eax, eax @@ -717,6 +713,8 @@ proc nvme_init stdcall, pci:dword stdcall create_io_submission_queue, [pci], eax, 1, 1 stdcall determine_active_nsids, [pci] + test eax, eax + jz .exit_fail ; No active NSIDS DEBUGF DBG_INFO, "(NVMe) Successfully initialized driver!\n" xor eax, eax @@ -815,7 +813,7 @@ proc cqyhdbl_write stdcall, pci:dword, y:dword, cqh:word lea edi, dword [edi + ecx] mov esi, dword [esi + pcidev.io_addr] mov ax, [cqh] - DEBUGF DBG_INFO, "(NVMe) Writing to completion queue doorbell register 0x%x: %u\n", dx, ax + ;DEBUGF DBG_INFO, "(NVMe) Writing to completion queue doorbell register 0x%x: %u\n", dx, ax mov word [esi + edx], ax ; Write to CQyHDBL mov word [edi + NVM_QUEUE_ENTRY.head], ax pop edi esi @@ -858,7 +856,7 @@ proc sqytdbl_write stdcall, pci:dword, y:word, cmd:dword shl dx, cl imul dx, bx add dx, 0x1000 - DEBUGF DBG_INFO, "(NVMe) Writing to submission queue doorbell register 0x%x: %u\n", dx, ax + ;DEBUGF DBG_INFO, "(NVMe) Writing to submission queue doorbell register 0x%x: %u\n", dx, ax mov esi, dword [esi + pcidev.io_addr] mov word [esi + edx], ax movzx ecx, [y] @@ -948,6 +946,8 @@ proc is_queue_full stdcall, tail:word, head:word endp +;proc consume_cq_entries stdcall, + proc irq_handler push esi edi @@ -964,7 +964,7 @@ proc irq_handler mov esi, dword [esi + pcidev.queue_entries] movzx ecx, word [esi + NVM_QUEUE_ENTRY.head] movzx edx, word [esi + NVM_QUEUE_ENTRY.tail] - DEBUGF DBG_INFO, "IRQ (head): 0x%x, (tail): 0x%x\n", cx, dx + ;DEBUGF DBG_INFO, "IRQ (head): 0x%x, (tail): 0x%x\n", cx, dx stdcall is_queue_full, edx, ecx test eax, eax jnz .end @@ -975,7 +975,7 @@ proc irq_handler mov esi, dword [esi + NVM_QUEUE_ENTRY.cq_ptr] mov ax, word [esi + edx + CQ_ENTRY.status] and ax, not CQ_PHASE_TAG ; ignore phase tag bit - DEBUGF DBG_INFO, "(NVMe) Status: 0x%x\n", ax + ;DEBUGF DBG_INFO, "(NVMe) Status: 0x%x\n", ax test al, al ; check status code (0 on success) jz .ok