-
Notifications
You must be signed in to change notification settings - Fork 308
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
Conversation
Can one of the admins verify this patch?
|
@DINESHKUMARK1 Can you check the CI first, lot of build errors across multiple targets. |
@@ -22,10 +22,15 @@ | |||
#include <stddef.h> |
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.
Can you please add more details about what 'probe' functionality is?
Is the ability to get some statistics/logs via compress interface?
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.
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
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.
@dbaluta its already used on Intel platforms. Kernel parts also upstream.
src/drivers/amd/common/acp_dma.c
Outdated
if (probe_pos >= (PROBE_BUFFER_WATERMARK)) { | ||
io_reg_write((PU_REGISTER_BASE + | ||
ACP_FUTURE_REG_ACLK_0), | ||
(PROBE_UPDATE_POS_MASK | probe_pos_update)); |
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.
3 instances of superfluous parentheses on 4 lines
src/lib/notifier.c
Outdated
@@ -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(¬ify->list[NOTIFIER_ID_BUFFER_PRODUCE]); | |||
#endif |
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.
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()
src/drivers/amd/vangogh/acp_dma.c
Outdated
dma_cfg->wr_size = 0; | ||
else | ||
dma_cfg->wr_size = dma_cfg->size; | ||
} |
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.
wrong indentation
@@ -184,8 +184,6 @@ int dma_copy_new(struct dma_copy *dc) | |||
return 0; | |||
} | |||
|
|||
#if CONFIG_DMA_GW | |||
|
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 config is not AMD specific, if AMD platform want to use this, better to add this config to AMD build?
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.
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.
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.
yeah, this is fine - its mostly generic if anyone is using a DMA tag to identify a DMA channel.
src/drivers/amd/common/acp_dma.c
Outdated
@@ -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; |
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.
uint32_t *p = NULL; -=-> uint32_t *p;
src/drivers/amd/common/acp_dma.c
Outdated
@@ -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) { |
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.
may be can delete p, directly use dma->priv_data
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.
LGTM, just 1 question on notifier.
@@ -184,8 +184,6 @@ int dma_copy_new(struct dma_copy *dc) | |||
return 0; | |||
} | |||
|
|||
#if CONFIG_DMA_GW | |||
|
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.
yeah, this is fine - its mostly generic if anyone is using a DMA tag to identify a DMA channel.
src/lib/notifier.c
Outdated
@@ -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 |
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.
oh, can you confirm we have the opposite list_add() call for this notifier using the same #ifdef CONFIG_PROBE kconfig ?
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.
only for list_item_del(¬ify->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
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.
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.
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.
Quick look at the API means we need to call notifier_unregister()
and pass in NOTIFIER_ID_BUFFER_PRODUCE
as type.
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.
Updated the patch with proper fix and removed the macro config_probe.
@@ -22,10 +22,15 @@ | |||
#include <stddef.h> |
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.
@dbaluta its already used on Intel platforms. Kernel parts also upstream.
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.
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/lib/notifier.c
Outdated
@@ -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 |
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.
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>
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.
Thanks @DINESHKUMARK1 , looks good now!
SOFCI TEST |
@wszypelt Can you check the quickbuild fails, 5 days with no results..? |
@kv2019i It seems that the request was not queued, anyway I turned it on manually, the results should be available within an hour |
Enabling probe feature on Vangogh and Rembrandt Platforms.