Skip to content

Conversation

@ujfalusi
Copy link
Contributor

The host buffer default or minimum size can be platform dependent and it is not know by the host.
It is in sole discretion of the firmware and the hardware where it is running and can be changed by recompiling the firmware.

Add new tlv item to fw_config with ID 33 and store the host DMA default period size, which is the indication of the default, minimum size of the host buffer in ms.

@tmleman
Copy link
Contributor

tmleman commented Sep 23, 2025

fyi @abonislawski

Copy link
Contributor

@tmleman tmleman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code itself looks fine. I'm temporarily blocking it before merging to confirm that adding the new ID has been discussed internally.

@lgirdwood
Copy link
Member

The code itself looks fine. I'm temporarily blocking it before merging to confirm that adding the new ID has been discussed internally.

@tmleman whats your ETA for this, will need this as part of v2.14 as it fixes some use cases.

@abonislawski
Copy link
Member

Thanks @tmleman, id 33 is indeed available right now but this needs to be agreed and reserved in parallel to merge this and avoid future mismatch.

__cold static uint32_t get_host_buffer_size(void)
{
struct sof_dma *dma_host;
uint32_t periods;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can omit calling assert_can_be_cold() if this is a static function and all the callers have called it - as is the case here. But let's at least make a comment about it to make sure this isn't broken in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a comment would not stop misuse of this function, which is a helper to be used by basefw_config()
I will add the assert_can_be_cold() instead of a comment.

@ujfalusi ujfalusi force-pushed the peter/pr/host-buffer-size-01 branch from e70bee7 to ffb406f Compare September 24, 2025 07:55
The host buffer default or minimum size can be platform dependent and it is
not know by the host.
It is in sole discretion of the firmware and the hardware where it is
running and can be changed by recompiling the firmware.

Add new tlv item to fw_config with ID 33 and store the host DMA default
period size, which is the indication of the default, minimum size of the
host buffer in ms.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
@ujfalusi
Copy link
Contributor Author

Changes since v1:

  • add assert_can_be_cold() to the new helper function

@softwarecki
Copy link
Collaborator

Slightly off-topic, but I just remembered something. Some time ago, someone added a parameter to IPC for specifying the stack size of the DP thread. I recently noticed that this information is already provided in the module manifest, but SOF doesn't recognize it because the field in the manifest structure have a different name. We've also added new module type values for llext. A sync with the reference firmware is necessary.

@lgirdwood
Copy link
Member

Slightly off-topic, but I just remembered something. Some time ago, someone added a parameter to IPC for specifying the stack size of the DP thread. I recently noticed that this information is already provided in the module manifest, but SOF doesn't recognize it because the field in the manifest structure have a different name. We've also added new module type values for llext. A sync with the reference firmware is necessary.

Linux wont use manifest for runtime configuration data if data is also available in topology, yes manifest should be supported, but can be overridden via topology on Linux based OSes.

@lgirdwood
Copy link
Member

Thanks @tmleman, id 33 is indeed available right now but this needs to be agreed and reserved in parallel to merge this and avoid future mismatch.

Great - is this now reserved ?

@ujfalusi
Copy link
Contributor Author

Thanks @tmleman, id 33 is indeed available right now but this needs to be agreed and reserved in parallel to merge this and avoid future mismatch.

Great - is this now reserved ?

No yet.

Comment on lines +376 to +377
/* Minimum size of host buffer in ms */
IPC4_FW_MIN_HOST_BUFFER_PERIODS = 33,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is agreement to reserve this value, so there's no reason for me to keep my change request.

Copy link
Collaborator

@softwarecki softwarecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lgirdwood lgirdwood merged commit 9a6ee49 into thesofproject:main Oct 6, 2025
35 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants