During driver unload or module detach, the driver previously waited for
pending management IOCTLs to complete but capped the wait loop to a fixed
180-second timeout. If a long-running management command (such as firmware
flashing, diagnostic dump collection, or secure erase) took longer than 180
seconds, the detach sequence proceeded while the IOCTL was still actively
executing. This led to tearing down hardware resources, destroying mutexes,
and freeing driver memory structures while userland was still using them,
causing memory corruption.
Remove the arbitrary 180-second timeout and wait until all pending IOCTLs
have fully completed before proceeding with resource teardown. Because
all IOCTL commands have individual hardware timeouts, they are guaranteed
to complete or time out deterministically.