Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3950248pxb; Mon, 4 Oct 2021 13:27:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWPlNe+ctdztU00Fy+VyY2mWLRg2BoAtC2ZbMxTeSIVvsulHdryjN/RBWYd0CrNaWAQa4o X-Received: by 2002:a62:1ec5:0:b0:446:40ec:73b2 with SMTP id e188-20020a621ec5000000b0044640ec73b2mr26759204pfe.5.1633379236850; Mon, 04 Oct 2021 13:27:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633379236; cv=none; d=google.com; s=arc-20160816; b=g+e/bfuPUq7/GH7pbiNClSPJTG5DSqbf0hAo2djDmcTVVIoYvngi4ikPeOKC9Z4O4D OIbQtqYuiZPLZ3dEOyA+Q5ZMSXmdkCbacn/BD2TIbULahUD7DOK6ILZZrtX9VB62Z/Ko LBbexSLFUm7Ct/gogFzauUce12aKhGv2our/5Kne1M/tIDV8j2qbY9bnI0ZCePOUTDkS zS2Phw9OY8JpwRBWBjd573hrTwLSVg0DgBd2YZFYd7xOoRs3cSW8CjBbHTnDzLKSLNg6 hzrNc9vhFLZ7M5b4uKtX4D26Jswiaxv8TxEPNqJfz4wGNLISHXnpXFGuWhudPgIovqwi Linw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XJscC5TJA9kgknSsQ/x2m4xtQhY5BWkyQ8QLbAz85c0=; b=GmPjIJBN5AiAZtfE8THlNMrlJU7uvOQNXA25ry925B3+bC8+L3D4DYbUYOTIpeGSUR 8HuH/5e9iNi+ieWtvjcsrk95DXnytH5FavTZ4bY8zazjkeJRxgfT3uKOpZCzmTbmpq9F K3PvWs1RYFT89wwCTdD4FCpk+gZULrln6KmI3QDFfeWOeI8Ki/7YwSS8DbeCQ5OG2jcb yFxYD3dfYMGBnZPokdq3Xjm4VrA1Wo5Ltz9Pw/hbQzhKTsxoouXoV5gqjcatqm/7skgi xWf6yw9nTTXyM/LpICUnLAgv/a0WMDl18DwX0ziy3/dhYaWZV55ChKfqYcbsxou9OI3S CEtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dlcEjhDT; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j5si18267103pjg.71.2021.10.04.13.27.03; Mon, 04 Oct 2021 13:27:16 -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=@linuxfoundation.org header.s=korg header.b=dlcEjhDT; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237693AbhJDNa6 (ORCPT + 99 others); Mon, 4 Oct 2021 09:30:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:43772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237594AbhJDN2j (ORCPT ); Mon, 4 Oct 2021 09:28:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 95F2F63219; Mon, 4 Oct 2021 13:13:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353182; bh=ZQFhLovf9cK9e7rHiKmBKbVrGRguF8IQZ1ubrOn7PC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dlcEjhDTjd4lFeqtuQBB/ilEQItY97FYypMMN6NJwwB1ridiLlbGSwiobeHZPQzTV 1RDeg67Dbz38X5K7/qOttM0SJ2Yy6akVG5XRkZKFjNouEi+H5FIxEdgqJkk/tW2NK3 PED2OZQ5Xh4hVWDa4Nske9AzbVM0jCeEOBJyM13I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shengjiu Wang , Mark Brown , Sasha Levin Subject: [PATCH 5.14 007/172] ASoC: fsl_spdif: register platform component before registering cpu dai Date: Mon, 4 Oct 2021 14:50:57 +0200 Message-Id: <20211004125045.195007437@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shengjiu Wang [ Upstream commit ee8ccc2eb5840e34fce088bdb174fd5329153ef0 ] There is no defer probe when adding platform component to snd_soc_pcm_runtime(rtd), the code is in snd_soc_add_pcm_runtime() snd_soc_register_card() -> snd_soc_bind_card() -> snd_soc_add_pcm_runtime() -> adding cpu dai -> adding codec dai -> adding platform component. So if the platform component is not ready at that time, then the sound card still registered successfully, but platform component is empty, the sound card can't be used. As there is defer probe checking for cpu dai component, then register platform component before cpu dai to avoid such issue. Fixes: a2388a498ad2 ("ASoC: fsl: Add S/PDIF CPU DAI driver") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1630665006-31437-5-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/fsl/fsl_spdif.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 8ffb1a6048d6..1c53719bb61e 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -1434,16 +1434,20 @@ static int fsl_spdif_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); regcache_cache_only(spdif_priv->regmap, true); - ret = devm_snd_soc_register_component(&pdev->dev, &fsl_spdif_component, - &spdif_priv->cpu_dai_drv, 1); + /* + * Register platform component before registering cpu dai for there + * is not defer probe for platform component in snd_soc_add_pcm_runtime(). + */ + ret = imx_pcm_dma_init(pdev, IMX_SPDIF_DMABUF_SIZE); if (ret) { - dev_err(&pdev->dev, "failed to register DAI: %d\n", ret); + dev_err_probe(&pdev->dev, ret, "imx_pcm_dma_init failed\n"); goto err_pm_disable; } - ret = imx_pcm_dma_init(pdev, IMX_SPDIF_DMABUF_SIZE); + ret = devm_snd_soc_register_component(&pdev->dev, &fsl_spdif_component, + &spdif_priv->cpu_dai_drv, 1); if (ret) { - dev_err_probe(&pdev->dev, ret, "imx_pcm_dma_init failed\n"); + dev_err(&pdev->dev, "failed to register DAI: %d\n", ret); goto err_pm_disable; } -- 2.33.0