mbox series

[00/16] ASoC: SoundWire codecs: improve pm_runtime handling

Message ID 20230802153629.53576-1-pierre-louis.bossart@linux.intel.com
Headers show
Series ASoC: SoundWire codecs: improve pm_runtime handling | expand

Message

Pierre-Louis Bossart Aug. 2, 2023, 3:36 p.m. UTC
This patchset improves the pm_runtime behavior in rare corner cases
identified by the Intel CI in the last 6 months.

a) in stress-tests, it's not uncommon to see the following type of
warnings when the codec reports as ATTACHED

    "rt711 sdw:0:025d:0711:00: runtime PM trying to activate child device
    sdw:0:025d:0711:00 but parent (sdw-master-0) is not active"

This warning was not correlated with any functional issue, but it
exposed a design issue on when to enable pm_runtime. The recommended
practice in the pm_runtime documentation is to keep the devices in
'suspended' mode and mark them as 'active' when they are really
functional.

b) enabling pm_runtime when the codec reports as ATTACHED also creates
a problematic case when the ASoC pm_runtime_get_sync() will silently
fail due to the -EACCESS error handling. This can happen when playback
starts before the codec is enumerated.

This patchset modifies the initial stages so that codecs are
pm_runtime enabled in the .probe() callback, but become pm_runtime
'active' only when they report present. This is better aligned with
the design of the pm_runtime helpers and improved CI results
significantly.

This patchset modifies all existing SoundWire codecs (except Qualcomm
ones), but the pattern of changes is exactly the same in all patches.

Pierre-Louis Bossart (16):
  ASoC: SoundWire codecs: return error status in probe
  ASoC: SoundWire codecs: make regmap cache-only in probe
  ASoC: rt5682-sdw: make regmap cache-only in probe
  ASoC: rt711: enable pm_runtime in probe, keep status as 'suspended'
  ASoC: rt711-sdca: enable pm_runtime in probe, keep status as
    'suspended'
  ASoC: rt700: enable pm_runtime in probe, keep status as 'suspended'
  ASoC: rt1712-sdca: enable pm_runtime in probe, keep status as
    'suspended'
  ASoC: rt712-sdca-dmic: enable pm_runtime in probe, keep status as
    'suspended'
  ASoC: rt715: enable pm_runtime in probe, keep status as 'suspended'
  ASoC: rt715-sdca: enable pm_runtime in probe, keep status as
    'suspended'
  ASoC: rt1308-sdw: enable pm_runtime in probe, keep status as
    'suspended'
  ASoC: rt1316-sdw: enable pm_runtime in probe, keep status as
    'suspended'
  ASoC: rt1318-sdw: enable pm_runtime in probe, keep status as
    'suspended'
  ASoC: rt5682-sdw: enable pm_runtime in probe, keep status as
    'suspended'
  ASoC: max98363: enable pm_runtime in probe, keep status as 'suspended'
  ASoC: max98373-sdw: enable pm_runtime in probe, keep status as
    'suspended'

 sound/soc/codecs/max98363.c        | 41 +++++++++++++---------
 sound/soc/codecs/max98373-sdw.c    | 47 ++++++++++++++-----------
 sound/soc/codecs/rt1308-sdw.c      | 54 +++++++++++++++-------------
 sound/soc/codecs/rt1316-sdw.c      | 44 ++++++++++++++---------
 sound/soc/codecs/rt1318-sdw.c      | 43 ++++++++++++++---------
 sound/soc/codecs/rt5682-sdw.c      | 56 ++++++++++++++++++------------
 sound/soc/codecs/rt5682.c          |  3 ++
 sound/soc/codecs/rt700-sdw.c       |  7 ++--
 sound/soc/codecs/rt700.c           | 46 +++++++++++++++---------
 sound/soc/codecs/rt711-sdca-sdw.c  |  3 +-
 sound/soc/codecs/rt711-sdca.c      | 48 +++++++++++++++++--------
 sound/soc/codecs/rt711-sdw.c       |  7 ++--
 sound/soc/codecs/rt711.c           | 47 ++++++++++++++++---------
 sound/soc/codecs/rt712-sdca-dmic.c | 47 +++++++++++++++----------
 sound/soc/codecs/rt712-sdca-sdw.c  |  3 +-
 sound/soc/codecs/rt712-sdca.c      | 45 ++++++++++++++++--------
 sound/soc/codecs/rt715-sdca-sdw.c  |  5 +--
 sound/soc/codecs/rt715-sdca.c      | 41 ++++++++++++++++------
 sound/soc/codecs/rt715-sdw.c       |  9 ++---
 sound/soc/codecs/rt715.c           | 41 +++++++++++++++-------
 20 files changed, 392 insertions(+), 245 deletions(-)

Comments

Mark Brown Aug. 7, 2023, 7:54 p.m. UTC | #1
On Wed, 02 Aug 2023 10:36:13 -0500, Pierre-Louis Bossart wrote:
> This patchset improves the pm_runtime behavior in rare corner cases
> identified by the Intel CI in the last 6 months.
> 
> a) in stress-tests, it's not uncommon to see the following type of
> warnings when the codec reports as ATTACHED
> 
>     "rt711 sdw:0:025d:0711:00: runtime PM trying to activate child device
>     sdw:0:025d:0711:00 but parent (sdw-master-0) is not active"
> 
> [...]

Applied to

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

Thanks!

[01/16] ASoC: SoundWire codecs: return error status in probe
        commit: 3f3d66ba998fb079c1239430e96e3b138bc63166
[02/16] ASoC: SoundWire codecs: make regmap cache-only in probe
        commit: 49ae74abc76b2d9be4777e7ac833674fa4749071
[03/16] ASoC: rt5682-sdw: make regmap cache-only in probe
        commit: 6ab18105029ca3d739dd4c5c18638c7c6d568bbb
[04/16] ASoC: rt711: enable pm_runtime in probe, keep status as 'suspended'
        commit: a8590dd73d9f7fd955ac24a8e210d0721d5c10af
[05/16] ASoC: rt711-sdca: enable pm_runtime in probe, keep status as 'suspended'
        commit: 0c321fb857707ef68ffdb4f9672beb664e6679cc
[06/16] ASoC: rt700: enable pm_runtime in probe, keep status as 'suspended'
        commit: 6b8f8c5e6ffbd431d6cf40584dc8d3027f7e99b3
[07/16] ASoC: rt1712-sdca: enable pm_runtime in probe, keep status as 'suspended'
        commit: f3da2ed110e2884b29151313eee52947b786e1a7
[08/16] ASoC: rt712-sdca-dmic: enable pm_runtime in probe, keep status as 'suspended'
        commit: 8d890ecef1ef6e2e81f1709d54f6843846cfd15f
[09/16] ASoC: rt715: enable pm_runtime in probe, keep status as 'suspended'
        commit: 279be5919560d9f3afea1940bfd261297eecfa0c
[10/16] ASoC: rt715-sdca: enable pm_runtime in probe, keep status as 'suspended'
        commit: e4a3b8cf40713d6511391de3286ccba38998756b
[11/16] ASoC: rt1308-sdw: enable pm_runtime in probe, keep status as 'suspended'
        commit: 1772552eb304f3229309f66e2762e835955e2307
[12/16] ASoC: rt1316-sdw: enable pm_runtime in probe, keep status as 'suspended'
        commit: 64bae6732b2d3364ce4954015c84b4959f7d6e0f
[13/16] ASoC: rt1318-sdw: enable pm_runtime in probe, keep status as 'suspended'
        commit: df93dfa2b4d0f0e2ac2f73f78582a3830659d00e
[14/16] ASoC: rt5682-sdw: enable pm_runtime in probe, keep status as 'suspended'
        commit: 4af11e11defc200439a75a7957b03f3da37e46b2
[15/16] ASoC: max98363: enable pm_runtime in probe, keep status as 'suspended'
        commit: d6ce285641cfb506b6942818e06270fb091b8fe3
[16/16] ASoC: max98373-sdw: enable pm_runtime in probe, keep status as 'suspended'
        commit: b48f324f89ab8ee62c3448ef19445a1b292e02d3

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