-
Notifications
You must be signed in to change notification settings - Fork 349
dma-trace: Allow DMA re-configuration #4850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dma-trace: Allow DMA re-configuration #4850
Conversation
|
What is the simplest way to test this? |
my wip branch is kept up to date with sof-dev: Build it, reboot if needed. And repeat the module removal/insert |
a58736b to
1074b03
Compare
After 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
ac94e38
Compare
|
Changes since v1:
|
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hapy to merge alongside #4849 or this one first. Let me know.
|
Seems CI is stuck. Restart it. |
|
SOFCI TEST |
src/trace/dma-trace.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could adding some reference to the channel in the log be helpful?
ac94e38 to
c30112b
Compare
|
Changes since v2:
|
src/trace/dma-trace.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just use else if to avoid repeating err == 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
69f2d54
Compare
|
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