Message ID | 20230623-asoc-fix-meson-probe-v1-1-82b2c2ec5ca4@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp6040606vqr; Fri, 23 Jun 2023 14:07:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7hSXudm6MCTVnu5JO5AIaxUrgupYkZGRkDiY0brcZC1qU8z3lRFVqdMEOacPjXHHUXnKTO X-Received: by 2002:a05:6359:5a3:b0:132:d912:6c99 with SMTP id ee35-20020a05635905a300b00132d9126c99mr4416057rwb.9.1687554422449; Fri, 23 Jun 2023 14:07:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687554422; cv=none; d=google.com; s=arc-20160816; b=Ita+vJzEXJNHohnwsBjpK056PplZE7LUuVbpiveoEVI5X5kYSeK+LFUVNFLQRKDAE1 Nh13UfPF6VaUBvQDtvk9b79QRSnB1/x0i/+v2JXHxYO+8Jh2ytFoz69rL65RfpyhB4IY fkpAl/whNM2HvHakOh7Z5SBMUlv4WQUfvrcWHCZ38UG6EWNV797TjVUOdm0OEtlOFTlV bxrmpyrO9AzT5lbDcW9ORiMWU39Ro9cZKPVZWQQ1Hk0jLQq5jr5L2El7eV0Mvn4vyjx7 v+9LhKHq5CQtQEVG67qy9+sYD+yxDMtbh/BWnolr2fvZFDVDupn+k5TzxA6ExTObMZni wfRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=4suvYzezz47qEeZLQtpKyXWZjRynjsxyMM7bBm++ZoI=; fh=14DUqB3nhuAgdrEwC9mc56CxHY9NW+Sr5APmdmILKSU=; b=07cKMRR5r16pVNnnBfMYONrJphhab+j8uPv6XpqyhWUybdXgrFmJCIcK2AI+9qgd2f pPUwg0HqVXDXYpoh/Jg0QkaSW7eIaQI0RrsRghtWUz4jSIdFZ42FSE29FdXdAnbuKcOR Xc5ntvAAMe4ecHEsO78Yaj4cMxyyITUwlhV1iBA29rcq301qiBOu1bKR7+XhTS6xJDxS 9e2OnDpJ/L4foYoXaUpOnJfMxfO0URO1t4iimYRROX4V4KmXI303niNQ65ZD/Fr9TxPE 7m2WaI7zTu1t6000CxZ/zq44zoxs9GebfjLeHSmFmiZYpacVtsnkWj6k7wXT/6F6ekfa HExA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VlCJlzWi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g30-20020a63201e000000b0052c419dc8d1si225569pgg.274.2023.06.23.14.06.49; Fri, 23 Jun 2023 14:07:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VlCJlzWi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231855AbjFWVEy (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Fri, 23 Jun 2023 17:04:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbjFWVEw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 23 Jun 2023 17:04:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD3FC2114 for <linux-kernel@vger.kernel.org>; Fri, 23 Jun 2023 14:04:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 686C161B5A for <linux-kernel@vger.kernel.org>; Fri, 23 Jun 2023 21:04:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 198ABC433C8; Fri, 23 Jun 2023 21:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687554289; bh=7hI9rVh1AROgGPI9A/ZuJDlHTrmVy3Qkk2LrdeMj2Kk=; h=From:Date:Subject:To:Cc:From; b=VlCJlzWiJhxlsIWBv4CSmwjV0upRi6bO6AsGQu1Ee+4kXm7LGHaaAD/uJGeLtSZjr q9M9qjSpKlw+cYOXxUlhV+qwBt/zshTr73l3O7zRynpFoEINfId2hV8uMFHvPHbLib DzuSLSfdOILXsnOUOu9tedmGJSejKmy+n+Rp7mTr9lV2MEaw1A7cZHj/xhZoqiwm/R C581VpO+YtYn/NaaZl9NUR4dltaNMZxP6giVB+/VUmXO8vTKa72OUDIBOWQ36A7bWN JPqa2n7fMeveCGq4CNTld6Lk+vgpKvSa66ztmQ26zFHZ5TbfUqwTMnQ8/x19I0yKUr 66I4HFPC6tFHg== From: Mark Brown <broonie@kernel.org> Date: Fri, 23 Jun 2023 22:04:39 +0100 Subject: [PATCH] ASoC: core: Always store of_node when getting DAI link component MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230623-asoc-fix-meson-probe-v1-1-82b2c2ec5ca4@kernel.org> X-B4-Tracking: v=1; b=H4sIAOYIlmQC/x3NwQqDMBCE4VeRPXeLSazQvkrpIRvHmkMT2YVSE N+90ePP8DEbGTTD6NFtpPhmy7W0cJeO0hLLG5yn1uR7H/rRB45WE8/5xx9YLbxqFfB9QJqcCwI RalSigUVjScuBTzNeb8e0Kpo+H5+vff8DeQlCsoEAAAA= To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.13-dev-c6835 X-Developer-Signature: v=1; a=openpgp-sha256; l=2220; i=broonie@kernel.org; h=from:subject:message-id; bh=7hI9rVh1AROgGPI9A/ZuJDlHTrmVy3Qkk2LrdeMj2Kk=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBklgju/hRIWDmE+d0m//kTBjqBjvxFk+xPU8keL uIdzkUSermJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZJYI7gAKCRAk1otyXVSH 0KeCB/47Tcfz9mxx4ktjj+ob071MA3r7VDmxA4L4Y8SZmFa15oo3ev5L1UnwYw02OZciRhTspyB DdRPC3Ws7UxmCX/cvSlAdcq9ZV6OcCzmhkTRlMC7coRblp5PuopGC40rNDXfI9pPri08Z6wGaHX wk3TBK6iL1Rb7u1e/QL8Z+S6SUt1OVv4L1wWytnqb34u+zx4Aa1wPF+VJb7cOtU3b2ch9urcBCw HzGE3jaKBWaWyhAG6irJ8zJcq2AbYXAIv99WxMahylDkz3UvAlU+cd4I2wQES+xtC7KFmxf803u l/CQOrhnlNf/Qe6oIyUA/KQ6qIwxnRXMLx6sRq/kfH8VvHSE X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769529066352715660?= X-GMAIL-MSGID: =?utf-8?q?1769529066352715660?= |
Series |
ASoC: core: Always store of_node when getting DAI link component
|
|
Commit Message
Mark Brown
June 23, 2023, 9:04 p.m. UTC
The generic snd_soc_dai_get_dlc() contains a default translation function
for DAI names which has factored out common code in a number of card
drivers, resolving the dai_name and of_node either using a driver provided
translation function or with a generic implementation. Unfortunately the
of_node can't be set by the translation function since it currently doesn't
have an interface to do that but snd_soc_dai_get_dlc() only initialises the
of_node in the case where there is no translation function.
This breaks the Meson support after conversion to use the generic helpers
since the DPCM cards for it check which component of the SoC is connected
to each link by checking the compatible for the component and the Meson
components provide a custom operation so don't use the generic code.
Fix this and potentially other cards by unconditionally storing the node in
the dai_link_component, there shouldn't be a binding specific of_node
selected since that's how we determine the translation function.
Fixes: 2e1dbea1f8a3 ("ASoC: meson: use snd_soc_{of_}get_dlc()")
Fixes: 3c8b5861850c ("ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()")
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/soc-core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
base-commit: 154756319cc6f8b8b86241da02da6a8fcc6abd1f
change-id: 20230623-asoc-fix-meson-probe-94ecd113bebb
Best regards,
Comments
On Fri, 23 Jun 2023 22:04:39 +0100, Mark Brown wrote: > The generic snd_soc_dai_get_dlc() contains a default translation function > for DAI names which has factored out common code in a number of card > drivers, resolving the dai_name and of_node either using a driver provided > translation function or with a generic implementation. Unfortunately the > of_node can't be set by the translation function since it currently doesn't > have an interface to do that but snd_soc_dai_get_dlc() only initialises the > of_node in the case where there is no translation function. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] ASoC: core: Always store of_node when getting DAI link component commit: 2d0cad0473bd1ffbc5842be0b9f2546265acb011 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
Hi Mark Thank you for the patch ! > The generic snd_soc_dai_get_dlc() contains a default translation function > for DAI names which has factored out common code in a number of card > drivers, resolving the dai_name and of_node either using a driver provided > translation function or with a generic implementation. Unfortunately the > of_node can't be set by the translation function since it currently doesn't > have an interface to do that but snd_soc_dai_get_dlc() only initialises the > of_node in the case where there is no translation function. > > This breaks the Meson support after conversion to use the generic helpers > since the DPCM cards for it check which component of the SoC is connected > to each link by checking the compatible for the component and the Meson > components provide a custom operation so don't use the generic code. > > Fix this and potentially other cards by unconditionally storing the node in > the dai_link_component, there shouldn't be a binding specific of_node > selected since that's how we determine the translation function. > > Fixes: 2e1dbea1f8a3 ("ASoC: meson: use snd_soc_{of_}get_dlc()") > Fixes: 3c8b5861850c ("ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()") > Signed-off-by: Mark Brown <broonie@kernel.org> > --- Yes, indeed. But I think we want to set it under lock and if ret was no error case ? ---------- diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index ab1f302ee078..5cc3f4cc9d1b 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3375,7 +3375,6 @@ int snd_soc_get_dlc(const struct of_phandle_args *args, struct snd_soc_dai_link_ id--; } - dlc->of_node = args->np; dlc->dai_name = snd_soc_dai_name_get(dai); } else if (ret) { /* @@ -3389,6 +3388,10 @@ int snd_soc_get_dlc(const struct of_phandle_args *args, struct snd_soc_dai_link_ break; } + + if (ret == 0) + dlc->of_node = args->np; + mutex_unlock(&client_mutex); return ret; } ----------- Thank you for your help !! Best regards --- Kuninori Morimoto
On Sun, Jun 25, 2023 at 11:54:29PM +0000, Kuninori Morimoto wrote: > > The generic snd_soc_dai_get_dlc() contains a default translation function > > for DAI names which has factored out common code in a number of card > > drivers, resolving the dai_name and of_node either using a driver provided > Yes, indeed. > But I think we want to set it under lock and if ret was no error case ? It doesn't really matter - there's only one possible result, and nothing should be looking at the dlc unless we return success, but yes that'd probably be a little cleaner providing we don't ever return early.
On Mon, Jun 26, 2023 at 12:49:16PM +0100, Mark Brown wrote: > On Sun, Jun 25, 2023 at 11:54:29PM +0000, Kuninori Morimoto wrote: > > > > The generic snd_soc_dai_get_dlc() contains a default translation function > > > for DAI names which has factored out common code in a number of card > > > drivers, resolving the dai_name and of_node either using a driver provided > > > Yes, indeed. > > But I think we want to set it under lock and if ret was no error case ? > > It doesn't really matter - there's only one possible result, and nothing > should be looking at the dlc unless we return success, but yes that'd > probably be a little cleaner providing we don't ever return early. BTW that's not to say don't submit this as a patch, just that it doesn't need to get applied as a fix.
Hi Mark Thank you for the mail > > > But I think we want to set it under lock and if ret was no error case ? > > > > It doesn't really matter - there's only one possible result, and nothing > > should be looking at the dlc unless we return success, but yes that'd > > probably be a little cleaner providing we don't ever return early. > > BTW that's not to say don't submit this as a patch, just that it doesn't > need to get applied as a fix. Thanks. I thought it is not a big deal. But yes, will post a patch. Thank you for your help !! Best regards --- Kuninori Morimoto
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index f06a20773a34..11bc5250ffd0 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3262,6 +3262,8 @@ int snd_soc_get_dlc(const struct of_phandle_args *args, struct snd_soc_dai_link_ struct snd_soc_component *pos; int ret = -EPROBE_DEFER; + dlc->of_node = args->np; + mutex_lock(&client_mutex); for_each_component(pos) { struct device_node *component_of_node = soc_component_to_node(pos); @@ -3300,7 +3302,6 @@ int snd_soc_get_dlc(const struct of_phandle_args *args, struct snd_soc_dai_link_ id--; } - dlc->of_node = args->np; dlc->dai_name = dai->driver->name; if (!dlc->dai_name) dlc->dai_name = pos->name;