-
Notifications
You must be signed in to change notification settings - Fork 133
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
ASoC: SOF: Intel: hda: Add support for persistent Code Loader DMA buffers #5182
ASoC: SOF: Intel: hda: Add support for persistent Code Loader DMA buffers #5182
Conversation
b081c9d
to
4e0def8
Compare
Changes since v1:
|
4e0def8
to
9c76e97
Compare
Changes since v2:
|
I very painfully found this error buried deep down in the Jenkins logs. See internal issue 607 for more details. It's failing only the NOCODEC build, the regular build is fine. Yet Jenkins thinks the build was fine, keeps going and that's why things get super confusing. Considering Jenkins is basically orphaned, you want to add the NODEC build to Github Actions. It shouldn't be hard, I can review if you want.
|
SOFCI TEST |
BTW you should really use a |
9c76e97
to
d340693
Compare
SOFCI TEST |
d340693
to
1eab284
Compare
Changes since v3:
|
5d9fc9b
to
a7abc5d
Compare
Changes since v4:
|
if (hda->cl_dmab.area) | ||
snd_dma_free_pages(&hda->cl_dmab); | ||
if (hda->iccmax_dmab.area) | ||
snd_dma_free_pages(&hda->iccmax_dmab); |
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.
I don't fully remember the iccmax details but would it be possible to use the same trick and use the same buffer as for regular firmware?
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.
I rather not mix the two, while iccmax afaik is not running a capture, the buffer needs to be valid before we set up the code loader DMA.
I think it would result rather confusing code to follow what is going on.
sound/soc/sof/intel/hda.h
Outdated
/* | ||
* DMA buffers for base firmware download. By default the buffers are | ||
* allocated once and kept through the lifetime of the driver. | ||
* See module parameter: keep_firmware_dma_buffer |
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.
where is this module parameter defined?
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.
good catch, I renamed the parameter at the last time and missed this comment.
sound/soc/sof/intel/hda-loader.c
Outdated
* Copy the payload to the DMA buffer if it is temporary or if the | ||
* buffer is persistent but it does not have the basefw payload either | ||
* because this is the first time and needs to be initialized or a | ||
* library got loaded since the last basefw boot. |
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.
this comment is not easy to follow. What are we trying to say here? Also, if I understand the patch correctly, we're trying to propose to only keep the code loader DMA buffer allocation be pesistent isnt it? Why not then use the temp dmab in the iccmax and the library cases so that we never use the same buffer in those cases?
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.
We are using the cl_dmab for basefw and library.
For iccmax I rather not use the same buffer by principle, iccmax is capture stream, code loader is playback for one.
We allocate iccmax stream first (with the buffer) and then the buffer for code loader, for iccmax we use one page, which rarely enough for the firmware, so we would need to free and allocate a new buffer, thus re-configure iccmax, but this will bring up other issues.
If we overlook that we would need to allocate by-directional DMA memory and absolutely be certain that iccmax is not capturing data (which it should not afaik) then we still need quite a big refactoring to do just to flip over the allocation flow for basefw.
For me the use the same buffer for playback and capture which sounds off limits.
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.
Agree with Peter, the iccmax thing is a work-around only needed on a small set of platforms, it's best to keep a different buffer for iccmax capture and avoid mixing different types of uses.
…fers It has been reported that the DMA memory allocation for firmware download can fail after extended period of uptime on systems with relatively small amount of RAM when the system memory becomes fragmented. The issue primarily happens when the system is waking up from system suspend, swap might not be available and the MM system cannot move things around to allow for successful allocation. If the IMR boot is not supported then for each DSP boot we would need to allocate the DMA buffer for firmware transfer, which can increase the chances of the issue to be hit. This patch adds support for allocating the DMA buffers once at first boot time and keep it until the system is shut down, rebooted or the drivers re-loaded and makes this as the default operation. With persistent_cl_buffer module parameter the persistent Code Loader DMA buffer can be disabled to fall back to on demand allocation. Signed-off-by: Peter Ujfalusi <[email protected]>
a7abc5d
to
14f4161
Compare
Changes since v5:
|
Hi,
every now and then we see the DMA buffer allocation failure coming back [1]. While the issue is not originating from SOF stack, it does pops up from the logs.
It has been reported that the DMA memory allocation for firmware download
can fail after extended period of uptime on systems with relatively small
amount of RAM when the system memory becomes fragmented.
The issue primarily happens when the system is waking up from system
suspend, swap might not be available and the MM system cannot move things
around to allow for successful allocation.
If the IMR boot is not supported then for each DSP boot we would need to
allocate the DMA buffer for firmware transfer, which can increase the
chances of the issue to be hit.
This patch adds support for allocating the DMA buffers once at first boot
time and keep it until the system is shut down, rebooted or the drivers
re-loaded and makes this as the default operation.
With persistent_cl_buffer module parameter the persistent Code Loader
DMA buffer can be disabled to fall back to on demand allocation.
[1] #5161