Re: [PATCH] ALSA: hda/tas2781: Only accept CRC-less V1 data if all entries are valid
From: Takashi Iwai
Date: Wed Nov 04 2026 - 02:28:14 EST
On Tue, 03 Nov 2026 10:27:12 +0100,
Mohamed Yassine Jebabli via B4 Relay wrote:
>
> From: Mohamed Yassine Jebabli <med.jebabli@xxxxxxxxx>
>
> Commit 408249089c48 ("ALSA: hda/tas2781: Accept V1 calibration data
> without CRC") only checked the first device entry. On machines where
> the BIOS populates fewer entries than p->ndev, the remaining all-zero
> entries are applied and tas2781_cali_preproc() divides by zero on
> playback open.
>
> Accept CRC-less V1 data only if every expected entry is non-zero and
> self-consistent (R0 * 1/R0 close to 1.0), otherwise reject it as
> before.
>
> Fixes: 408249089c48 ("ALSA: hda/tas2781: Accept V1 calibration data without CRC")
> Reported-by: Cristian Castellano <cristian.castellano@xxxxxxxxxx>
> Closes: https://lore.kernel.org/all/4e500063-d985-46b6-a0a1-3feaa77c4b2f@xxxxxxxxxxxxx/
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Mohamed Yassine Jebabli <med.jebabli@xxxxxxxxx>
> ---
> Cristian, could you test this on the Yoga Pro 9 16IRP8? With the fix,
> the driver should log "V1 CRC error" again and fall back to default
> parameters, as it did before 408249089c48. If it still logs
> "accepting", p->ndev is 2 on your machine and the root cause is
> elsewhere, so please send the full "dmesg | grep -i tas2781".
>
> Takashi's re_cal check in tas2781_cali_preproc() is complementary
> and still worth applying as a safeguard.
As the code looks safe enough, I applied now.
Let me know if the problem still happens.
I'm going to submit my zero-check patch as a further hardening, too.
thanks,
Takashi