From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 12B95EB64D9 for ; Thu, 6 Jul 2023 06:18:27 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id ACDB8741; Thu, 6 Jul 2023 08:17:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz ACDB8741 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1688624304; bh=VF7EajoQhYvqmxOEcoOLJjSq1A7k7YQBhV8Tz0D7gM4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=sE5DWiTfk8zX39q9/SycxCMrkQOvNfnJD+V4GvKZouldYzcKZTa93YyzMuAgb3sGB pCApDbDmGa62hPAvM1//TPIGmSuFx4ISBv6u11X+G5NurkQDV+Z9GiVxh+b3gsxP62 82DMNXuu9zikUNWf6ulrnCOVRB2uA7rJT8sQmB3g= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 34DD0F80093; Thu, 6 Jul 2023 08:17:13 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id E13FAF8025F; Thu, 6 Jul 2023 08:17:12 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 019F6F80125; Thu, 6 Jul 2023 08:14:25 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 07C02F80100 for ; Thu, 6 Jul 2023 08:14:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 07C02F80100 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=J11t8+3r 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 6E2C4615E6; Thu, 6 Jul 2023 06:14:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C86ACC433C7; Thu, 6 Jul 2023 06:14:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688624055; bh=VF7EajoQhYvqmxOEcoOLJjSq1A7k7YQBhV8Tz0D7gM4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=J11t8+3rmnuCwBxgU75U8OwLGHb2mVbqY8RGPxIakNjiNFMdqRvt8Yo8L0uNSdINb nufZLNutYsTEjmkApL9bJ4sPV9DKWe75wcTA3HDfbPtqC6HuPqmm5ET36q59G9xqRH poOp5Mp+YioNqGz3IwjwOgO3F0UhJRKWfoMUqirS4yUKSm+T/Qvh76I+oxPD1XE2He Xu4bXAtF6AxiZZNyui8MTxeRE17Bi5TO3RBI4ei1RkC991aB7wEf42CeEQhZtmyClH YFnUKsCCi9NyBSiKH3Tuct0voE/1KDBbBwVzVUk7g6eXpisthmgMR2/JFMeMzeyf4Y TPo0rR6Yci6FA== Received: from johan by xi.lan with local (Exim 4.96) (envelope-from ) id 1qHIGD-00045E-1x; Thu, 06 Jul 2023 08:14:38 +0200 Date: Thu, 6 Jul 2023 08:14:37 +0200 From: Johan Hovold To: Amadeusz =?utf-8?B?U8WCYXdpxYRza2k=?= Cc: Johan Hovold , Mark Brown , Vinod Koul , Bard Liao , Pierre-Louis Bossart , Sanyog Kale , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Alex Elder Subject: Re: [PATCH 7/8] ASoC: topology: suppress probe deferral errors Message-ID: References: <20230705123018.30903-1-johan+linaro@kernel.org> <20230705123018.30903-8-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Message-ID-Hash: H67M3EN3STNPDPTB3JL5KGAXLCXYQBY5 X-Message-ID-Hash: H67M3EN3STNPDPTB3JL5KGAXLCXYQBY5 X-MailFrom: johan@kernel.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, Jul 05, 2023 at 05:07:22PM +0200, Amadeusz Sławiński wrote: > On 7/5/2023 2:30 PM, Johan Hovold wrote: > > Suppress probe deferral error messages when loading topologies and > > creating frontend links to avoid spamming the logs when a component has > > not yet been registered: > > > > snd-sc8280xp sound: ASoC: adding FE link failed > > snd-sc8280xp sound: ASoC: topology: could not load header: -517 > > > > Note that dev_err_probe() is not used as the topology component can be > > probed and removed while the underlying platform device remains bound to > > its driver. > > I'm not sure that I understand that argument... what's wrong with > dev_err_probe(tplg->dev, err, "ASoC: adding FE link failed\n"); > instead of > dev_err(tplg->dev, "ASoC: adding FE link failed\n"); > ? In short, it is not correct to use dev_err_probe() here as this is not a probe function. dev_err_probe() is tied to driver core and will specifically allocate and associate an error message with the struct device on probe deferrals, which is later freed when the struct device is bound to a driver (or released). For ASoC drivers, the struct device is typically bound to a driver long before the components they register are "probed". I use quotation marks as this is not probing in the driver model sense of the word and the underlying struct device is already bound to a driver when the component is "probed". > Personally I would prefer dev_err_probe() to be used as it also provides > debug message. Yeah, but it would be conceptually wrong to do so (besides the fact that it would waste some memory). Johan