2
0
mirror of https://git.missingno.dev/kolibrios-nvme-driver/ synced 2024-12-30 01:33:09 +01:00

fix: shutdown all NVMe controllers

This commit is contained in:
Abdur-Rahman Mansoor 2024-08-23 12:21:36 -04:00
parent 763bf37d29
commit e78be21c18
Signed by: ramenu
GPG Key ID: 8D15FCF6795779C8

View File

@ -1384,13 +1384,7 @@ proc nvme_cleanup
cmp ebx, LAST_QUEUE_ID
jbe .get_queue
pop ebx
inc ebx
cmp ebx, dword [num_pcidevs]
jne .get_pcidev
; NOTE: This code has a bug! It only shuts down the last
; controller, not all of them. Move this inside the loop
; and check if the device is actually valid.
; Shutdown the controller
mov edi, dword [esi + pcidev.io_addr]
mov eax, dword [edi + NVME_MMIO.CC]
@ -1404,6 +1398,10 @@ proc nvme_cleanup
test byte [edi + NVME_MMIO.CSTS], CSTS_SHST_SHUTDOWN_COMPLETE
jnz @b
inc ebx
cmp ebx, dword [num_pcidevs]
jne .get_pcidev
.ret:
pop edi esi ebx
ret