mbox series

[0/2] ALSA: cs35l56: Fix for races when soft-resetting on SPI

Message ID 20250225131843.113752-1-rf@opensource.cirrus.com (mailing list archive)
Headers show
Series ALSA: cs35l56: Fix for races when soft-resetting on SPI | expand

Message

Richard Fitzgerald Feb. 25, 2025, 1:18 p.m. UTC
These two patches fix a race condition between driver and amp when issuing
a soft-reset over SPI. The main problem with the race is that the driver
could read the amp status as fully booted, when in fact the amp is about
to reset or is in the process of resetting.

This is mainly contained within the ASoC driver code but a small change is
needed to the HDA driver.

The first patch, to cs_dsp, is to remove async regmap writes so that the
cs35l56 driver can call spi_bus_lock() without breaking firmware download to
other amps on the same SPI bus.

Richard Fitzgerald (2):
  firmware: cs_dsp: Remove async regmap writes
  ASoC: cs35l56: Prevent races when soft-resetting using SPI control

 drivers/firmware/cirrus/cs_dsp.c  | 24 +++-------
 include/sound/cs35l56.h           | 31 ++++++++++++
 sound/pci/hda/cs35l56_hda_spi.c   |  3 ++
 sound/soc/codecs/cs35l56-shared.c | 80 +++++++++++++++++++++++++++++++
 sound/soc/codecs/cs35l56-spi.c    |  3 ++
 5 files changed, 123 insertions(+), 18 deletions(-)

Comments

Mark Brown Feb. 25, 2025, 5:04 p.m. UTC | #1
On Tue, 25 Feb 2025 13:18:41 +0000, Richard Fitzgerald wrote:
> These two patches fix a race condition between driver and amp when issuing
> a soft-reset over SPI. The main problem with the race is that the driver
> could read the amp status as fully booted, when in fact the amp is about
> to reset or is in the process of resetting.
> 
> This is mainly contained within the ASoC driver code but a small change is
> needed to the HDA driver.
> 
> [...]

Applied to

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

Thanks!

[1/2] firmware: cs_dsp: Remove async regmap writes
      commit: fe08b7d5085a9774abc30c26d5aebc5b9cdd6091
[2/2] ASoC: cs35l56: Prevent races when soft-resetting using SPI control
      commit: 769c1b79295c38d60fde4c0a8f5f31e01360c54f

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