From: Raghu Bankapur <quic_rbankapu@quicinc.com>
To: Vinod Koul <vkoul@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
"Takashi Iwai" <tiwai@suse.com>,
ierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
Mark Brown <broonie@kernel.org>,
"Kai Vehmanen" <kai.vehmanen@linux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Takashi Sakamoto <o-takashi@sakamocchi.jp>,
Raghu Bankapur <quic_rbankapu@quicinc.com>,
<alsa-devel@alsa-project.org>, Zubin Mithra <zsm@chromium.org>,
<linux-kernel@vger.kernel.org>
Cc: Krishna Jha <quic_kkishorj@quicinc.com>
Subject: [PATCH V0 0/1] ALSA: pcm: fix blocking while loop in
Date: Fri, 25 Feb 2022 16:09:31 +0530 [thread overview]
Message-ID: <cover.1645784757.git.quic_rbankapu@quicinc.com> (raw)
When period interrupts are disabled, while loop in snd_pcm_update_hw_ptr0()
results in the machine locking up if runtime->hw_ptr_buffer_jiffies is 0.
Validate runtime->hw_ptr_buffer_jiffies value before while loop to avoid
delta check.
when runtime->hw_ptr_buffer_jiffies is 0 then update of while condition
hdelta > xrun_threshold will be always true because hdelta will not
change. This will lead to infinite loop causing lock-up
This issue found during stability test, below log explains CPU lock-up on CPU1
[ 922.249028] sched: RT throttling activated for rt_rq ffffffc0f9970778 (cpu 1)
[ 922.249028] potential CPU hogs:
[ 922.249028] **FastCapture (11426)
[ 922.249105] ------------[ cut here ]---------
To fix this lock-up issue, added new condition to check if runtime->
hw_ptr_buffer_jiffies is ZERO or negative.
Raghu Bankapur (1):
ALSA: pcm: fix blocking while loop in snd_pcm_update_hw_ptr0()
sound/core/pcm_lib.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--
2.17.1
next reply other threads:[~2022-02-25 10:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-25 10:39 Raghu Bankapur [this message]
2022-02-25 10:39 ` [PATCH V0 1/1] ALSA: pcm: fix blocking while loop in snd_pcm_update_hw_ptr0() Raghu Bankapur
2022-02-25 10:52 ` Jaroslav Kysela
2022-02-25 11:23 ` Takashi Iwai
[not found] ` <35bfd332-891f-1323-8b61-9e4e2fc5cd1c@quicinc.com>
2022-02-28 15:58 ` Takashi Iwai
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=cover.1645784757.git.quic_rbankapu@quicinc.com \
--to=quic_rbankapu@quicinc.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=kai.vehmanen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=o-takashi@sakamocchi.jp \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=quic_kkishorj@quicinc.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=tiwai@suse.com \
--cc=vkoul@kernel.org \
--cc=zsm@chromium.org \
/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®