Re: [PATCH v3 1/2] driver core: Rework logic in __driver_deferred_probe_check_state to allow EPROBE_DEFER to be returned for longer

From: John Stultz
Date: Tue Feb 18 2020 - 19:19:19 EST


On Tue, Feb 18, 2020 at 4:06 PM Andy Shevchenko
<andy.shevchenko@xxxxxxxxx> wrote:
> On Wednesday, February 19, 2020, John Stultz <john.stultz@xxxxxxxxxx> wrote:
>> diff --git a/drivers/base/dd.c b/drivers/base/dd.c
>> index b25bcab2a26b..9d916a7b56a6 100644
>> --- a/drivers/base/dd.c
>> +++ b/drivers/base/dd.c
>> @@ -237,13 +237,12 @@ __setup("deferred_probe_timeout=", deferred_probe_timeout_setup);
>>
>> static int __driver_deferred_probe_check_state(struct device *dev)
>> {
>> - if (!initcalls_done)
>> - return -EPROBE_DEFER;
>
>
> Why to touch this? Can't you simple add a new condition here 'if (deferred_probe_timeout > 0)'... ?

I think that might work. I'll give it a spin later tonight and double check it.

The main thing I wanted to do is fix the logic hole in the current
code where after initcalls_done=true but before deferred_probe_timeout
has expired we just fall through and return 0, which results in an
ENODEV being returned from the calling function.

thanks
-john