mirror of
https://git.missingno.dev/kolibrios-nvme-driver/
synced 2025-01-01 18:44:31 +01:00
fix: shutdown all NVMe controllers
This commit is contained in:
parent
763bf37d29
commit
e78be21c18
@ -1384,13 +1384,7 @@ proc nvme_cleanup
|
|||||||
cmp ebx, LAST_QUEUE_ID
|
cmp ebx, LAST_QUEUE_ID
|
||||||
jbe .get_queue
|
jbe .get_queue
|
||||||
pop ebx
|
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
|
; Shutdown the controller
|
||||||
mov edi, dword [esi + pcidev.io_addr]
|
mov edi, dword [esi + pcidev.io_addr]
|
||||||
mov eax, dword [edi + NVME_MMIO.CC]
|
mov eax, dword [edi + NVME_MMIO.CC]
|
||||||
@ -1404,6 +1398,10 @@ proc nvme_cleanup
|
|||||||
test byte [edi + NVME_MMIO.CSTS], CSTS_SHST_SHUTDOWN_COMPLETE
|
test byte [edi + NVME_MMIO.CSTS], CSTS_SHST_SHUTDOWN_COMPLETE
|
||||||
jnz @b
|
jnz @b
|
||||||
|
|
||||||
|
inc ebx
|
||||||
|
cmp ebx, dword [num_pcidevs]
|
||||||
|
jne .get_pcidev
|
||||||
|
|
||||||
.ret:
|
.ret:
|
||||||
pop edi esi ebx
|
pop edi esi ebx
|
||||||
ret
|
ret
|
||||||
|
Loading…
Reference in New Issue
Block a user