Skip to content
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

Enabling probe feature in AMD Platforms #8634

Merged
merged 7 commits into from
Jan 3, 2024
Merged

Enabling probe feature in AMD Platforms #8634

merged 7 commits into from
Jan 3, 2024

Conversation

DINESHKUMARK1
Copy link
Contributor

Enabling probe feature on Vangogh and Rembrandt Platforms.

@sofci
Copy link
Collaborator

sofci commented Dec 15, 2023

Can one of the admins verify this patch?

reply test this please to run this test once

@kv2019i
Copy link
Collaborator

kv2019i commented Dec 15, 2023

@DINESHKUMARK1 Can you check the CI first, lot of build errors across multiple targets.

@@ -22,10 +22,15 @@
#include <stddef.h>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please add more details about what 'probe' functionality is?

Is the ability to get some statistics/logs via compress interface?

Copy link
Contributor Author

@DINESHKUMARK1 DINESHKUMARK1 Dec 19, 2023

Choose a reason for hiding this comment

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

Hi,
This is a debug feature to probe the data in between components of pipeline, for more information find the below link

https://thesofproject.github.io/latest/developer_guides/debugability/probes/index.html

Copy link
Member

Choose a reason for hiding this comment

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

@dbaluta its already used on Intel platforms. Kernel parts also upstream.

src/drivers/amd/common/acp_dma.c Outdated Show resolved Hide resolved
if (probe_pos >= (PROBE_BUFFER_WATERMARK)) {
io_reg_write((PU_REGISTER_BASE +
ACP_FUTURE_REG_ACLK_0),
(PROBE_UPDATE_POS_MASK | probe_pos_update));
Copy link
Collaborator

Choose a reason for hiding this comment

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

3 instances of superfluous parentheses on 4 lines

@@ -109,6 +109,9 @@ void notifier_unregister(void *receiver, void *caller, enum notify_id type)
(!caller || handle->caller == caller)) {
if (!--handle->num_registrations) {
list_item_del(&handle->list);
#ifdef CONFIG_PROBE
list_item_del(&notify->list[NOTIFIER_ID_BUFFER_PRODUCE]);
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

Presumably this would be a bug fix. Are calls to

	notifier_unregister(_probe, dev->cb, NOTIFIER_ID_BUFFER_PRODUCE);

in probe.c not enough?

If this is indeed needed, then please move #ifdef / #endif to position 0, and reduce indentation of list_item_del()

dma_cfg->wr_size = 0;
else
dma_cfg->wr_size = dma_cfg->size;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

wrong indentation

@@ -184,8 +184,6 @@ int dma_copy_new(struct dma_copy *dc)
return 0;
}

#if CONFIG_DMA_GW

Copy link
Contributor

Choose a reason for hiding this comment

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

this config is not AMD specific, if AMD platform want to use this, better to add this config to AMD build?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Enabling CONFIG_DMA_GW will bring in many other API's which will cause failures in DMA operations and are not required on AMD platform, but dma_copy_set_stream_tag is required for enabling DMA channel based on stream tag, That is the reason to remove CONFIG_DMA_GW for this API, I believe this won't affect non AMD platforms.

Copy link
Member

Choose a reason for hiding this comment

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

yeah, this is fine - its mostly generic if anyone is using a DMA tag to identify a DMA channel.

@@ -49,6 +54,7 @@ void dma_config_descriptor(uint32_t dscr_start_idx, uint32_t dscr_count,
static struct dma_chan_data *acp_dma_channel_get(struct dma *dma,
unsigned int req_chan)
{
uint32_t *p = NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

uint32_t *p = NULL; -=-> uint32_t *p;

@@ -73,6 +79,18 @@ static struct dma_chan_data *acp_dma_channel_get(struct dma *dma,
acp_dma_chan->config[req_chan].rd_size = 0;
acp_dma_chan->config[req_chan].wr_size = 0;
acp_dma_chan->config[req_chan].size = 0;
acp_dma_chan->config[req_chan].probe_channel = 0xFF;
p = dma->priv_data;
if (p) {
Copy link
Contributor

Choose a reason for hiding this comment

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

may be can delete p, directly use dma->priv_data

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

LGTM, just 1 question on notifier.

@@ -184,8 +184,6 @@ int dma_copy_new(struct dma_copy *dc)
return 0;
}

#if CONFIG_DMA_GW

Copy link
Member

Choose a reason for hiding this comment

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

yeah, this is fine - its mostly generic if anyone is using a DMA tag to identify a DMA channel.

@@ -109,6 +109,9 @@ void notifier_unregister(void *receiver, void *caller, enum notify_id type)
(!caller || handle->caller == caller)) {
if (!--handle->num_registrations) {
list_item_del(&handle->list);
#ifdef CONFIG_PROBE
Copy link
Member

Choose a reason for hiding this comment

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

oh, can you confirm we have the opposite list_add() call for this notifier using the same #ifdef CONFIG_PROBE kconfig ?

Copy link
Contributor Author

@DINESHKUMARK1 DINESHKUMARK1 Dec 21, 2023

Choose a reason for hiding this comment

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

only for list_item_del(&notify->list[NOTIFIER_ID_BUFFER_PRODUCE]) is used as it is a bug for probe buffer in delete case and avoid side effects/issues in regular usecases

Copy link
Collaborator

Choose a reason for hiding this comment

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

There is probably a real bug here, but this does not look a correct fix. The probe code does notify unregister for NOTIFIER_ID_BUFFER_PRODUCE and NOTIFIER_ID_BUFFER_FREE, so the unconditional list_item_del seems out of place here.

Copy link
Member

Choose a reason for hiding this comment

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

Quick look at the API means we need to call notifier_unregister() and pass in NOTIFIER_ID_BUFFER_PRODUCE as type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the patch with proper fix and removed the macro config_probe.

@@ -22,10 +22,15 @@
#include <stddef.h>
Copy link
Member

Choose a reason for hiding this comment

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

@dbaluta its already used on Intel platforms. Kernel parts also upstream.

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

The series looks mostly good, but the git commit prefixes are not correct and the bugfix in "deregister NOTIFIER_ID_BUFFER_PRODUCE" does not look correct. I won-t leave a -1 as I'm OOO next week, but I think these needs to be addressed before merge.

src/probe/probe.c Show resolved Hide resolved
@@ -109,6 +109,9 @@ void notifier_unregister(void *receiver, void *caller, enum notify_id type)
(!caller || handle->caller == caller)) {
if (!--handle->num_registrations) {
list_item_del(&handle->list);
#ifdef CONFIG_PROBE
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is probably a real bug here, but this does not look a correct fix. The probe code does notify unregister for NOTIFIER_ID_BUFFER_PRODUCE and NOTIFIER_ID_BUFFER_FREE, so the unconditional list_item_del seems out of place here.

local dma_sg_config is not required,
struct probe_dma_ext holds the DMA config segments.

proper fix for notifier_unregister to remove the probe point functionality.

Signed-off-by: Kalva, DineshKumar <dineshkumar.kalva@amd.com>
Remove CONFIG_DMA_GW macro to use dma_copy_set_stream_tag function
to get dma channel on AMD platforms for probe.

Signed-off-by: Kalva, DineshKumar <dineshkumar.kalva@amd.com>
Add ACP_FUTURE_REG_ACLK_0 Register in AMD/Renoir Platform.

Signed-off-by: Kalva, DineshKumar <dineshkumar.kalva@amd.com>
Add ACP_FUTURE_REG_ACLK_0 Register in AMD/Acp_6_3 Platform.

Signed-off-by: Kalva, DineshKumar <dineshkumar.kalva@amd.com>
Add probe functionality in AMD/rembrandt platform.

Signed-off-by: Kalva, DineshKumar <dineshkumar.kalva@amd.com>
Add probe functionality in AMD/vangogh platform.

Signed-off-by: Kalva, DineshKumar <dineshkumar.kalva@amd.com>
Add probe functionality in AMD platforms.

Signed-off-by: Kalva, DineshKumar <dineshkumar.kalva@amd.com>
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

Thanks @DINESHKUMARK1 , looks good now!

@kv2019i
Copy link
Collaborator

kv2019i commented Jan 2, 2024

SOFCI TEST

@kv2019i
Copy link
Collaborator

kv2019i commented Jan 2, 2024

@wszypelt Can you check the quickbuild fails, 5 days with no results..?

@wszypelt
Copy link

wszypelt commented Jan 3, 2024

@kv2019i It seems that the request was not queued, anyway I turned it on manually, the results should be available within an hour

@kv2019i kv2019i merged commit cae1c3a into thesofproject:main Jan 3, 2024
43 of 44 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.

9 participants