public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: "Cássio Gabriel Monteiro Pires" <cassiogabrielcontato@gmail.com>
To: Richard Fitzgerald <rf@opensource.cirrus.com>,
	Takashi Iwai <tiwai@suse.com>,
	David Rhodes <david.rhodes@cirrus.com>,
	Jaroslav Kysela <perex@perex.cz>, Mark Brown <broonie@kernel.org>,
	Simon Trimmer <simont@opensource.cirrus.com>
Cc: linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] ALSA: hda: cs35l56: Propagate ASP TX source control errors
Date: Thu, 23 Apr 2026 11:09:29 -0300	[thread overview]
Message-ID: <e6d5bdfd-6d65-43d6-b14c-b0d5e949b969@gmail.com> (raw)
In-Reply-To: <876d2550-751c-4299-a090-fb7f4d264bde@opensource.cirrus.com>


[-- Attachment #1.1: Type: text/plain, Size: 1745 bytes --]

On 4/23/26 10:32, Richard Fitzgerald wrote:
> On 23/04/2026 2:11 pm, Cássio Gabriel wrote:
>> cs35l56_hda_mixer_get() ignores regmap_read() and
>> cs35l56_hda_mixer_put() ignores regmap_update_bits_check().
>>
>> This makes the ASP TX source controls report success when a regmap
>> access fails. The write path returns no change instead of an error,
>> and the read path continues after a failed read instead of aborting
>> the control callback.
> 
> Are you seeing a problem on hardware? Or is this a static analysis
> warning?

This was found by code inspection, then checked with a focused
Coccinelle rule (I do not have the hardware to check it).

Rule:

@ignored_regmap_read@
position p;
expression map, reg, val;
@@

regmap_read@p(map, reg, val);

@script:python depends on ignored_regmap_read@
p << ignored_regmap_read.p;
@@

coccilib.report.print_report(p[0], "ignored regmap_read() return value")

@ignored_regmap_update_bits_check@
position p;
expression map, reg, mask, val, change;
@@

regmap_update_bits_check@p(map, reg, mask, val, change);

@script:python depends on ignored_regmap_update_bits_check@
p << ignored_regmap_update_bits_check.p;
@@

coccilib.report.print_report(p[0], "ignored regmap_update_bits_check() return value")



Before the patch:
$ spatch --very-quiet --cocci-file /tmp/ignored-regmap-access.cocci /tmp/cs35l56_hda-before.c
/tmp/cs35l56_hda-before.c:187:1-12: ignored regmap_read() return value
/tmp/cs35l56_hda-before.c:212:1-25: ignored regmap_update_bits_check() return value

After the patch:
$ spatch --very-quiet --cocci-file /tmp/ignored-regmap-access.cocci sound/hda/codecs/side-
codecs/cs35l56_hda.c

No matches.

-- 
Thanks,
Cássio


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

  reply	other threads:[~2026-04-23 14:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23 13:11 [PATCH] ALSA: hda: cs35l56: Propagate ASP TX source control errors Cássio Gabriel
2026-04-23 13:32 ` Richard Fitzgerald
2026-04-23 14:09   ` Cássio Gabriel Monteiro Pires [this message]
2026-04-23 19:35     ` Cássio Gabriel Monteiro Pires

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=e6d5bdfd-6d65-43d6-b14c-b0d5e949b969@gmail.com \
    --to=cassiogabrielcontato@gmail.com \
    --cc=broonie@kernel.org \
    --cc=david.rhodes@cirrus.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=rf@opensource.cirrus.com \
    --cc=simont@opensource.cirrus.com \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.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