Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3774404pxb; Mon, 4 Oct 2021 09:18:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymSXIlzqyUfoYphVRO3v3EKsNs/xHRox1SbPxrLSfQapKmJScczollF4K3g48ZEOFr0dFO X-Received: by 2002:a17:906:7b54:: with SMTP id n20mr17744728ejo.525.1633364298314; Mon, 04 Oct 2021 09:18:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633364298; cv=none; d=google.com; s=arc-20160816; b=R8GjY5ofTKNEXRdIGnJbgk8VINWaMosJyW5AFsh4YK5KZdSvkFU3Fgwd8sqslULMcK bMqTIzPN9mijtou5ex5ll4vDV1TNqY0usJHGKich4WN9cmshKaINlUuBWNDObQ9JiWfG 0xL+6I7SjolrSEqw4tO9lUGiHgp5oOG7RYkPFOknJM536/PWHtfR54j5cNXo1lFUWhi5 /UwCggeEqKTULTfmFRAR1tYXb/X/HB94vnVct4MC99q2otL2l8p58reIOHo1M6dmFPyk m54FXPlgb25K1ziZuZx7/sfbZIQ3N5DzU1iCWsN06Ztey6tOMAzKU2wXMi3h9FN3lQtQ HZvg== 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=Lw28bXqPfZQS0kLwEV4rQqcarMC3VzqB6puK+8Eca7E=; b=W7PZqkUcePwVbIhe5vHBJ0xyuPuHgfD5zx1MmuOSqlCuHzdkvmpMP2USv5YWVtv0Bb pu11qPbpE8O0V4CwowzfnXeZzodrOqzZc2xgWVBoFpdtRrlVh4MhFDVYT8jMUmxSXcQb Vl0ZjG6oGVlFkMTjU233ypfHg7rOYYQVZF8BdJssPekrzuqwxB57flfdDirpnXwLgVDK FcEiAVM1C+wWyZBmEgicBwx+C1d6jeQT6BU5V5t/xE8qB6fQsg+C8CyMLUnEzj3B4ZgE d2ZafGKdwxugT6cV9UkafgdEpyLJQMYYOPOt7bbpOSkzVHTjxUEWx5y14ZXMgq84Y/Df m5Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rGVhcvDP; 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 y1si19612434ejk.130.2021.10.04.09.17.53; Mon, 04 Oct 2021 09:18:18 -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=rGVhcvDP; 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 S236591AbhJDNbB (ORCPT + 99 others); Mon, 4 Oct 2021 09:31:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:43788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237612AbhJDN2k (ORCPT ); Mon, 4 Oct 2021 09:28:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1C64F630EF; Mon, 4 Oct 2021 13:13:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353184; bh=ol1Ud4I99kMsTCv+cnLrcTXo/MlSDVsH/d8koUErul0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rGVhcvDPbRNFIuGfPnRRsOiAqcW6EsYrrkgANedelGZMzHZVys0FeDOed0llvCQhr ynM6JeW7RdPRhLg4huPyAZaqASpddbERAdrJdCBuCI2UpUORogD/drZkOIBHMDQhk/ H0tEecm1UxM6OSgI7UOAITZxyDwGb7jwjnj83xtM= 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 008/172] ASoC: fsl_xcvr: register platform component before registering cpu dai Date: Mon, 4 Oct 2021 14:50:58 +0200 Message-Id: <20211004125045.234068794@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 c590fa80b39287a91abeb487829f3190e7ae775f ] 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: 28564486866f ("ASoC: fsl_xcvr: Add XCVR ASoC CPU DAI driver") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1630665006-31437-6-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/fsl/fsl_xcvr.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c index fb7c29fc39d7..477d16713e72 100644 --- a/sound/soc/fsl/fsl_xcvr.c +++ b/sound/soc/fsl/fsl_xcvr.c @@ -1217,18 +1217,23 @@ static int fsl_xcvr_probe(struct platform_device *pdev) pm_runtime_enable(dev); regcache_cache_only(xcvr->regmap, true); + /* + * Register platform component before registering cpu dai for there + * is not defer probe for platform component in snd_soc_add_pcm_runtime(). + */ + ret = devm_snd_dmaengine_pcm_register(dev, NULL, 0); + if (ret) { + dev_err(dev, "failed to pcm register\n"); + return ret; + } + ret = devm_snd_soc_register_component(dev, &fsl_xcvr_comp, &fsl_xcvr_dai, 1); if (ret) { dev_err(dev, "failed to register component %s\n", fsl_xcvr_comp.name); - return ret; } - ret = devm_snd_dmaengine_pcm_register(dev, NULL, 0); - if (ret) - dev_err(dev, "failed to pcm register\n"); - return ret; } -- 2.33.0