Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2431019imj; Mon, 18 Feb 2019 06:00:18 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia3vc/SNKttX6Rp1H5KFpZyFvr3gh45VzPVBwQlA6Bojv7Y22h6oA1w45L5LwWoUjQ6sj1+ X-Received: by 2002:a17:902:8303:: with SMTP id bd3mr26118819plb.10.1550498417982; Mon, 18 Feb 2019 06:00:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550498417; cv=none; d=google.com; s=arc-20160816; b=REYCp1/kO9awoQ70P0xYbFH533Ox3mRHhJs2+m9EuquqxDHP3hQDo/J9YEQ2tj3uoL JAruikMcM3j/2bPyKhqijEpiterCfg3GAbGiskEUYdftEBfpky4sztphL9DsmLNf7p6y CIgnKJOEgBaKOb7cn6Q/aamH9tU1vYgMcM+t8SdOc0r2H3EmbYT3kj55TjR34tbJIQiy Z3s94bPd2nA0PiAoCOCYKp/TSzOjd4MzuCQaX7hEcKXLxWwcfPuhmDikmc12bJc6I78z CwjjBCfGk4nskdRuha/U89GuEL6x+5lzZ+HawOuPPDhwVA6usarE9D9CZI+iBoSBa8OI hRdA== 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=F2QBcnf/60/JkR1HxX8Kna2YVox5L0k+jxnY1zejrvU=; b=MdwRJ8UmLiW9Q7uJProGaPuhbjrloQDEzxAROiv3xHwAmqNiGqGzUDZAV+HfMrlXGC XTXweBk8jK/9/5SxbDgghXqwjMG+25/4olw1SpDGytgkfv4Iv1K+2QzPI6CCDqk8XglL NRrakipr/JHniSamyRipsrWAgC9UhHBHDK82ZwBXD2ILJl7VDOt3+gFOwryU7vQRz6bc Es1UopWoqyCIFl+54pDA7oJBY8QeEYv7HxjrJMORXxRgMeLFZucVuCZ0SxTOTdKdXOD7 AKK7JsEDZRPbPJvqMVok2CjXeoE5zyMMtLemiiNWbIIAQapTbxXukKeF1ifXxSNFNkzN +WRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PT3whOks; 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 z10si14058401pgr.379.2019.02.18.06.00.02; Mon, 18 Feb 2019 06:00:17 -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=PT3whOks; 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 S2388493AbfBRN7M (ORCPT + 99 others); Mon, 18 Feb 2019 08:59:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:40134 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387427AbfBRN7L (ORCPT ); Mon, 18 Feb 2019 08:59:11 -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 A46A22070D; Mon, 18 Feb 2019 13:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498351; bh=mz1ItenpRPXbr+x2rWcYsVy5gR/Uesmv48f5npF1TH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PT3whOksCWH8xLRsKr3i6YLLLGWBonZ+eyHtayRf6rUXtY7KdvUlU2FyQbRp+xhHf 1n0lQDZH5qcY1IiNskvHeyh9gEeR5DVKVn8zKS1MH/SQnup0BXluzNxb50+o+nuieM Rl/is+4sM2yIrXmYf5W+bKt8SwRvfanws8XYCQC8= 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.9 40/58] ALSA: usb-audio: Fix implicit fb endpoint setup by quirk Date: Mon, 18 Feb 2019 14:44:01 +0100 Message-Id: <20190218133511.710974206@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133508.567416115@linuxfoundation.org> References: <20190218133508.567416115@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.9-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;