[haiku-commits] Change in haiku[master]: hda: Wait for streams to actually start/stop.

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

From Michael Lotz <mmlr@xxxxxxxx>:

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


Change subject: hda: Wait for streams to actually start/stop.
......................................................................

hda: Wait for streams to actually start/stop.

In the start case this adds debug output in case a start fails.

For stops this makes sure the stream DMA engine has actually stopped
operating, which is a precondition for some other operations.
---
M src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
1 file changed, 10 insertions(+), 0 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/58/3058/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 c5219e0..ab06e03 100644
--- a/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
+++ b/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
@@ -725,6 +725,11 @@
                | CONTROL0_BUFFER_COMPLETED_INTR | CONTROL0_FIFO_ERROR_INTR
                | CONTROL0_DESCRIPTOR_ERROR_INTR | CONTROL0_RUN);

+       if (!wait_for_bits<8>(stream, HDAC_STREAM_CONTROL0, CONTROL0_RUN, 
true)) {
+               dprintf("hda: unable to start stream\n");
+               return B_BUSY;
+       }
+
        stream->running = true;
        return B_OK;
 }
@@ -743,6 +748,11 @@
        controller->Write32(HDAC_INTR_CONTROL, 
controller->Read32(HDAC_INTR_CONTROL)
                & ~(1 << (stream->offset / HDAC_STREAM_SIZE)));

+       if (!wait_for_bits<8>(stream, HDAC_STREAM_CONTROL0, CONTROL0_RUN, 
false)) {
+               dprintf("hda: unable to stop stream\n");
+               return B_BUSY;
+       }
+
        stream->running = false;

        return B_OK;

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

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

Other related posts:

  • » [haiku-commits] Change in haiku[master]: hda: Wait for streams to actually start/stop. - Gerrit