Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2470408imj; Mon, 18 Feb 2019 06:35:14 -0800 (PST) X-Google-Smtp-Source: AHgI3IaFtg24D0BaTahoCJfkLMnsR+i2eXmHFqCZu0arc4xA52tQvDB3BoERqu0yuSz8xoA2E7dL X-Received: by 2002:a63:c948:: with SMTP id y8mr19466732pgg.263.1550500514717; Mon, 18 Feb 2019 06:35:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550500514; cv=none; d=google.com; s=arc-20160816; b=Z4Eyi7CwWwBc+zDH8rPy+E9cg+GJjImUC7hIbyRrY5vOPbpBFdTN9HURJ9K3AbjzT+ BFIC5P3pJctyVWxNoGQpn5sRjbjh7JyqlAoDdm/GNE0KKIcZq0O8cUvWXnEtxojviUkX x3tLsKYkfiKdAk4Yy3wyHaFBJ1W9DwHaYT0TqIboAUsRJeFWBRKTli8aZMKkB6bN95of dFcUpu8A80M9YBFJxUaKFbRfhAt7co+cpDIulGv9LtI7iMtcvwV/c9Iyt/VLAkXi70H6 4/hr9G6XUaUup1rNh6vFMAGD4AnRqPttNYVos0neF0u9SOXxtakWmUIDsZXhBRJRzLJP jCyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H1fol04TXGnH8FlZHIoklZy03bl40N998rTdTAJ2glE=; b=s74sxOINNDYzsE2yy8AncdyNm3UE6ncAjlVLn6BFy+AAjaRDu1FiEEVE3NSct706Yb 6xbfflo1iEjEoaRPHFUk7KfSFSHOWooBVOXphOEgT5DGtBnBmufnJC7BeZq2m6YnHgK0 LdPYAYNYs4xEmMNpYBXyamjLQtnK067c4H3hO0eOHzd/ITe1MBN+ePJqU7XJXB4sOxjy +PmoP133EgksJ2hov5KNMM0vNOoutE32V4o3RUfgZbCYswTBWkxjI3lr+FNwLHVx7lBA MUNqfyaj9ftkDoqQqlmir2FsJXnojgGxv530Phhk11YLsNb1U7T05AOV8/G7jnh/KrjA 8X8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EQLD7zQm; 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 t20si13542180plo.360.2019.02.18.06.34.59; Mon, 18 Feb 2019 06:35:14 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=EQLD7zQm; 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 S2387834AbfBRN4f (ORCPT + 99 others); Mon, 18 Feb 2019 08:56:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:36760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730949AbfBRN4d (ORCPT ); Mon, 18 Feb 2019 08:56:33 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C36B5217D9; Mon, 18 Feb 2019 13:56:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498192; bh=FNogbKtoQc/yhXVjBXju00R1LI5JcbcQ41Pwe4WdEl4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EQLD7zQmXRJIH1mXKdkbN1x9sT8eE3C2AL86QbCrGU/ko3ckT1j29ACq7gbQUdTsu 3AYAKzsNQamZrFb5OMZf1QYIfxwpuOkZVlJK4fs5jRxCQx7iP6HKBY5n34Vx1+0RpL XqXJzKw1JNHiSYhOHNBDP79Vg9cBK3knX0WLUV9U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manuel Reinhardt , Takashi Iwai Subject: [PATCH 4.14 45/62] ALSA: usb-audio: Fix implicit fb endpoint setup by quirk Date: Mon, 18 Feb 2019 14:43:51 +0100 Message-Id: <20190218133509.716240418@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133505.801423074@linuxfoundation.org> References: <20190218133505.801423074@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Manuel Reinhardt commit 2bc16b9f3223d049b57202ee702fcb5b9b507019 upstream. The commit a60945fd08e4 ("ALSA: usb-audio: move implicit fb quirks to separate function") introduced an error in the handling of quirks for implicit feedback endpoints. This commit fixes this. If a quirk successfully sets up an implicit feedback endpoint, usb-audio no longer tries to find the implicit fb endpoint itself. Fixes: a60945fd08e4 ("ALSA: usb-audio: move implicit fb quirks to separate function") Signed-off-by: Manuel Reinhardt Cc: Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/usb/pcm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -313,6 +313,9 @@ static int search_roland_implicit_fb(str return 0; } +/* Setup an implicit feedback endpoint from a quirk. Returns 0 if no quirk + * applies. Returns 1 if a quirk was found. + */ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, struct usb_device *dev, struct usb_interface_descriptor *altsd, @@ -391,7 +394,7 @@ add_sync_ep: subs->data_endpoint->sync_master = subs->sync_endpoint; - return 0; + return 1; } static int set_sync_endpoint(struct snd_usb_substream *subs, @@ -430,6 +433,10 @@ static int set_sync_endpoint(struct snd_ if (err < 0) return err; + /* endpoint set by quirk */ + if (err > 0) + return 0; + if (altsd->bNumEndpoints < 2) return 0;