mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Axelsson <andreas.axelsson@androscientia.com>
To: Mark Brown <broonie@kernel.org>
Cc: Shenghao Ding <shenghao-ding@ti.com>, Kevin Lu <kevin-lu@ti.com>,
	Baojun Xu <baojun.xu@ti.com>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: tas2781: Do not report cross-instance writes as errors on SPI
Date: Tue, 29 Sep 2026 23:36:11 +0200	[thread overview]
Message-ID: <d99d01e0-8ae5-4555-88cf-d7eb9afca692@androscientia.com> (raw)
In-Reply-To: <aiqrzlIGi0ClnygD@sirena.co.uk>

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]

Attached is the updated patch.

Best regards,

Andreas

On 11/06/2026 2.36 pm, Mark Brown wrote:
> On Thu, Jun 11, 2026 at 10:20:18AM +0200, Andreas Axelsson wrote:
>> On SPI-based TAS2781 HDA systems (e.g. HP laptops with two amplifiers
>> on separate SPI chip selects), each tasdevice_priv instance services a
>> single device. The SPI bus glue intentionally returns -EXDEV for
>> register access addressed to a channel the instance does not own, and
>> logs it at debug level as "Not error" (see
>> tasdevice_spi_change_chn_book()).
> This doesn't apply against current code, please check and resend.

[-- Attachment #2: v2-0001-ASoC-tas2781-Skip-calibration-data-for-other-SPI-devices.patch --]
[-- Type: text/x-patch, Size: 1813 bytes --]

From: Andreas Axelsson <andreas.axelsson@androscientia.com>
Subject: [PATCH v2] ASoC: tas2781: Skip calibration data for other SPI devices

On SPI-based TAS2781 HDA systems (e.g. HP laptops with two amplifiers
on separate SPI chip selects), each tasdevice_priv instance services a
single device, and the SPI bus glue returns -EXDEV for register access
addressed to a channel the instance does not own (see
tasdevice_spi_change_chn_book()).

Commit 513480da5e9c ("ALSA: hda/tas2781: Fix device-0 reset issue and
handle -EXDEV in block data processing") taught
tasdevice_process_block() to ignore -EXDEV on SPI, but
tasdev_load_calibrated_data() still tries to write calibration data
for every channel. On each instance the write for the other amplifier
fails and is logged as an error on every boot, resume and profile
switch:

  tas2781-hda spi1-TXNW2781:00-tas2781-hda.1: chn 0 r0_reg bulk_wr err = -18

The owning instance loads that channel's calibration data itself, so
skip channels other than priv->index on SPI.

Tested on an HP ZBook Fury G1i (subsystem 103C:8DE8) with two TAS2781
amps on SPI.

Fixes: 9fa6a693ad8d ("ALSA: hda/tas2781: Remove tas2781_spi_fwlib.c and leverage SND_SOC_TAS2781_FMWLIB")
Signed-off-by: Andreas Axelsson <andreas.axelsson@androscientia.com>
---
v2:
- Rebased on current code. The tasdevice_process_block() part of v1
  is superseded by commit 513480da5e9c; only the calibration part
  remains.

--- a/sound/soc/codecs/tas2781-fmwlib.c
+++ b/sound/soc/codecs/tas2781-fmwlib.c
@@ -2631,6 +2631,10 @@
 	if (!data || !cali_data->total_sz)
 		return;
 
+	/* On SPI each instance owns a single device; skip the others. */
+	if (priv->isspi && i != priv->index)
+		return;
+
 	if (data[k] != i) {
 		dev_err(priv->dev, "%s: no cal-data for dev %d from usr-spc\n",
 			__func__, i);

  reply	other threads:[~2026-09-29 21:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11  8:20 Andreas Axelsson
2026-06-11 12:36 ` Mark Brown
2026-09-29 21:36   ` Andreas Axelsson [this message]
2026-09-29 21:45     ` Mark Brown

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=d99d01e0-8ae5-4555-88cf-d7eb9afca692@androscientia.com \
    --to=andreas.axelsson@androscientia.com \
    --cc=baojun.xu@ti.com \
    --cc=broonie@kernel.org \
    --cc=kevin-lu@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=shenghao-ding@ti.com \
    /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

all inboxes | Powered by JetHome®