From: Takashi Iwai Subject: Re: [PATCH 2/2] ALSA: timer: Assure timer resolution access always locked Date: Thu, 17 May 2018 10:46:33 +0200 Message-ID: References: <20180516221048.32221-1-tiwai@suse.de> <20180516221048.32221-2-tiwai@suse.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id A1A2F266DF0 for ; Thu, 17 May 2018 10:46:35 +0200 (CEST) In-Reply-To: <20180516221048.32221-2-tiwai@suse.de> 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: alsa-devel@alsa-project.org Cc: Ben Hutchings List-Id: alsa-devel@alsa-project.org On Thu, 17 May 2018 00:10:48 +0200, Takashi Iwai wrote: > > @@ -438,19 +438,24 @@ static unsigned long snd_timer_hw_resolution(struct snd_timer *timer) > unsigned long snd_timer_resolution(struct snd_timer_instance *timeri) > { > struct snd_timer * timer; > + unsigned long ret = 0; > + unsigned long flags; > > if (timeri == NULL) > return 0; > timer = timeri->timer; > - if (timer) > - return snd_timer_hw_resolution(timer); > + if (timer) { > + spin_lock_irqsave(&timer->lock, flags); > + ret = snd_timer_hw_resolution(timer); > + spin_unlock_irqrestore(&timer->lock, flags); > + } > return 0; This must be return ret, of course. Will resend v2 series addressing this. Takashi