Re: [PATCH 7/8] ASoC: topology: suppress probe deferral errors

Amadeusz Sławiński
2023-07-06T07:25:49Z

On 7/6/2023 8:14 AM, Johan Hovold wrote:
> 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).
>

I guess you mean call to: device_set_deferred_probe_reason(dev, &vaf);
perhaps functionality could be extended to allow to skip this call and
just do prints? Or just add separate dev_err_defer function without this
step, although it would be best if they could share parts of code.