Skip to content

ALSA/ASoC: SOF: Intel: Use PIO mode fro HDA commands instead of CORB on Lunar Lake - #4844

Merged
lgirdwood merged 5 commits into
thesofproject:topic/sof-devfrom
ujfalusi:peter/sof/pr/lnl_hda_pio_commands_01
Mar 22, 2024
Merged

lgirdwood merged 5 commits into
thesofproject:topic/sof-devfrom
ujfalusi:peter/sof/pr/lnl_hda_pio_commands_01

Conversation

@ujfalusi

@ujfalusi ujfalusi commented Mar 5, 2024 •

Copy link
Copy Markdown
Collaborator

It is recommended to use Immediate Command Response (PIO mode) instead of CORB on Lunar Lake family for HDA commands.

This PR adds support for PIO mode commands while keeping RIRB functionality for receiving URs

@ujfalusi ujfalusi changed the title ALSA/ASoC: SOF: Intel: Use PIO mode fro HDA commands instead of CORB on Lunar Lake [DNM] ALSA/ASoC: SOF: Intel: Use PIO mode fro HDA commands instead of CORB on Lunar Lake Mar 5, 2024
@ujfalusi
ujfalusi force-pushed the peter/sof/pr/lnl_hda_pio_commands_01 branch from c7fc542 to 48dacbe Compare March 5, 2024 12:10
lgirdwood
lgirdwood previously approved these changes Mar 5, 2024
@ujfalusi
ujfalusi force-pushed the peter/sof/pr/lnl_hda_pio_commands_01 branch from 48dacbe to 3ff99ba Compare March 5, 2024 12:35
Comment thread include/sound/hdaudio.h Outdated
Comment thread sound/hda/hdac_controller.c Outdated
Comment thread sound/soc/sof/intel/hda-bus.c Outdated
Comment thread sound/hda/hdac_controller.c
@ujfalusi
ujfalusi force-pushed the peter/sof/pr/lnl_hda_pio_commands_01 branch from 3ff99ba to 4eaf1eb Compare March 6, 2024 09:35
@ujfalusi

ghost commented Mar 6, 2024 •

Copy link
Copy Markdown
Collaborator Author

Changes since v1:

  • separate the flag introduction
  • Add quirk flag for legacy to use: AZX_DCAPS_PIO_COMMANDS
  • do not export the new PIO send_cmd/get_response and select between CORB/RIRB and PIO in core code based on use_pio_for_commands flag
  • enable the PIO mode for LNL in legacy and SOF stack.
  • dropped the SOF patch to use snd_hdac_bus_exec_verb_unlocked() as the PIO vs CORB selection is done in core now.

@ujfalusi
ujfalusi force-pushed the peter/sof/pr/lnl_hda_pio_commands_01 branch from 4eaf1eb to 24ac85a Compare March 6, 2024 09:54
@ujfalusi

ghost commented Mar 6, 2024

Copy link
Copy Markdown
Collaborator Author

Changes since v2:

  • fix prototype comment for snd_hdac_bus_get_response_rirb()

ghost left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I only have cosmetic comments @ujfalusi this looks pretty good to me!

Comment thread sound/pci/hda/hda_intel.c Outdated
Comment thread sound/soc/sof/intel/hda-bus.c
Comment thread sound/pci/hda/hda_controller.c
@ujfalusi
ujfalusi force-pushed the peter/sof/pr/lnl_hda_pio_commands_01 branch from 24ac85a to 763f5fd Compare March 7, 2024 07:44
Peter Ujfalusi added 5 commits March 7, 2024 09:44
Add AZX_DCAPS_PIO_COMMANDS quirk (bit 31) and use_pio_for_commands flag to
be able to select PIO mode as alternative for CORB based command sending
while retaining the RIRB functionality to receive unsolicited responses.

This mode differs from the azx single_cmd mode when RIRB is disabled.

The mixed mode is needed on Lunar Lake family because it is recommended to
use Immediate Command Response (PIO mode) instead of CORB for HDA commands.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…s mode

In case the use_pio_for_commands flag is set we must not enable the
CORB DMA to make sure that it is not interfering with the immediate
command mode.

Convert the snd_hdac_bus_send_cmd/snd_hdac_bus_get_response as wrappers to
call either the PIO or CORB based command handling depending on the
use_pio_for_commands flag.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…mode

Set the use_pio_for_commands flag in case AZX_DCAPS_PIO_COMMANDS quirk is
enabled.

When the PIO command mode is used we can re-use the existing
azx_single_send_cmd() / azx_single_get_response() functions safely as the
CORB DMA is not going to be enabled in snd_hdac_bus_init_cmd_io().

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
It is recommended that on Lunar Lake the PIO (immediate command response)
is used instead of CORB/RIRB for commands/verbs.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
It is recommended that on Lunar Lake the PIO (immediate command response)
is used instead of CORB/RIRB for commands/verbs.

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

ghost commented Mar 7, 2024 •

Copy link
Copy Markdown
Collaborator Author

Changes since v3:

  • split the hdac_controller/hda_controller patch which implements support for use_pio_for_commands
  • Create AZX_DCAPS_INTEL_LNL for the quirk definition
  • taken out from draft

@ujfalusi
ujfalusi marked this pull request as ready for review March 7, 2024 07:46
@ujfalusi ujfalusi changed the title [DNM] ALSA/ASoC: SOF: Intel: Use PIO mode fro HDA commands instead of CORB on Lunar Lake ALSA/ASoC: SOF: Intel: Use PIO mode fro HDA commands instead of CORB on Lunar Lake Mar 7, 2024
@ujfalusi
ujfalusi requested a review from aiChaoSONG March 7, 2024 07:47
@plbossart
plbossart requested review from lgirdwood and ranj063 March 20, 2024 14:39
@plbossart

ghost commented Mar 20, 2024

Copy link
Copy Markdown
Member

@ujfalusi should we merge this?

@ujfalusi

ghost commented Mar 22, 2024

Copy link
Copy Markdown
Collaborator Author

@ujfalusi should we merge this?

I think we should and send it for 6.10 as early as possible to get feedback on the legacy HDA change.

@lgirdwood
lgirdwood merged commit 9bb1cad into thesofproject:topic/sof-dev Mar 22, 2024
@marc-hb

ghost commented Mar 29, 2024

Copy link
Copy Markdown
Collaborator

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.

6 participants