@@ -5757,6 +5757,10 @@ static DECLARE_DELAYED_WORK(regulator_init_complete_work,
57575757
57585758static int __init regulator_init_complete (void )
57595759{
5760+ int delay = driver_deferred_probe_timeout ;
5761+
5762+ if (delay < 0 )
5763+ delay = 0 ;
57605764 /*
57615765 * Since DT doesn't provide an idiomatic mechanism for
57625766 * enabling full constraints and since it's much more natural
@@ -5767,18 +5771,17 @@ static int __init regulator_init_complete(void)
57675771 has_full_constraints = true;
57685772
57695773 /*
5770- * We punt completion for an arbitrary amount of time since
5771- * systems like distros will load many drivers from userspace
5772- * so consumers might not always be ready yet, this is
5773- * particularly an issue with laptops where this might bounce
5774- * the display off then on. Ideally we'd get a notification
5775- * from userspace when this happens but we don't so just wait
5776- * a bit and hope we waited long enough. It'd be better if
5777- * we'd only do this on systems that need it, and a kernel
5778- * command line option might be useful .
5774+ * If driver_deferred_probe_timeout is set, we punt
5775+ * completion for that many seconds since systems like
5776+ * distros will load many drivers from userspace so consumers
5777+ * might not always be ready yet, this is particularly an
5778+ * issue with laptops where this might bounce the display off
5779+ * then on. Ideally we'd get a notification from userspace
5780+ * when this happens but we don't so just wait a bit and hope
5781+ * we waited long enough. It'd be better if we'd only do
5782+ * this on systems that need it .
57795783 */
5780- schedule_delayed_work (& regulator_init_complete_work ,
5781- msecs_to_jiffies (30000 ));
5784+ schedule_delayed_work (& regulator_init_complete_work , delay * HZ );
57825785
57835786 return 0 ;
57845787}
0 commit comments