Re: [PATCH v2 3/4] driver core: Add fw_devlink.timeout param to stop waiting for devlinks

From: Javier Martinez Canillas
Date: Thu Nov 17 2022 - 13:56:12 EST


Hello Andrew,

On 11/17/22 16:19, Andrew Halaney wrote:
> On Wed, Nov 16, 2022 at 01:01:59PM +0100, Javier Martinez Canillas wrote:
>> Currently, the probe deferral timeout does two things:
>>
>> 1) Call to fw_devlink_drivers_done() to relax the device dependencies and
>> allow drivers to be probed if these dependencies are optional.
>>
>> 2) Disable the probe deferral mechanism so that drivers will fail to probe
>> if the required dependencies are not present, instead of adding them to
>> the deferred probe pending list.
>>
>> But there is no need to couple these two, for example the probe deferral
>> can be used even when the device links are disable (i.e: fw_devlink=off).
>>
>> So let's add a separate fw_devlink.timeout command line parameter to allow
>> relaxing the device links and prevent drivers to wait for these to probe.
>>
>> Signed-off-by: Javier Martinez Canillas <javierm@xxxxxxxxxx>
>> ---
>>
>> (no changes since v1)
>>
>> .../admin-guide/kernel-parameters.txt | 7 ++++
>> drivers/base/dd.c | 38 ++++++++++++++++++-
>> 2 files changed, 44 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
>> index a465d5242774..38138a44d5ed 100644
>> --- a/Documentation/admin-guide/kernel-parameters.txt
>> +++ b/Documentation/admin-guide/kernel-parameters.txt
>> @@ -1581,6 +1581,13 @@
>> dependencies. This only applies for fw_devlink=on|rpm.
>> Format: <bool>
>>
>> + fw_devlink.timeout=
>
> Just thought about this, but I think this should be called
> fw_devlink_timeout. Generally the $MODULE.$PARAM syntax is reserved for
> things that can be specificed with module_param().
>
> The advantage is if you accidentally type say fw_devlink_timeut=10 the
> kernel logs will indicate it has no clue what that means. Including the
> "." makes the kernel assume that maybe a future module name fw_devlink
> will be loaded, and at that time will see if that module has the
> parameter mentioned. A little thing but I think work changing in v3.
>

I was actually on the fence on this one but the reason why I did the .timeout
was that the other fw_devlink param [0] is defined as fw_devlink.strict=<bool>
so I wanted to keep this one consistent with that.

https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html

--
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat