lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 6 Jul 2023 08:14:37 +0200
From:   Johan Hovold <johan@...nel.org>
To:     Amadeusz Sławiński 
        <amadeuszx.slawinski@...ux.intel.com>
Cc:     Johan Hovold <johan+linaro@...nel.org>,
        Mark Brown <broonie@...nel.org>, Vinod Koul <vkoul@...nel.org>,
        Bard Liao <yung-chuan.liao@...ux.intel.com>,
        Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
        Sanyog Kale <sanyog.r.kale@...el.com>,
        Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        Banajit Goswami <bgoswami@...cinc.com>,
        Liam Girdwood <lgirdwood@...il.com>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>, alsa-devel@...a-project.org,
        linux-kernel@...r.kernel.org, Alex Elder <elder@...aro.org>
Subject: Re: [PATCH 7/8] ASoC: topology: suppress probe deferral errors

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ