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

hda: separation of l1 settings to power manager #66042

Merged

Conversation

fkwasowi
Copy link
Contributor

@fkwasowi fkwasowi commented Dec 1, 2023

Separating two new functions force and allow l1 to have the current state with separated functions in the power manager so that SOF can call these functions via IPC DMI_FORCE_L1_EXIT. Change related to the addition of a new parameter to force DMI L1 exit on IPC request.

Associated with: https://github.com/thesofproject/sof/pull/8561/files

Copy link
Collaborator

@teburd teburd left a comment

Choose a reason for hiding this comment

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

This appears to be moving some ace specifics into power management for all of Zephyr while not actually changing the logic involved.

If soc specifics are needed in sof then those need to be exposed through the soc headers not through the general pm device header.

Copy link
Member

@ceolin ceolin left a comment

Choose a reason for hiding this comment

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

This adsp specific logic and should never be part of Zephyr's device pm interface.

@fkwasowi
Copy link
Contributor Author

fkwasowi commented Dec 7, 2023

This appears to be moving some ace specifics into power management for all of Zephyr while not actually changing the logic involved.

If soc specifics are needed in sof then those need to be exposed through the soc headers not through the general pm device header.

I changed the location of the function to soc/xtensa/intel_adsp/common/include/intel_adsp_ipc.h

@fkwasowi
Copy link
Contributor Author

fkwasowi commented Dec 7, 2023

This adsp specific logic and should never be part of Zephyr's device pm interface.

I changed the location of the function to soc/xtensa/intel_adsp/common/include/intel_adsp_ipc.h

@fkwasowi fkwasowi closed this Dec 7, 2023
@fkwasowi fkwasowi force-pushed the prv-fkwasowi_l1_exit_ipc branch from f1515a9 to 9a193ac Compare December 7, 2023 15:24
@fkwasowi
Copy link
Contributor Author

Direct Media Interface

Yes. It's about Direct Media Interface

@kv2019i
Copy link
Collaborator

kv2019i commented Dec 12, 2023

@marc-hb wrote:

shouldn't these functions be called intel_adsp_ipc_allow_dma_l1_state and intel_adsp_ipc_allow_dma_l0_state ?
Is this maybe Direct Media Interface (PCI) link state?

I don't think it doesn't matter much here. The property we are setting is really tied to DMA (not typo) here. Behind the DMA, there will be DMI in the end, but from the point of view of the DSP, this difference has little practical meaning.

@marc-hb
Copy link
Collaborator

marc-hb commented Dec 12, 2023

When you run west grep -i dmi.*l1, you really don't want to miss one spot.

Names look good to me now.

Copy link
Contributor

@iganakov iganakov left a comment

Choose a reason for hiding this comment

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

Looks good to me

@abonislawski
Copy link
Member

Looks fine, I would just remove "ipc" from function names, it seems unrelated

Separating two new functions force and allow l1
to have the current state with separated functions
in the ipc file so that SOF can call these
functions via IPC DMI_FORCE_L1_EXIT. Change related
to the addition of a new parameter to force
DMI L1 exit on IPC request.

Signed-off-by: Fabiola Kwasowiec <fabiola.kwasowiec@intel.com>
@fkwasowi fkwasowi force-pushed the prv-fkwasowi_l1_exit_ipc branch from aa1d95f to 869c9ca Compare December 13, 2023 08:17
@mwasko
Copy link
Collaborator

mwasko commented Dec 13, 2023

@nashif @ceolin can we proceed with merge?

@nashif nashif assigned nashif and unassigned ceolin Dec 13, 2023
@carlescufi carlescufi merged commit 431da79 into zephyrproject-rtos:main Dec 13, 2023
@marc-hb
Copy link
Collaborator

marc-hb commented Dec 13, 2023

This fails to compile for LNL:

https://github.com/thesofproject/sof/actions/runs/7196263630/job/19600738125?pr=8618

-o zephyr/drivers/dma/CMakeFiles/drivers__dma.dir/dma_intel_adsp_hda.c.obj -c /zep_workspace/zephyr/drivers/dma/dma_intel_adsp_hda.c
In file included from /zep_workspace/zephyr/drivers/dma/dma_intel_adsp_hda.c:28:
/zep_workspace/zephyr/soc/xtensa/intel_adsp/common/include/intel_adsp_hda.h: In function 'intel_adsp_force_dmi_l0_state':
/zep_workspace/zephyr/soc/xtensa/intel_adsp/common/include/intel_adsp_hda.h:448:30: error: 'ADSP_FORCE_DECOUPLED_HDMA_L1_EXIT_BIT' undeclared (first use in this function)
  448 |         ACE_DfPMCCH.svcfg |= ADSP_FORCE_DECOUPLED_HDMA_L1_EXIT_BIT;
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/zep_workspace/zephyr/soc/xtensa/intel_adsp/common/include/intel_adsp_hda.h:448:30: note: each undeclared identifier is reported only once for each function it appears in
/zep_workspace/zephyr/soc/xtensa/intel_adsp/common/include/intel_adsp_hda.h: In function 'intel_adsp_allow_dmi_l1_state':
/zep_workspace/zephyr/soc/xtensa/intel_adsp/common/include/intel_adsp_hda.h:455:32: error: 'ADSP_FORCE_DECOUPLED_HDMA_L1_EXIT_BIT' undeclared (first use in this function)
  455 |         ACE_DfPMCCH.svcfg &= ~(ADSP_FORCE_DECOUPLED_HDMA_L1_EXIT_BIT);
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@marc-hb
Copy link
Collaborator

marc-hb commented Dec 14, 2023

By using ADSP_FORCE_DECOUPLED_HDMA_L1_EXIT_BIT in a common .h file, this commit
introduces a new requirement:

=> now ADSP_FORCE_DECOUPLED_HDMA_L1_EXIT_BIT must always be defined, even when CONFIG_DMA_INTEL_ADSP_HDA_TIMING_L1_EXIT is false.

Is this new requirement OK?

Of course another question is: why is CONFIG_DMA_INTEL_ADSP_HDA_TIMING_L1_EXIT false on LNL? But that's a different question.

@marc-hb
Copy link
Collaborator

marc-hb commented Jun 4, 2024

Of course another question is: why is CONFIG_DMA_INTEL_ADSP_HDA_TIMING_L1_EXIT false on LNL? But that's a different question.

5 months and probably a lot of wasted time later:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: DMA Direct Memory Access area: Power Management platform: Intel ADSP Intel Audio platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.