diff --git a/Staging/AudioDxe/HdaController/HdaController.c b/Staging/AudioDxe/HdaController/HdaController.c index 43252a0e..843f0aa4 100644 --- a/Staging/AudioDxe/HdaController/HdaController.c +++ b/Staging/AudioDxe/HdaController/HdaController.c @@ -250,7 +250,7 @@ HdaControllerInitPciHw( return Status; } } else if (GET_PCI_VENDOR_ID (HdaControllerDev->VendorId) == VEN_VMWARE_ID) { - HdaControllerDev->Quirks |= HDA_CONTROLLER_QUIRK_VMWARE; + HdaControllerDev->Quirks |= HDA_CONTROLLER_QUIRK_CORB_NO_POLL_RESET; } // diff --git a/Staging/AudioDxe/HdaController/HdaController.h b/Staging/AudioDxe/HdaController/HdaController.h index 735155a8..f6c6787a 100644 --- a/Staging/AudioDxe/HdaController/HdaController.h +++ b/Staging/AudioDxe/HdaController/HdaController.h @@ -279,26 +279,34 @@ typedef struct { // at all. Unfortunately, this has to be set for all systems because CORB/RIRB must be // set up to detect that we are on QEMU (at least if we rely only on reported controller // and codec vendor ids, since QEMU controller incorrectly reports as Intel). +// TODO: If this causes problems, we may be able to use the previous quirk (which was +// commented out, but worked somewhat) of setting RINTCNT to 0xFF, in order to make +// QEMU run long enough to detect that it is QEMU and then only fully enable the rest +// of this quirk when needed. // Problem: // https://github.com/qemu/qemu/blob/a3607d/hw/audio/intel-hda.c#L331 // Only available work-around: // https://github.com/qemu/qemu/blob/a3607d/hw/audio/intel-hda.c#L561 // -#define HDA_CONTROLLER_QUIRK_QEMU_1 BIT0 +#define HDA_CONTROLLER_QUIRK_QEMU_1 BIT0 // // Stream reset does not stay high when set. // REF: https://gitlab.com/qemu-project/qemu/-/issues/757 // -#define HDA_CONTROLLER_QUIRK_QEMU_2 BIT1 +#define HDA_CONTROLLER_QUIRK_QEMU_2 BIT1 // -// CORB reset does not stay high when set. +// CORB reset does not stay high when set; affects VMware Fusion, but also +// affects some real hardware: +// REF: https://github.com/acidanthera/bugtracker/issues/1908 +// For some years AudioDxe had this as default behaviour, and despite not +// being to Intel HDA spec., it seems like retaining this may work best. // -#define HDA_CONTROLLER_QUIRK_VMWARE BIT2 +#define HDA_CONTROLLER_QUIRK_CORB_NO_POLL_RESET BIT2 #define HDA_CONTROLLER_QUIRK_INITIAL ( \ - HDA_CONTROLLER_QUIRK_QEMU_1 \ + HDA_CONTROLLER_QUIRK_QEMU_1 | HDA_CONTROLLER_QUIRK_CORB_NO_POLL_RESET \ ) struct _HDA_CONTROLLER_DEV { diff --git a/Staging/AudioDxe/HdaController/HdaControllerMem.c b/Staging/AudioDxe/HdaController/HdaControllerMem.c index 54ef2958..67a6e8f2 100644 --- a/Staging/AudioDxe/HdaController/HdaControllerMem.c +++ b/Staging/AudioDxe/HdaController/HdaControllerMem.c @@ -307,7 +307,7 @@ HdaControllerResetRingBuffer ( if (EFI_ERROR (Status)) { return Status; } - if (!(HdaRingBuffer->HdaDev->Quirks & HDA_CONTROLLER_QUIRK_VMWARE)) { + if (!(HdaRingBuffer->HdaDev->Quirks & HDA_CONTROLLER_QUIRK_CORB_NO_POLL_RESET)) { Status = PciIo->PollMem (PciIo, EfiPciIoWidthUint16, PCI_HDA_BAR, HDA_REG_CORBRP, HDA_REG_CORBRP_RST, HDA_REG_CORBRP_RST, MS_TO_NANOSECONDS (50), &HdaRingPointerPollResult); if (EFI_ERROR (Status)) { return Status;