Uh oh!
There was an error while loading. Please reload this page.
dma-trace: Allow DMA re-configuration - #4850
Conversation
marc-hb
commented
Oct 6, 2021
What is the simplest way to test this? |
ujfalusi
commented
Oct 6, 2021
my wip branch is kept up to date with sof-dev: Build it, reboot if needed. And repeat the module removal/insert |
Uh oh!
There was an error while loading. Please reload this page.
a58736b to
1074b03CompareAfter the dma_copy_set_stream_tag() a DMA channel is requested, release it in any of the error cases later. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1074b03 to
ac94e38Compareujfalusi
commented
Oct 7, 2021
Changes since v1:
|
lgirdwood
commented
Oct 7, 2021
Seems CI is stuck. Restart it. |
lgirdwood
commented
Oct 7, 2021
SOFCI TEST |
There was a problem hiding this comment.
Could adding some reference to the channel in the log be helpful?
ac94e38 to
c30112bCompareujfalusi
commented
Oct 8, 2021
Changes since v2:
|
There was a problem hiding this comment.
just use else if to avoid repeating err == 0?
There was a problem hiding this comment.
Yes, that is a cleaner way.
The host will receive an error if it tries to re-configure the dtrace: [ 22736132.117381] ( 28.645832) c0 hda-dma ..../intel/hda/hda-dma.c:489 ERROR hda-dmac: 4 no free channel 0 [ 22736147.377797] ( 15.260416) c0 dma-copy src/ipc/dma-copy.c:163 ERROR dma_copy_set_stream_tag(): dc->chan is NULL [ 22736180.346545] ( 32.968750) c0 ipc src/ipc/ipc3/handler.c:805 ERROR ipc: failed to enable trace -22 Since we try to request an already used channel. If we skip the requesting then we will fail with the configuration: [ 31707957.542122] ( 27.447916) c0 dma-copy src/ipc/dma-copy.c:162 ERROR dma_copy_set_stream_tag(): already have chan for stream_tag 1 [ 31708021.917120] ( 64.375000) c0 hda-dma ..../intel/hda/hda-dma.c:539 ERROR hda-dmac: 4 channel 0 busy. dgcs 0x800000 status 5 [ 31708056.083785] ( 34.166664) c0 ipc src/ipc/ipc3/handler.c:805 ERROR ipc: failed to enable trace -16 To support the reconfiguration: if we have DMA channel for dtrace, stop it to allow the reconfiguration. In the unlikely case when the stream_id has changed, release the channel as well and request a new one. Tested with the SOF client kernel by rmmod and modprobe the dtrace client during active audio playback to prevent the DSP to be turned off. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
c30112b to
69f2d54Compareujfalusi
commented
Oct 8, 2021
Changes since v3:
|
The host will receive an error if it tries to re-configure the dtrace:
[ 22736132.117381] ( 28.645832) c0 hda-dma ..../intel/hda/hda-dma.c:489 ERROR hda-dmac: 4 no free channel 0
[ 22736147.377797] ( 15.260416) c0 dma-copy src/ipc/dma-copy.c:163 ERROR dma_copy_set_stream_tag(): dc->chan is NULL
[ 22736180.346545] ( 32.968750) c0 ipc src/ipc/ipc3/handler.c:805 ERROR ipc: failed to enable trace -22
Since we try to request an already used channel. If we skip the requesting
then we will fail with the configuration:
[ 31707957.542122] ( 27.447916) c0 dma-copy src/ipc/dma-copy.c:162 ERROR dma_copy_set_stream_tag(): already have chan for stream_tag 1
[ 31708021.917120] ( 64.375000) c0 hda-dma ..../intel/hda/hda-dma.c:539 ERROR hda-dmac: 4 channel 0 busy. dgcs 0x800000 status 5
[ 31708056.083785] ( 34.166664) c0 ipc src/ipc/ipc3/handler.c:805 ERROR ipc: failed to enable trace -16
To support the reconfiguration:
if we have DMA channel for dtrace, stop it to allow the reconfiguration.
In the unlikely case when the stream_id has changed, release the channel
as well and request a new one.
Tested with the SOF client kernel by rmmod and modprobe the dtrace client
during active audio playback to prevent the DSP to be turned off.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com