From: Takashi Iwai Subject: Re: [PATCH 2/6] pcm:direct: fix race on clearing timer events Date: Fri, 17 Feb 2017 18:45:26 +0100 Message-ID: References: <1487315756-8991-1-git-send-email-sutar.mounesh@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1487315756-8991-1-git-send-email-sutar.mounesh@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: sutar.mounesh@gmail.com Cc: Jiada Wang , alsa-devel@alsa-project.org, patch@alsa-project.org, Andreas Pape , mounesh_sutar@mentor.com List-Id: alsa-devel@alsa-project.org On Fri, 17 Feb 2017 08:15:56 +0100, sutar.mounesh@gmail.com wrote: > > From: Andreas Pape > > snd_timer handling is racy: plugins clear timer queue if avail_min > is not reached to force a sleep on timer. The race can happen if > the expected event arrives in between the avail check and the > clearing of pending events. If this race happens, the user will > unnecessarily wait for one more timer event. On low latency/realtime > streams this can lead to xruns and must be avoided. > > As a fix we recheck avail after having cleared poll events. > > Signed-off-by: Andreas Pape > Signed-off-by: Jiada Wang > Signed-off-by: Mounesh Sutar Applied, thanks. Takashi