Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30057085rwd; Wed, 5 Jul 2023 23:40:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlHi2wTJi0q7Zjmur+32yFDjXp+SMf/z7mX0uDv26mU6TSDvGwZCYppczUIStK9M+Hft1UqG X-Received: by 2002:a17:90a:201:b0:262:cef9:84f6 with SMTP id c1-20020a17090a020100b00262cef984f6mr849216pjc.22.1688625659510; Wed, 05 Jul 2023 23:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688625659; cv=none; d=google.com; s=arc-20160816; b=Vl4CRccehHUhyXx6UZOGIGS2CWQ9tv0G93OAteYaEPWWCUyDpAD7NEo3ZQ+kgpfKcE fnlURamUrbPsZn2TAk7L2kAl3Dch2rT6ECNeKpFWXhriVf8REpOjOcaemNuhSKBsfrmJ U1Fe2HuZC8+OK+/WfveGCmqu8O6qTEVWujoxW5+Ho2OpAD7VIBQl/kC70VqsHWNwVs24 YVsSdlZvXVN2yjiad6sM2uPomGfQJOlamZj5gwOGx7pnqNVpAFspC2U+AB0ptwE6ZI7R a+hCMJ0cgZ4ZMXPiMBXbqAtuzgCRDJAjhFR6iBTkYU7nU4gUSlkuq1F2Xl5DFnsdlETF +V7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=L4NAiEg2aKHg6LzMkpvOG39ofR9QEZu7k/ZA87n+1Sw=; fh=X5XHED99pkQYnu27/+KIXTjc+b5so5wGJEL2LxBpiZ0=; b=jfUrEklPkrUzHOMjZkVNTjcdd9G1yyoIrFsIWmiwHEJCTJz3y4waocnFVDY00kA0uM VZsU0QJBMnjfn68ajoL3pdPbhTrn3yLcY9GO1IY23s/+C3YJAiVJgqguEOIjEt2SsEY6 l4YJjbAlx08a2vKqDxvSue0dm7hd+pvWRlAFaHUkS5RES/nXyK/R37Jh/PUitK5tvG6w b3F3hrVRLzB4Xx+0lbTpGxZ0R1S1IcuoFevwggQsFJopoWavQNCqirETr/HxusFMpUy8 oiejRnmlehjz9pNG2jMAR7RikNR08NZwermK/03p7EVvd4e9BX+bXziwauwYUl+iQane dLbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J11t8+3r; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x7-20020a17090a6b4700b0025be132d177si3176834pjl.60.2023.07.05.23.40.47; Wed, 05 Jul 2023 23:40:59 -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=J11t8+3r; 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 S233200AbjGFGOS (ORCPT + 99 others); Thu, 6 Jul 2023 02:14:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233071AbjGFGOR (ORCPT ); Thu, 6 Jul 2023 02:14:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04F1710F2 for ; Wed, 5 Jul 2023 23:14:16 -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 787AE61882 for ; 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: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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: X-Mailing-List: linux-kernel@vger.kernel.org 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