mbox series

[v5,00/17] Fix reset controls and RPM of NVIDIA Tegra ASoC drivers

Message ID 20210314154459.15375-1-digetx@gmail.com
Headers show
Series Fix reset controls and RPM of NVIDIA Tegra ASoC drivers | expand

Message

Dmitry Osipenko March 14, 2021, 3:44 p.m. UTC
Hi,

This series adds missing hardware reset controls to I2S and AC97 drivers,
corrects runtime PM usage and drivers probe/remove order. Currently drivers
happen to work properly because reset is implicitly deasserted by tegra-clk
driver, but clk driver shouldn't touch the resets and we need to fix it
because this breaks other Tegra drivers. Previously we fixed the resets of
the AHUB and HDMI codec drivers, but turned out that we missed the I2C and
AC97 drivers.

Thanks to Paul Fertser for testing the pending clk patches and finding
that audio got broken on Tegra20 AC100 netbook because of the missing I2S
reset.

Changelog:

v5: - After taking another look at the drivers I noticed couple more
      things that could be improved. These new patches correct runtime PM
      and probe/remove order of the drivers:

        ASoC: tegra20: spdif: Correct driver removal order
        ASoC: tegra20: spdif: Remove handing of disabled runtime PM
        ASoC: tegra20: i2s: Add system level suspend-resume callbacks
        ASoC: tegra20: i2s: Correct driver removal order
        ASoC: tegra20: i2s: Use devm_clk_get()
        ASoC: tegra20: i2s: Remove handing of disabled runtime PM
        ASoC: tegra30: i2s: Correct driver removal order
        ASoC: tegra30: i2s: Use devm_clk_get()
        ASoC: tegra30: i2s: Remove handing of disabled runtime PM
        ASoC: tegra30: ahub: Reset global variable
        ASoC: tegra30: ahub: Correct suspend-resume callbacks
        ASoC: tegra30: ahub: Remove handing of disabled runtime PM

v4: - Added missing prototype for reset_control_bulk_put().

v3: - Fixed reset stubs for !CONFIG_RESET_CONTROLLER.

v2: - After some more testing I found that I2S control logic doesn't require
      I2S clock to be enabled for resetting. Hence it's fine to have I2S to
      be reset by parent AHUB driver, so I dropped "tegra30: i2s: Add reset
      control" patch.

    - While I was double-checking resets on Tegra30, I found that that
      Tegra30 I2S driver has a broken runtime PM which doesn't restore
      hardware state on resume and it's lost after AHUB RPM-resume.
      Thus, added this new patch "tegra30: i2s: Restore hardware state
      on runtime PM resume".

    - Added new patches which switch AHUB driver to use reset-bulk API.
      I took the RFC patch from Philipp Zabel, fixed it and added
      devm_reset_control_bulk_optional_get_exclusive_released() that
      will be useful for further Tegra GPU patches. This is a minor
      improvement which makes code cleaner.

Dmitry Osipenko (16):
  ASoC: tegra20: ac97: Add reset control
  ASoC: tegra20: i2s: Add reset control
  ASoC: tegra30: i2s: Restore hardware state on runtime PM resume
  ASoC: tegra30: ahub: Switch to use reset-bulk API
  ASoC: tegra20: spdif: Correct driver removal order
  ASoC: tegra20: spdif: Remove handing of disabled runtime PM
  ASoC: tegra20: i2s: Add system level suspend-resume callbacks
  ASoC: tegra20: i2s: Correct driver removal order
  ASoC: tegra20: i2s: Use devm_clk_get()
  ASoC: tegra20: i2s: Remove handing of disabled runtime PM
  ASoC: tegra30: i2s: Correct driver removal order
  ASoC: tegra30: i2s: Use devm_clk_get()
  ASoC: tegra30: i2s: Remove handing of disabled runtime PM
  ASoC: tegra30: ahub: Reset global variable
  ASoC: tegra30: ahub: Correct suspend-resume callbacks
  ASoC: tegra30: ahub: Remove handing of disabled runtime PM

Philipp Zabel (1):
  reset: Add reset_control_bulk API

 drivers/reset/core.c            | 215 ++++++++++++++++++++++
 include/linux/reset.h           | 315 ++++++++++++++++++++++++++++++++
 sound/soc/tegra/tegra20_ac97.c  |  21 +++
 sound/soc/tegra/tegra20_ac97.h  |   1 +
 sound/soc/tegra/tegra20_i2s.c   |  60 +++---
 sound/soc/tegra/tegra20_i2s.h   |   1 +
 sound/soc/tegra/tegra20_spdif.c |  16 +-
 sound/soc/tegra/tegra30_ahub.c  | 168 ++++++-----------
 sound/soc/tegra/tegra30_ahub.h  |   5 +-
 sound/soc/tegra/tegra30_i2s.c   |  65 ++-----
 10 files changed, 667 insertions(+), 200 deletions(-)

Comments

Dmitry Osipenko March 17, 2021, 5:20 p.m. UTC | #1
14.03.2021 18:44, Dmitry Osipenko пишет:
> Hi,
> 
> This series adds missing hardware reset controls to I2S and AC97 drivers,
> corrects runtime PM usage and drivers probe/remove order. Currently drivers
> happen to work properly because reset is implicitly deasserted by tegra-clk
> driver, but clk driver shouldn't touch the resets and we need to fix it
> because this breaks other Tegra drivers. Previously we fixed the resets of
> the AHUB and HDMI codec drivers, but turned out that we missed the I2C and
> AC97 drivers.
> 
> Thanks to Paul Fertser for testing the pending clk patches and finding
> that audio got broken on Tegra20 AC100 netbook because of the missing I2S
> reset.
....
> Dmitry Osipenko (16):
>   ASoC: tegra20: ac97: Add reset control
>   ASoC: tegra20: i2s: Add reset control
>   ASoC: tegra30: i2s: Restore hardware state on runtime PM resume
>   ASoC: tegra30: ahub: Switch to use reset-bulk API
>   ASoC: tegra20: spdif: Correct driver removal order
>   ASoC: tegra20: spdif: Remove handing of disabled runtime PM
>   ASoC: tegra20: i2s: Add system level suspend-resume callbacks
>   ASoC: tegra20: i2s: Correct driver removal order
>   ASoC: tegra20: i2s: Use devm_clk_get()
>   ASoC: tegra20: i2s: Remove handing of disabled runtime PM
>   ASoC: tegra30: i2s: Correct driver removal order
>   ASoC: tegra30: i2s: Use devm_clk_get()
>   ASoC: tegra30: i2s: Remove handing of disabled runtime PM
>   ASoC: tegra30: ahub: Reset global variable
>   ASoC: tegra30: ahub: Correct suspend-resume callbacks
>   ASoC: tegra30: ahub: Remove handing of disabled runtime PM
> 
> Philipp Zabel (1):
>   reset: Add reset_control_bulk API

Mark / Takashi, I may try to split up this series into two or three
smaller patchsets and then the reset/ patch from Philipp Zabel could be
merged by Philipp himself. I primarily want to have the audio resets
fixed and the reset API extended with reset_control_bulk in 5.13 because
this will unblock other patches. Please let me know what you prefer more.
Mark Brown March 17, 2021, 5:54 p.m. UTC | #2
On Wed, Mar 17, 2021 at 08:20:10PM +0300, Dmitry Osipenko wrote:

> Mark / Takashi, I may try to split up this series into two or three
> smaller patchsets and then the reset/ patch from Philipp Zabel could be
> merged by Philipp himself. I primarily want to have the audio resets
> fixed and the reset API extended with reset_control_bulk in 5.13 because
> this will unblock other patches. Please let me know what you prefer more.

I've actually already got this queued for application next time I apply
things, I'm guessing Phillip was intending that the reset patch go via
ASoC?
Mark Brown March 18, 2021, 6:36 p.m. UTC | #3
On Sun, 14 Mar 2021 18:44:42 +0300, Dmitry Osipenko wrote:
> This series adds missing hardware reset controls to I2S and AC97 drivers,
> corrects runtime PM usage and drivers probe/remove order. Currently drivers
> happen to work properly because reset is implicitly deasserted by tegra-clk
> driver, but clk driver shouldn't touch the resets and we need to fix it
> because this breaks other Tegra drivers. Previously we fixed the resets of
> the AHUB and HDMI codec drivers, but turned out that we missed the I2C and
> AC97 drivers.
> 
> [...]

Applied to

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

Thanks!

[01/17] ASoC: tegra20: ac97: Add reset control
        commit: a46b78247b852345ae4458711a4aec6744a7838c
[02/17] ASoC: tegra20: i2s: Add reset control
        commit: 9c648ef82d7d4696e80b286d37dae07b67a9a32d
[03/17] ASoC: tegra30: i2s: Restore hardware state on runtime PM resume
        commit: 0bbcecaaab15a74ba69f93df46c753f2a64eadca
[04/17] reset: Add reset_control_bulk API
        commit: 48d71395896d54eec989179dd265e569fcecb15a
[05/17] ASoC: tegra30: ahub: Switch to use reset-bulk API
        commit: 050086eb6dc945207b1db1d15cd81e9366dfd2f1
[06/17] ASoC: tegra20: spdif: Correct driver removal order
        commit: 0911f154a2ae264ee2a7c868c1267a102396d016
[07/17] ASoC: tegra20: spdif: Remove handing of disabled runtime PM
        commit: c53b396f0dd49a626ea2b1fc0a8b9e0a0bf95d4d
[08/17] ASoC: tegra20: i2s: Add system level suspend-resume callbacks
        commit: e33fdd9bee12be35d080bfd4acc9d1e3a0d04001
[09/17] ASoC: tegra20: i2s: Correct driver removal order
        commit: ca6e960ed6b10ba9236da8b3614574bb4524c65e
[10/17] ASoC: tegra20: i2s: Use devm_clk_get()
        commit: d3c6ef98dadd1e500445e4c5a9d684cbf3182c7d
[11/17] ASoC: tegra20: i2s: Remove handing of disabled runtime PM
        commit: 80ec4a4cb36d3f8bb56b5aa89faceb1145ef7aea
[12/17] ASoC: tegra30: i2s: Correct driver removal order
        commit: f852e1e4acf4ebde4c960bab6f89407fa18ca489
[13/17] ASoC: tegra30: i2s: Use devm_clk_get()
        commit: 52674aef9eb678f30d99f77fd53f6c564d5e2d92
[14/17] ASoC: tegra30: i2s: Remove handing of disabled runtime PM
        commit: b5f6f781fcb27b3ae5a2f04312a190115b5cbbd1
[15/17] ASoC: tegra30: ahub: Reset global variable
        commit: 5d956e3cb806870012c443bc265e6ac6188d3c36
[16/17] ASoC: tegra30: ahub: Correct suspend-resume callbacks
        commit: e2965c2ca139e780dc353cef1474103bb037136e
[17/17] ASoC: tegra30: ahub: Remove handing of disabled runtime PM
        commit: b5571449e6186bd37e8da16e7bce53f621c05e72

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