From: Takashi Iwai Subject: Re: [PATCH 2/2] ALSA: pcm: Allow aborting mutex lock at OSS read/write loops Date: Mon, 08 Jan 2018 16:36:47 +0100 Message-ID: References: <20180108142541.18098-1-tiwai@suse.de> <20180108142541.18098-3-tiwai@suse.de> <8315dd4e-7332-c0ae-72e9-2ca43868ca7b@metafoo.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 863F92673AF for ; Mon, 8 Jan 2018 16:36:48 +0100 (CET) In-Reply-To: <8315dd4e-7332-c0ae-72e9-2ca43868ca7b@metafoo.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: Lars-Peter Clausen Cc: alsa-devel@alsa-project.org, Dmitry Vyukov List-Id: alsa-devel@alsa-project.org On Mon, 08 Jan 2018 16:35:49 +0100, Lars-Peter Clausen wrote: > > On 01/08/2018 03:25 PM, Takashi Iwai wrote: > > @@ -1438,8 +1441,11 @@ static ssize_t snd_pcm_oss_read1(struct snd_pcm_substream *substream, char __use > > > > if ((tmp = snd_pcm_oss_make_ready(substream)) < 0) > > return tmp; > > - mutex_lock(&runtime->oss.params_lock); > > while (bytes > 0) { > > + if (mutex_lock_interruptible(&runtime->oss.params_lock)) { > > + tmp = -EINTR; > > For consistency ERESTARTSYS I guess? In the end this is the same as > signal_pending(). Right, it's a better one. thanks, Takashi