[haiku-commits] Change in haiku[master]: hda: Unconfigure the MSI as well.

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 22 Jul 2020 21:34:57 +0000

From Michael Lotz <mmlr@xxxxxxxx>:

Michael Lotz has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/3060 ;)


Change subject: hda: Unconfigure the MSI as well.
......................................................................

hda: Unconfigure the MSI as well.

Just disabling it will leak the vector reservation and makes it
impossible to configure an MSI on the device again.

Also removes the check for the gPCIx86Module as having an MSI configured
really implies its presence.
---
M src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
1 file changed, 5 insertions(+), 1 deletion(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/60/3060/1

diff --git a/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp 
b/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
index 8ffb6f7..a59f90d 100644
--- a/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
+++ b/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
@@ -1209,6 +1209,8 @@
        if (controller->msi) {
                gPCIx86Module->disable_msi(controller->pci_info.bus,
                        controller->pci_info.device, 
controller->pci_info.function);
+               gPCIx86Module->unconfigure_msi(controller->pci_info.bus,
+                       controller->pci_info.device, 
controller->pci_info.function);
        }

        delete_area(controller->regs_area);
@@ -1254,10 +1256,12 @@
        // Disable interrupts, and remove interrupt handler
        controller->Write32(HDAC_INTR_CONTROL, 0);

-       if (controller->msi && gPCIx86Module != NULL) {
+       if (controller->msi) {
                // Disable MSI
                gPCIx86Module->disable_msi(controller->pci_info.bus,
                        controller->pci_info.device, 
controller->pci_info.function);
+               gPCIx86Module->unconfigure_msi(controller->pci_info.bus,
+                       controller->pci_info.device, 
controller->pci_info.function);
        }

        remove_io_interrupt_handler(controller->irq,

--
To view, visit https://review.haiku-os.org/c/haiku/+/3060
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I9f0e3e63c988af515d23ad93d86918cde9add97a
Gerrit-Change-Number: 3060
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Lotz <mmlr@xxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: hda: Unconfigure the MSI as well. - Gerrit