From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
[ Upstream commit ab77fa5533e4d1dcfdd2711b9b1e166e4ed57dab ]
MSIOF TX/RX are sharing same clock. Adds .symmetric_xxx flags.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Tested-by: Yusuke Goda yusuke.goda.sx@renesas.com Link: https://patch.msgid.link/87a52jyuu6.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES - MSIOF programs both TX and RX registers in one shot while a stream starts (`sound/soc/renesas/rcar/msiof.c:168`- `sound/soc/renesas/rcar/msiof.c:259`), and the in-file [NOTE-BOTH- SETTING] warns that touching those registers while the peer direction is active triggers hardware FSERRs. Without symmetry constraints, the second stream can request a different rate/width and the ALSA core will try to reconfigure the shared clock, recreating the FSERR condition that the driver is trying to avoid. - Setting `.symmetric_rate`, `.symmetric_channels`, and `.symmetric_sample_bits` to `1` in the DAI driver (`sound/soc/renesas/ rcar/msiof.c:395`-`sound/soc/renesas/rcar/msiof.c:398`) tells the core to force the late-starting stream to inherit the parameters already in use, preventing those invalid reconfigurations and the resulting DMA/FSERR failures that users encounter when running full-duplex with mismatched parameters. - The fix is tiny, self-contained, and matches the documented hardware constraint; it only restricts configurations that never worked in practice because TX/RX share clocks and register programming, so regression risk is minimal. - The fields being set have existed in the stable series since well before MSIOF support landed, so the patch applies cleanly without dependencies, and it comes with Tested-by coverage from Renesas hardware. Stable users with duplex workloads benefit directly from the enforced symmetry.
sound/soc/renesas/rcar/msiof.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/sound/soc/renesas/rcar/msiof.c b/sound/soc/renesas/rcar/msiof.c index 36d31ab8ac6a5..7a9ecc73231a8 100644 --- a/sound/soc/renesas/rcar/msiof.c +++ b/sound/soc/renesas/rcar/msiof.c @@ -292,6 +292,9 @@ static struct snd_soc_dai_driver msiof_dai_driver = { .channels_max = 2, }, .ops = &msiof_dai_ops, + .symmetric_rate = 1, + .symmetric_channels = 1, + .symmetric_sample_bits = 1, };
static struct snd_pcm_hardware msiof_pcm_hardware = {