From: Takashi Iwai <tiwai@suse.de>
To: Raghu Ballappa Bankapur <quic_rbankapu@quicinc.com>
Cc: Jaroslav Kysela <perex@perex.cz>, Vinod Koul <vkoul@kernel.org>,
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>,
<alsa-devel@alsa-project.org>, Zubin Mithra <zsm@chromium.org>,
<linux-kernel@vger.kernel.org>,
Krishna Jha <quic_kkishorj@quicinc.com>
Subject: Re: [PATCH V0 1/1] ALSA: pcm: fix blocking while loop in snd_pcm_update_hw_ptr0()
Date: Mon, 28 Feb 2022 16:58:30 +0100 [thread overview]
Message-ID: <s5hee3nrnix.wl-tiwai@suse.de> (raw)
In-Reply-To: <35bfd332-891f-1323-8b61-9e4e2fc5cd1c@quicinc.com>
On Fri, 25 Feb 2022 13:26:36 +0100,
Raghu Ballappa Bankapur wrote:
>
> Hi Takashi,
>
> Thanks for your feedback.
>
> I see your below statement
>
> But, having either this zero check or minimal hw_ptr_buffer_jiffies=1
> would be good in anyway, even if we add more check for the hw_params
> for no-period-wakeup case.
>
> Please review if those changes are Ok
If you mean about your posted patch for "those changes", as Jaroslav
suggested in the thread, we may take a different approach: just set
the minimal hw_ptr_buffer_jiffies to 1.
Could you try this and submit the fix if that works for you?
thanks,
Takashi
>
> Regards
> Raghu
>
> On 2/25/2022 4:53 PM, Takashi Iwai wrote:
>
> On Fri, 25 Feb 2022 11:52:05 +0100,
> Jaroslav Kysela wrote:
>
> On 25. 02. 22 11:39, Raghu Bankapur wrote:
>
> 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.
>
> I would set hw_ptr_buffer_jiffies to 1 in this case in snd_pcm_post_start().
>
> I thought of it at the first glance, but after reading the code again,
> I doubt whether it makes sense at all to allow this condition.
> Since the buffer size is too small and the rate is too high, we can't
> calculate the buffer crossing condition accurately under such
> condition.
>
> But, having either this zero check or minimal hw_ptr_buffer_jiffies=1
> would be good in anyway, even if we add more check for the hw_params
> for no-period-wakeup case.
>
> thanks,
>
> Takashi
>
>
prev parent reply other threads:[~2022-02-28 15:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-25 10:39 [PATCH V0 0/1] ALSA: pcm: fix blocking while loop in Raghu Bankapur
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 [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=s5hee3nrnix.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--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=quic_rbankapu@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