Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp803958imm; Sat, 8 Sep 2018 09:14:42 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbLd+aKH4WAhNoB43xvhBbX68sI6VTDjmyu4zjel4Htap4+MtQTT/VsEdyI3mozCmTK48ru X-Received: by 2002:a65:5581:: with SMTP id j1-v6mr13746516pgs.203.1536423282166; Sat, 08 Sep 2018 09:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536423282; cv=none; d=google.com; s=arc-20160816; b=sRToU1rZG5EEkjWuZ4m4k/lSItcNQ8eG2dvgChr7wrS2ne2biOVpOSfnYwDFsEC3Kg dMwjTXl3y3KG6VdPVGCruzik5lhZCQ+L5hngpLHOjkLwVL7NU+p+b28EVITzux3czU8B ZHrsuTJSiYfIctQ+SNizcxzyy/GU7JVGu9K2M7jqOsjqBUtAnjkAANg6QW/EhjLj3sZ0 B1YXhSu8qQ+r6CLFeXFn2w3K3ns7ARSQ/kt8BC+rn6nMgxrZKXxO/zXwdh2+5eIVPVkD MUBnKZFuSDTP2XEOGYEkGXJLmWhwe0oUVc6NhWLHWj6VEnxn/zZ6xlq8GcAoUJlLdghp 7M7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=2vcjkqFfdsAjPjBUupGrOSByZzash7BTp7L6Rywt0hQ=; b=bKACutWQ95eA4XMhKu5GyUn9BXsEvIvQ+W1RClByhoBVbzK8wwKOhb9TdA0X8ygo5E cLbisM5QcE+MQ6L1J4pa33om9P2u/N+TDS8d91idHgcooOm8IjhSAKl/7oKD9TlrlkhN aLvQuUHHE5fIEZAfiPHeBlci5toUZK0+KWlNd6ZIisbqh4Xp2DAGNdWLkzvP+YuYWNBh +Aahvbgg2rLVvwKkbcU0os1VxOxNsr0jkPee4rGqbnkPFo9SY5/bbTbG4FpyyXBHVjXb PwTbH50wKZaYk8qxTvx96WnXCqY8EwacqL0GlQMgMZX9j+/klq3NaEdL+EovYYL+ajQQ Uq6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j13-v6si12533152pgf.609.2018.09.08.09.14.26; Sat, 08 Sep 2018 09:14:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727723AbeIHU7R (ORCPT + 99 others); Sat, 8 Sep 2018 16:59:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:34550 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726314AbeIHU7R (ORCPT ); Sat, 8 Sep 2018 16:59:17 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 1591CAD4D; Sat, 8 Sep 2018 16:12:59 +0000 (UTC) Date: Sat, 08 Sep 2018 18:12:58 +0200 Message-ID: From: Takashi Iwai To: Stefan Wahren Cc: Eric Anholt , linux-rpi-kernel@lists.infradead.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: [PATCH 16/29] staging: bcm2835-audio: Drop superfluous mutex lock during prepare In-Reply-To: <1706035173.39231.1536414041437@email.1und1.de> References: <20180904155858.8001-1-tiwai@suse.de> <20180904155858.8001-17-tiwai@suse.de> <1706035173.39231.1536414041437@email.1und1.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/26 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 08 Sep 2018 15:40:41 +0200, Stefan Wahren wrote: > > Hi, > > > Takashi Iwai hat am 4. September 2018 um 17:58 geschrieben: > > > > > > The chip->audio_mutex is used basically for protecting the opened > > stream assignment, and the prepare callback is irrelevant with it. > > > > Signed-off-by: Takashi Iwai > > --- > > drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 8 ++------ > > 1 file changed, 2 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c > > index 1f9c940f1cc3..9659c25b9f9d 100644 > > --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c > > +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c > > @@ -218,8 +218,6 @@ static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream) > > int channels; > > int err; > > > > - mutex_lock(&chip->audio_mutex); > > - > > /* notify the vchiq that it should enter spdif passthrough mode by > > * setting channels=0 (see > > * https://github.com/raspberrypi/linux/issues/528) > > @@ -233,7 +231,7 @@ static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream) > > runtime->rate, > > snd_pcm_format_width(runtime->format)); > > if (err < 0) > > - goto out; > > + return err; > > > > memset(&alsa_stream->pcm_indirect, 0, sizeof(alsa_stream->pcm_indirect)); > > > > @@ -246,9 +244,7 @@ static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream) > > alsa_stream->pos = 0; > > alsa_stream->draining = false; > > > > - out: > > - mutex_unlock(&chip->audio_mutex); > > - return err; > > + return 0; > > looks like your are removing code which has been added in patch #14 ? No, the patch #14 corrects the missing error path. Without patch 14, the error from prepare is ignored. And this patch gets rid of the superfluous mutex lock. thanks, Takashi