mbox series

[v4,0/9] ASoC: Intel: avs: PCM power management

Message ID 20221027124702.1761002-1-cezary.rojewski@intel.com (mailing list archive)
Headers show
Series ASoC: Intel: avs: PCM power management | expand

Message

Cezary Rojewski Oct. 27, 2022, 12:46 p.m. UTC
Goal of the series is implementation of suspend/resume operations for a
PCM stream along with all the collaterals connected to the subject.

Start with splitting avs_dai_fe_hw_free() as ideally we would like to
reuse as much of existing code as possible but snd_pcm_lib_free_pages()
is not desired part of the function when speaking of suspend operation.

The actual implementation of suspend/resume() for component drivers
follows. For most scenarios, the PM flow is similar to standard
streaming one, except for the part where the position register are being
saved and the lack of PCM pages freeing. To reduce code duplication, all
avs_dai_suspend_XXX() and avs_dai_resume_XXX() functions reuse their
non-PM equivalents.
Order of operations is affected by the fact that path binding/unbinding
happens only in FE part of the stream.

Above essentially unlocks SX+streaming scenarios i.e.: power transitions
with an ongoing stream.

As some streams are allowed to run in low power state, support is
provided for S0iX state. The handlers check ACPI capabilities and the
number of active low-power paths before deciding between SX and S0iX
flows.

The last portion of the patchset is addition of power/clock gating
overrides. There is no single set of registers that ensures AudioDSP
firmware loads 100% of time on every single configuration. By having
them exposed, user can have the loading procedure behavior adjusted for
their configuration without having to recompile the kernel.


Changes in v4:
- replaced readb_poll_timeout() with read_poll_timeout() for the DRSM
  polling function as the register is u32 wide, not u8

Changes in v3:
- fixed unused-but-set-variable warnings reported by the test robot

Changes in v2:
- moved DRSM reg polling to separate function,
  snd_hdac_stream_wait_drsm() as suggested by Pierre
- moved the acpi_gbl_FADT under AVS_S0IX_SUPPORTED macro and relocated
  the checks from pcm.c to topology.c so that the low-power streams are
  filtered as early as possible
- fixed compilation when CONFIG_ACPI is disabled as reported by the test
  robot
- simplified all the avs_dai_resume/suspend_xxx() by moving
  ->ignore_suspend check one level up, to avs_component_pm_op()
  (patch 0002)


Amadeusz Sławiński (1):
  ASoC: Intel: avs: Handle SUSPEND and RESUME triggers

Cezary Rojewski (7):
  ASoC: Intel: avs: Split pcm pages freeing operation from hw_free()
  ASoC: Intel: avs: Introduce PCM power management routines
  ALSA: hda: Introduce snd_hdac_stream_wait_drsm()
  ASoC: Intel: avs: Restart instead of resuming HDA capture streams
  ASoC: Intel: avs: Count low power streams
  ASoC: Intel: avs: Power and clock gating policy overriding
  ASoC: Intel: avs: Enact power gating policy

Piotr Maziarz (1):
  ASoC: Intel: avs: Standby power-state support

 include/sound/hdaudio.h        |   1 +
 include/sound/hdaudio_ext.h    |   5 +
 sound/hda/hdac_stream.c        |  22 ++
 sound/soc/intel/avs/avs.h      |   8 +
 sound/soc/intel/avs/core.c     |  97 +++++++--
 sound/soc/intel/avs/loader.c   |  10 +
 sound/soc/intel/avs/pcm.c      | 368 +++++++++++++++++++++++++++++----
 sound/soc/intel/avs/topology.c |  10 +
 8 files changed, 461 insertions(+), 60 deletions(-)

Comments

Mark Brown Oct. 28, 2022, 4:40 p.m. UTC | #1
On Thu, 27 Oct 2022 14:46:53 +0200, Cezary Rojewski wrote:
> Goal of the series is implementation of suspend/resume operations for a
> PCM stream along with all the collaterals connected to the subject.
> 
> Start with splitting avs_dai_fe_hw_free() as ideally we would like to
> reuse as much of existing code as possible but snd_pcm_lib_free_pages()
> is not desired part of the function when speaking of suspend operation.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/9] ASoC: Intel: avs: Split pcm pages freeing operation from hw_free()
      commit: 0abfc84ba22aca05a5268128f719386648351020
[2/9] ASoC: Intel: avs: Introduce PCM power management routines
      commit: 2b9a50ea845ebe95473f5b85dfcc9b806c252fac
[3/9] ALSA: hda: Introduce snd_hdac_stream_wait_drsm()
      commit: efffb014478e76c35b1a9e279d7010f70ff517e2
[4/9] ASoC: Intel: avs: Handle SUSPEND and RESUME triggers
      commit: 8e097f9a5529f0e6af30e1fac0d4e2a97c241392
[5/9] ASoC: Intel: avs: Restart instead of resuming HDA capture streams
      commit: eb0699c4cd6e32d5e2bfc9356ab9e19a6164c94e
[6/9] ASoC: Intel: avs: Count low power streams
      commit: 730cb320ec2973fb2aea72ea27f7edc6a847a664
[7/9] ASoC: Intel: avs: Standby power-state support
      commit: d56829e9c1cb90044c07337fe90a9828fdb165c0
[8/9] ASoC: Intel: avs: Power and clock gating policy overriding
      commit: 2a87f17775c1cbcfb99225312e8cc7a06aa109b9
[9/9] ASoC: Intel: avs: Enact power gating policy
      commit: 758ba92f3a2f86493a9147abd31a5bdc0befc273

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark