[HDAUDBUS] Add a timeout into HDA_SendVerbs

This function may stuck during device installation if there are issues
with interrupts (or with a device itself).

This fixes the boot on my testing ThinkPad x60s
This commit is contained in:
Victor Perevertkin 2020-11-03 23:18:14 +03:00
parent da4ee18cc9
commit 48b3c61b5d
No known key found for this signature in database
GPG key ID: C750B7222E9C7830

View file

@ -176,11 +176,20 @@ HDA_SendVerbs(
while (Queued--)
{
KeWaitForSingleObject(&Codec->ResponseSemaphore,
Executive,
KernelMode,
FALSE,
NULL);
LARGE_INTEGER Timeout;
Timeout.QuadPart = -1000LL * 10000; // 1 sec
NTSTATUS waitStatus = KeWaitForSingleObject(&Codec->ResponseSemaphore,
Executive,
KernelMode,
FALSE,
&Timeout);
if (waitStatus == STATUS_TIMEOUT)
{
DPRINT1("HDA_SendVerbs: timeout! Queued: %u\n", Queued);
break;
}
}
if (Responses != NULL) {