Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1348540pxf; Fri, 19 Mar 2021 05:24:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhU1VeE1x3mSadoIMYyQZQ6PVd2TIKyL8PGJ7b8FDltku+/kE8YYOM8dX7rKDgdlVk90iL X-Received: by 2002:aa7:d1cd:: with SMTP id g13mr9134824edp.369.1616156685935; Fri, 19 Mar 2021 05:24:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616156685; cv=none; d=google.com; s=arc-20160816; b=DK2eRHqHLVC7tlmLAnjE9ePtmrGWi0gflfY+wjn3wIcvxLt/HZ3feugewJNGgAJuZe aOAdNQGLmqRPkxFn2AvpQfQ2HL3ysUxI211keCNW+7K4v8TAqoATM518g3UawiRJgyM5 1mf6+QuCsp/uUmLAkPBHzYjvnXl+nc6e0RqP++h1lA8F3qGC5oFFKavfmdL10qUElTYv LeLjxEZSopWU+wrN4aGKpTIFPW6VYSampw1k8OCVB5z3oXwTta2PmEhbSjhLcjaKGDkR o/L4gcLjqeUZSXPPO9UeZNwKjudZ53oDTaWDb22Y6h9IFoQhU1Bv7+qR+kYFJCZMHPKk IY3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=riosyaDYO5D5dNdkrVUgDfVDFWD8gj/it/WWcWe8hEI=; b=f3PSAy5RuEdzMoIaq7eezFnLgZCBD3v6lxaPN20ZedoYOWDcXzOByn5FRNDgAxFuRn j4W6byVLeNvshUYXd8KaSAuzI0ZRwpp0mPYZjRIHn9WFDPp1cq7y1xRYqyCGonfMBRiw x2DhNoiB7mpPYN+q80AUMwBK8mErCuNb4Z5T9s3ixtHKbVXHgvxOTMOAu62ovRzpTJI2 2w1XpswYZPlI/HrJFMpPdMJ7775Z07oqF6dFuYFt+x0PLYoWqmmJs4Ua/J8VgrNABor0 nadbZY8lik45HF+KsRt7Z9U3SAkC710hCk0E/bGRDVYFjXYRJRFA8PsZDgc2I/9wvr7F /tDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LduzkEVk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k22si4231615edv.400.2021.03.19.05.24.24; Fri, 19 Mar 2021 05:24:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LduzkEVk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230521AbhCSMU3 (ORCPT + 99 others); Fri, 19 Mar 2021 08:20:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:57772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230453AbhCSMT7 (ORCPT ); Fri, 19 Mar 2021 08:19:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1880764F75; Fri, 19 Mar 2021 12:19:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1616156399; bh=KYDgQbS3tlwEfUBobQ6Qwxw3RMAUnDVO4mu0lFbu1VQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LduzkEVkQeo5H6flYB/cReRYWHlGGXg2RoL02BM+uNVcAOuKF8Ao5INo+KWcqd1sq 0I/WCuJ+pLT7WoMMVvxWIs82xOWXSpRuJBZR3V5u/Cd539+rlOzhtMBi4hzUxNLzvS r9HjuSb3U2nA9378bTV23X5gY9xWdhEky+ruVJa8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai , Sudip Mukherjee Subject: [PATCH 5.10 12/13] ALSA: usb-audio: Dont avoid stopping the stream at disconnection Date: Fri, 19 Mar 2021 13:19:09 +0100 Message-Id: <20210319121745.503824062@linuxfoundation.org> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210319121745.112612545@linuxfoundation.org> References: <20210319121745.112612545@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai commit 257d2d7e9e798305d65825cb82b0a7d1c0511e89 upstream In the later patch, we're going to issue the PCM sync_stop calls at disconnection. But currently the USB-audio driver can't handle it because it has a check of shutdown flag for stopping the URBs. This is basically superfluous (the stopping URBs are safe at disconnection state), so let's drop the check. Fixes: dc5eafe7787c ("ALSA: usb-audio: Support PCM sync_stop") Cc: Link: https://lore.kernel.org/r/20210206203052.15606-4-tiwai@suse.de Signed-off-by: Takashi Iwai [sudip: adjust context] Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman --- sound/usb/endpoint.c | 3 --- sound/usb/pcm.c | 5 +---- 2 files changed, 1 insertion(+), 7 deletions(-) --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -576,9 +576,6 @@ static int deactivate_urbs(struct snd_us { unsigned int i; - if (!force && atomic_read(&ep->chip->shutdown)) /* to be sure... */ - return -EBADFD; - clear_bit(EP_FLAG_RUNNING, &ep->flags); INIT_LIST_HEAD(&ep->ready_playback_urbs); --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -280,10 +280,7 @@ static int snd_usb_pcm_sync_stop(struct { struct snd_usb_substream *subs = substream->runtime->private_data; - if (!snd_usb_lock_shutdown(subs->stream->chip)) { - sync_pending_stops(subs); - snd_usb_unlock_shutdown(subs->stream->chip); - } + sync_pending_stops(subs); return 0; }