From: Takashi Iwai <tiwai@suse.de>
To: Runyu Xiao <runyu.xiao@seu.edu.cn>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
Jianhao Xu <jianhao.xu@seu.edu.cn>
Subject: Re: [PATCH] ALSA: mtpav: shut down output timer before card teardown
Date: Thu, 20 Aug 2026 15:43:16 +0200 [thread overview]
Message-ID: <87wltklxfv.wl-tiwai@suse.de> (raw)
In-Reply-To: <20260820112749.9195-1-runyu.xiao@seu.edu.cn>
On Thu, 20 Aug 2026 13:27:49 +0200,
Runyu Xiao wrote:
>
> snd_mtpav_output_timer() rearms chip->timer while holding
> chip->spinlock and accesses the card-private mtpav state.
>
> snd_mtpav_free() currently takes the same lock and calls
> timer_delete() when the timer is active. This only removes a
> pending timer; it does not wait for a callback that is already
> running and does not prevent the callback from rearming the timer.
>
> A callback running on another CPU can therefore continue after
> snd_mtpav_free() releases the lock and access the card-private
> state while the card is being torn down. It can also rearm the
> timer after timer_delete() has returned.
>
> Call timer_shutdown_sync() without holding chip->spinlock. This
> waits for any running callback to finish and prevents further
> rearming before the card-private mtpav state is released.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
Thanks, applied now.
Takashi
prev parent reply other threads:[~2026-08-20 13:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 11:27 Runyu Xiao
2026-08-20 13:43 ` 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=87wltklxfv.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=jianhao.xu@seu.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=runyu.xiao@seu.edu.cn \
--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®