Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1829362imm; Mon, 3 Sep 2018 10:30:33 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaF9Mmo6i1W5dMgGfCG9QwRDzLXEzKVdR94m0rkp31Eb8/Y7Cpz7eOuxbthDooiDvgwKGqd X-Received: by 2002:a63:1363:: with SMTP id 35-v6mr27519926pgt.202.1535995833080; Mon, 03 Sep 2018 10:30:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995833; cv=none; d=google.com; s=arc-20160816; b=Cd1J+32rnMivCN5ukzvlstFBdlrH6uMFJzTCa8tpZ//+KTG0AopmTEMgaOjBDjfacX MtuuzHdDRziaZAss1xgCc+2uU1FK1+s7/yFUN0ggabTap3xGpxe6MdKlcB0XhFH0aLq4 R+yiAXNLJxRIqVC3n6zqrLkQAq1bbizjaLrD2wPuURia9tAjGz5NqwXFa0G3WFHIBl+L xd8/hOsF8H1N6Cp/a08k/DbZDWfIV0VHWtCLz7b5cDvCbynt3cOzapfTnxU9OWeqytJK h1lZ3icz+2Y0l4Eo5SvklpMhUggB7c8raNt/4rh355ltGF9R90QD9R6iiesxjBoXk//y su+w== 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:message-id:date:subject:cc:to:from :arc-authentication-results; bh=I5Boz8scMa0ZIpf1f30p3UPDxa4Eigda3rJqV7EYC+I=; b=JkRbdX6Mx6N/eAf70b/W8416THJCXxwAufYTtbH6ccR+5idKlJFnpR8CY3CAI4smMQ l0mF5o0meWRXjbLjnTXQ/TwYjS4N5ZZ+b2UF7b73TdfR8k+aEal6onMkfMGANt5lApKo PD9PrOyxOrDpLHJatqBfMgaBRVNZbvsiJ6T5848wj0AiPEvPbekEnlfZ4GgjT5uiaeWR X7usV3XoWSnpIaEPwCPNTULIYv5eMHEvEG2U9ZfhExpAujkSxsGVcEH5c0H36g/9n0oT DUYwG/o8HkAcmyoH7jalvTN28SFP0QvwmnVGUlloX+tyoLYIKrJ4F55ajSbGNAaoGQ4T CBYg== 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 ay12-v6si7699082plb.336.2018.09.03.10.30.18; Mon, 03 Sep 2018 10:30:33 -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 S1731247AbeICVuQ (ORCPT + 99 others); Mon, 3 Sep 2018 17:50:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46530 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730623AbeICVuQ (ORCPT ); Mon, 3 Sep 2018 17:50:16 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CF8E3D16; Mon, 3 Sep 2018 17:29:07 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jerome Brunet , Mark Brown Subject: [PATCH 4.14 131/165] ASoC: dpcm: dont merge format from invalid codec dai Date: Mon, 3 Sep 2018 18:56:57 +0200 Message-Id: <20180903165702.132630311@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: Jerome Brunet commit 4febced15ac8ddb9cf3e603edb111842e4863d9a upstream. When merging codec formats, dpcm_runtime_base_format() should skip the codecs which are not supporting the current stream direction. At the moment, if a BE link has more than one codec, and only one of these codecs has no capture DAI, it becomes impossible to start a capture stream because the merged format would be 0. Skipping invalid codec DAI solves the problem. Fixes: b073ed4e2126 ("ASoC: soc-pcm: DPCM cares BE format") Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- sound/soc/soc-pcm.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1607,6 +1607,14 @@ static u64 dpcm_runtime_base_format(stru int i; for (i = 0; i < be->num_codecs; i++) { + /* + * Skip CODECs which don't support the current stream + * type. See soc_pcm_init_runtime_hw() for more details + */ + if (!snd_soc_dai_stream_valid(be->codec_dais[i], + stream)) + continue; + codec_dai_drv = be->codec_dais[i]->driver; if (stream == SNDRV_PCM_STREAM_PLAYBACK) codec_stream = &codec_dai_drv->playback;