mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: shyckless@gmail.com
Cc: perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: sis7019: Don't shift the voice IRQ status by 32
Date: Mon, 23 Nov 2026 10:00:07 +0100	[thread overview]
Message-ID: <871p8bexd4.wl-tiwai@suse.de> (raw)
In-Reply-To: <20261122-sis7019-voice-irq-v1-1-fa5d0cbecf62@gmail.com>

On Sun, 22 Nov 2026 11:08:16 +0100,
Suyuan Wang via B4 Relay wrote:
> 
> From: Suyuan Wang <stevewong@hust.edu.cn>
> 
> sis_voice_irq() walks the set bits of a PISR_A or PISR_B status word:
> 
> 	bit = __ffs(status);
> 	status >>= bit + 1;
> 
> When voice 31 or 63 interrupts, bit is 31 and status is shifted by 32,
> which is undefined for a u32. On x86 the shift count is masked to 0, so
> status does not change, the loop never ends, and voice keeps moving 32
> entries forward on every pass, past the end of sis->voices[], with
> sis_update_voice() called on whatever is there. All of this runs in the
> hard IRQ handler. Voices are handed out from 0 up, so voice 31 is in use
> once enough playback streams are open.
> 
> Walk the bits with for_each_set_bit() and index the voice by bit number
> instead. The voices are still updated in the same order.
> 
> Found with a static analysis tool and checked by hand.
> 
> Fixes: 175859bf1602 ("[ALSA] sis7019: support the SiS 7019 Audio Accelerator")
> Cc: stable@vger.kernel.org
> Co-developed-by: Kaixuan Li <kaixuan.li@ntu.edu.sg>
> Signed-off-by: Kaixuan Li <kaixuan.li@ntu.edu.sg>
> Signed-off-by: Suyuan Wang <stevewong@hust.edu.cn>

As this doesn't look like an urgent issue (for a legacy old code), I
applied to for-next branch.  Thanks.


Takashi

      reply	other threads:[~2026-11-23  9:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 10:08 Suyuan Wang via B4 Relay
2026-11-23  9:00 ` Takashi Iwai [this message]

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=871p8bexd4.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=shyckless@gmail.com \
    --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

all inboxes | Powered by JetHome®