Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1885236ybz; Thu, 30 Apr 2020 07:12:31 -0700 (PDT) X-Google-Smtp-Source: APiQypJUSo7IjDvDZvaxSSBWFXCWe9BE0LK0gjWl1MdnVIht94FnmMFpQTOyG14tGvn+gxyADLJo X-Received: by 2002:a17:906:8282:: with SMTP id h2mr3008132ejx.250.1588255951202; Thu, 30 Apr 2020 07:12:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588255951; cv=none; d=google.com; s=arc-20160816; b=mpJU+uhMkNvi+lDMgxGWG6eMrtwZwo9xyRh5rtboijZ9oNHeF+agAjL/l5ON+0yc5l f/ohFjizGOjcd3hnt9rhueBDv1VVCop1WV4IHPO2H811GF9GI1FReAa0TjTVaNwfBbN4 V/ap9DH2Jf9rkPQSB4Xrje2+ocFJdJ9jSEMKkFITsWvdIPTD4dH2fdHDdLZdJAcjZ/3f iP5i8F7KKTO5COwU/XPkV8kpKAzZBBC7m8HfY1qPRjM4XFs2JhW9NdsH6lQGBhWuLECE iUM40L/jGSfShjjSDviia5Ik19EkTyowLjFh+Rp/MeihJ7g7Fd4MHweVO/RmL2XrGShK WkXg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IVPg62Cfos2Ke99kPsV76tAAh+Dx3wLcs1uIT4clb24=; b=CKN+RsYxlgAN0PZNCyrhOsNZYMATf/tUZYRja4F9ZIAIe+iEeH8kTN4nXBmCp9IlUD iQLO0RlWsCfPTAdpCbUMJbiKugUlUYSVzNFrlY49eghcFC8AyQ1aJm7lNtQAsQHB98iB 2eJ7OmYaWEIaPOCec5ILJFZrkzEStmWOQX2o5kmtBL2z2GLlHkI8brVZ6F9h7zXuprYG 4O0pZWnP2GleV3hyJPPC5Zbnpp8cOmnc71uRwzpbZKBXxtZy9QmS66pDpxuNFXGROWAE 4sAE0jkukVjYg7aB7HlofQ8+jl9w01/K2+SBpzqvUPGqXJnaNcqbD3uWTAPtUwghk6ro VRhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="e8Zbt/oL"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si5786192ejt.145.2020.04.30.07.12.07; Thu, 30 Apr 2020 07:12:31 -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=@kernel.org header.s=default header.b="e8Zbt/oL"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728690AbgD3OKd (ORCPT + 99 others); Thu, 30 Apr 2020 10:10:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:60030 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726793AbgD3Nvg (ORCPT ); Thu, 30 Apr 2020 09:51:36 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CCBC4208D5; Thu, 30 Apr 2020 13:51:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588254695; bh=HvgQtozXPajYVnHS90k19ocaTh/Mfax+KW0Y9WIaGKY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e8Zbt/oLXNVBN2tX4ubBEhZrbuDKcIdIEq5nxPtFk+ke+xT65NV2sBELAoDSQIBDu 34W3r8M4KwSSTWhII08tvhy8Z4wSf59kXnSN/Okix6fUD5Rkv+FPmAzzV7v/dwcmpb lRE7p4kXVl7U0VvZaZ8NmImJJxPxwnXWL4+Ftees= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jerome Brunet , Mark Brown , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.6 45/79] ASoC: meson: axg-card: fix codec-to-codec link setup Date: Thu, 30 Apr 2020 09:50:09 -0400 Message-Id: <20200430135043.19851-45-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430135043.19851-1-sashal@kernel.org> References: <20200430135043.19851-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jerome Brunet [ Upstream commit 1164284270779e1865cc2046a2a01b58a1e858a9 ] Since the addition of commit 9b5db059366a ("ASoC: soc-pcm: dpcm: Only allow playback/capture if supported"), meson-axg cards which have codec-to-codec links fail to init and Oops: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000128 Internal error: Oops: 96000044 [#1] PREEMPT SMP CPU: 3 PID: 1582 Comm: arecord Not tainted 5.7.0-rc1 pc : invalidate_paths_ep+0x30/0xe0 lr : snd_soc_dapm_dai_get_connected_widgets+0x170/0x1a8 Call trace: invalidate_paths_ep+0x30/0xe0 snd_soc_dapm_dai_get_connected_widgets+0x170/0x1a8 dpcm_path_get+0x38/0xd0 dpcm_fe_dai_open+0x70/0x920 snd_pcm_open_substream+0x564/0x840 snd_pcm_open+0xfc/0x228 snd_pcm_capture_open+0x4c/0x78 snd_open+0xac/0x1a8 ... While initiliazing the links, ASoC treats the codec-to-codec links of this card type as a DPCM backend. This error eventually leads to the Oops. Most of the card driver code is shared between DPCM backends and codec-to-codec links. The property "no_pcm" marking DCPM BE was left set on codec-to-codec links, leading to this problem. This commit fixes that. Fixes: 0a8f1117a680 ("ASoC: meson: axg-card: add basic codec-to-codec link support") Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20200420114511.450560-2-jbrunet@baylibre.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/meson/axg-card.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c index 1f698adde506c..2b04ac3d8fd3b 100644 --- a/sound/soc/meson/axg-card.c +++ b/sound/soc/meson/axg-card.c @@ -586,8 +586,10 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np, if (axg_card_cpu_is_tdm_iface(dai_link->cpus->of_node)) ret = axg_card_parse_tdm(card, np, index); - else if (axg_card_cpu_is_codec(dai_link->cpus->of_node)) + else if (axg_card_cpu_is_codec(dai_link->cpus->of_node)) { dai_link->params = &codec_params; + dai_link->no_pcm = 0; /* link is not a DPCM BE */ + } return ret; } -- 2.20.1