Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Cristian Castellano <cristian.castellano@icloud.com>
Cc: med.jebabli@gmail.com, tiwai@suse.de,
	linux-sound@vger.kernel.org, regressions@lists.linux.dev,
	stable@vger.kernel.org
Subject: Re: [REGRESSION] ALSA: hda/tas2781: divide error on playback open after accepting V1 calibration data without CRC (Lenovo Yoga Pro 9 16IRP8)
Date: Mon, 02 Nov 2026 15:43:32 +0100	[thread overview]
Message-ID: <87se1j8faj.wl-tiwai@suse.de> (raw)
In-Reply-To: <a84fe7b5-ba90-4e51-afcc-548f8b30180b@icloud.com>

On Tue, 27 Oct 2026 23:21:57 +0100,
Cristian Castellano wrote:
> 
> Hello, since I updated to 7.2.11 (and then to 7.3), opening a playback stream on my Lenovo Yoga Pro 9
> 16IRP8 (83BY, subsystem 17aa:3835, BIOS KVCN44WW) triggers a divide error in snd_soc_tas2781_fmwlib and audio stops working. 7.2.9 just works.
> 
> The only tas2781 change between the two I found is:
> c1b708f712f5 ("ALSA: hda/tas2781: Accept V1 calibration data without CRC") (upstream 408249089c48).
> 
> At boot the driver now logs:
> 
>   tas2781-hda i2c-TIAS2781:00: tas2781_apply_calib: V1 data without CRC, accepting
> 
> Before that commit the data was rejected and the amplifiers worked with
> default parameters. On this machine the CALI_DATA EFI variable
> (CALI_DATA-1f52d2a1-bb3a-457d-bc09-43a3f4310a92) contains two non-zero
> device entries followed by zeros, with TimeStamp and CRC zeroed:
> 
>   0000000 07 00 00 00 5c c8 20 1d 28 b5 27 23 2a 79 42 16
>   0000016 f2 07 c5 00 00 00 e0 2e 01 f7 2a 1d 72 6f 1b 23
>   0000032 2a 41 4a 16 c4 0a c3 00 00 00 e0 2e 00 00 00 00
>   0000048 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>   *
>   0000128 00 00 00 00
> 
> (the first 4 bytes are the EFI attributes)
> 
> Oops:
> 
>   Oops: divide error: 0000 [#1] SMP NOPTI
>   CPU: 10 UID: 1000 PID: 1533 Comm: wireplumber Tainted: G        W  O        7.3.0-4-cachyos #1 PREEMPT(full)
>   Hardware name: LENOVO 83BY/LNVNB161216, BIOS KVCN44WW 03/05/2025
>   RIP: 0010:tasdevice_select_tuningprm_cfg+0x8c2/0xa90 [snd_soc_tas2781_fmwlib]
>   Code: 4c 89 f7 41 b8 04 00 00 00 2e 2e 2e 41 ff d3 85 c0 0f 88 97 01 00 00 48 8b 4c 24 10 66 0f 38 f0 01 0f b7 c0 0f af 44 24 18 99 <f7> 7c 24 24 88 21 88 41 01 c6 41 08 01 48 8b 4c 24 08 48 8b 44 24
>   RAX: 0000000000000000 RBX: 000000000000002a RCX: ffff8d36ca8af218
>   RDX: 0000000000000000 RSI: 0000000000000db8 RDI: ffff8d36ca8af21b
>   RBP: 0000000000000000 R08: 0000000000000004 R09: 000000000000000a
>   R10: 0000000000000100 R11: ffffffff87559290 R12: ffff8d3684e350df
>   R13: ffff8d36a861d9b8 R14: ffff8d3684e35038 R15: 0000000000000002
>   Call Trace:
>    <TASK>
>    tasdevice_tuning_switch+0x71/0x80 [snd_soc_tas2781_fmwlib]
>    tas2781_hda_playback_hook+0x4c/0x110 [snd_hda_scodec_tas2781_i2c]
>    hda_component_manager_playback_hook+0xb5/0x370 [snd_hda_scodec_component]
>    playback_pcm_open+0x79/0xa0 [snd_hda_codec_generic]
>    hdac_hda_dai_open+0x5c/0x90 [snd_soc_hdac_hda]
>    snd_soc_dai_startup+0x52/0x90 [snd_soc_core]
>    __soc_pcm_open+0x108/0x6c0 [snd_soc_core]
>    dpcm_be_dai_startup+0x153/0x3c0 [snd_soc_core]
>    dpcm_fe_dai_open+0x109/0xc00 [snd_soc_core]
>    snd_pcm_open_substream+0x604/0x920 [snd_pcm]
>    snd_pcm_open+0xeb/0x220 [snd_pcm]
>    snd_pcm_playback_open+0x39/0x60 [snd_pcm]
>    chrdev_open+0xbf/0x230
>    vfs_open+0x3f8/0x520
>    path_openat+0x4f4/0xc50
>    do_file_open+0xd7/0x150
>    do_syscall_64+0x8f/0x380
>    entry_SYSCALL_64_after_hwframe+0x76/0x7e
>    </TASK>
> 
> The kernel is  linux-cachyos 7.3 (taint O is from the NVIDIA module);
> CachyOS does not patch the tas2781 driver, and its LTS, 6.18.55  works. If it is needed, I can test patches.
> 
> #regzbot introduced: 408249089c48
> 
> Thank you,
> Cristian Castellano

I guess the following oneliner would prevent the zero-division.
But I'm not sure whether the whole calibration there would make sense
and works properly.  Could you verify it?

Maybe we should make the check of V1 CRC error more restrictive.


thanks,

Takashi

--- a/sound/soc/codecs/tas2781-fmwlib.c
+++ b/sound/soc/codecs/tas2781-fmwlib.c
@@ -2579,7 +2579,7 @@ static int tas2781_cali_preproc(struct tasdevice_priv *priv, int i)
 		 */
 		re_org = r0_deflt[0] << 8 | r0_deflt[1];
 		re_cal = data[k + 1] << 8 | data[k + 2];
-		if (re_org > re_cal) {
+		if (re_cal && re_org > re_cal) {
 			rc = tasdevice_dev_read(priv, i, TAS2781_PG_REG,
 						 &pg_id);
 			if (rc < 0) {

  parent reply	other threads:[~2026-11-02 14:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 22:21 [REGRESSION] ALSA: hda/tas2781: divide error on playback open after accepting V1 calibration data without CRC (Lenovo Yoga Pro 9 16IRP8) Cristian Castellano
2026-11-02 11:35 ` Thorsten Leemhuis
2026-11-03  9:44   ` Mohamed Yassine JEBABLI
2026-11-03  9:52   ` Mohamed Yassine JEBABLI
2026-11-02 14:43 ` Takashi Iwai [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-10-27 22:18 Cristian Castellano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87se1j8faj.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=cristian.castellano@icloud.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=med.jebabli@gmail.com \
    --cc=regressions@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox