Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3981928pxb; Mon, 4 Oct 2021 14:21:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwChdr/xCAv46i4A8tkSwjn5Zsw4tq7mAl/tYKxjalgy7OtBaqZkidJ+7198+yXjCplRPm9 X-Received: by 2002:a63:d017:: with SMTP id z23mr12828883pgf.108.1633382502609; Mon, 04 Oct 2021 14:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633382502; cv=none; d=google.com; s=arc-20160816; b=G5FASOeK0ieI1zGLt0DEBegtc+8dSJdavEXqIXxtc8nQvBEFcpkWSb2xH+GdHK65UH MkDGmeX3+SmWE2hfzB4PjP2pZcgcV8klCbwhrsydy7RJJ25rq4eexOYJ9UqZ2IG0Lpff qd5I81AA11YPrB00c8cGuXwOBevvDLk/U2Se/pcrGxAuIWMC3GTDuF5vo7y5bIkyJ/Tp 3QhwlUpUqKRzusuHGfTzHJ96VGDZgNGJYazYvBSNbjXZIVvoMJrYy/kq02EfUHqlcbGT BSav2Uenk4ZcLIRzv1m/a/yw26sxvqJXLQ/zcxEjBY/sd9BGyzRBmEC2Pp9R8HxgEJA7 VcqA== 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=YEPS0pE5xhYaxeU9fk/SR0AjpKSQFIU2bvlGyENtSpE=; b=kkSVHKm/H+S4MsnCYgeeajWDHO8GITLk+4Ow80aPKI8rG/ptvc1UApfDYJFl7uRFM+ qrmVdSZA41E/jJ7Nk2a+HRAi/zMQAMa7B9sRTnpth0hncMkOfx/kCuHT1lizitnf5RBa dC8JGakG87KoYIJK3W26Yl0hNbhPRJ+lRWMNHWWCal8N8yk+5DV9Ezz3NDFzABqXiAPn T/w1ltEsx/6J34FiQTKVzRLJLT0iQW0rZgEFgQp+XZBuprRl9NoOW26YSznnLBC66xm0 wjGlxyijDcOr4NifrRpt9E9AiNQmpXafnBYdQ6+MTXtHyLvj0PDA+HeKIQXuT7RDuivD xppw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IMkIIvmQ; 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 35si2282421pgq.480.2021.10.04.14.21.30; Mon, 04 Oct 2021 14:21:42 -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=IMkIIvmQ; 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 S237866AbhJDNax (ORCPT + 99 others); Mon, 4 Oct 2021 09:30:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:43760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237584AbhJDN2i (ORCPT ); Mon, 4 Oct 2021 09:28:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1A3CD630ED; Mon, 4 Oct 2021 13:12:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353179; bh=nnvI+DyE+yoXgRypbYvm5aHACcR7idqHxDvQBfatckY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IMkIIvmQWWbwkIHaFAz9NVbBfT51IYZCenZR1mYHRgWC/b4iOUo2ktRgwDw3J4BCZ C6HU97fuZB9TGDrvyaHjN0aGrTEmngeGQfvBqhYtKCGhj85QUWi7aDvzrABJDWEO7/ 4h9ESMwu7EOg9Gf/D1pG/KWEPHsDXjlMw8AVVvpk= 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 006/172] ASoC: fsl_micfil: register platform component before registering cpu dai Date: Mon, 4 Oct 2021 14:50:56 +0200 Message-Id: <20211004125045.157883255@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 0adf292069dcca8bab76a603251fcaabf77468ca ] 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: 47a70e6fc9a8 ("ASoC: Add MICFIL SoC Digital Audio Interface driver.") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1630665006-31437-4-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/fsl/fsl_micfil.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c index 8c0c75ce9490..9f90989ac59a 100644 --- a/sound/soc/fsl/fsl_micfil.c +++ b/sound/soc/fsl/fsl_micfil.c @@ -737,18 +737,23 @@ static int fsl_micfil_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); regcache_cache_only(micfil->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(&pdev->dev, NULL, 0); + if (ret) { + dev_err(&pdev->dev, "failed to pcm register\n"); + return ret; + } + ret = devm_snd_soc_register_component(&pdev->dev, &fsl_micfil_component, &fsl_micfil_dai, 1); if (ret) { dev_err(&pdev->dev, "failed to register component %s\n", fsl_micfil_component.name); - return ret; } - ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0); - if (ret) - dev_err(&pdev->dev, "failed to pcm register\n"); - return ret; } -- 2.33.0