Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp353722ybb; Wed, 8 Apr 2020 00:48:53 -0700 (PDT) X-Google-Smtp-Source: APiQypJXPGyPeS1BZpS/hOGbRBmWdVdcF8L9XA44bJPRbr+MTXIV14l4d2/wckFhI8MzdDQZGDe9 X-Received: by 2002:aca:d50f:: with SMTP id m15mr1588261oig.19.1586332133073; Wed, 08 Apr 2020 00:48:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586332133; cv=none; d=google.com; s=arc-20160816; b=M62JZuEWquX5dXrGgSIoyzh67NdRbcpYfY2IqceYd3ncSb9YdDjQRPkGj+G0m/vMot O7s83b4FfXGj6OaxKIpay7KTRX9MKuHDIN1Uh/lThTj3Sgr+g3WsQMBvD6qRnmzLSvCg h1lx6bGH/VIxdUzz0WNtQhyTIWbxNpDjxx4fSITXy4HhbwPLXCpcNhh2+uAtJusfjGmq fAYElPWDY/jwCegzihCdAhVh3YvuIlJTricYHHnbFxLuAYKlB6N20XQJcrwD3ly5r7IN ZEiSAhXqUbnyHr9ImJPWi2NyID83CARTwFDE3H3j4YmrzgciuycGsgG16KuEZqwiwwdJ Qtcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=RR92PJz/vfU5+w5Mw1m+JK7ovH9yXMWn2/XVn86hUF4=; b=0ndKJF9HMVL8CKvRPyyoMexfHlR4H0uayj9pRCcxFACBrj0Nrors8K/EymvEtwgzU/ hb4eiohOViW38fhWW5kQe1cEf/3quTpHBr3VeqPlepEFyktw9okvcdAr0i9DpuN7pxsO wb70+SuAJ7rC1hxWRFpFcbR06RM0QqgK1eyMSCzExNyhPslbmbMCDcLEB52vANBJPt5o H5NXzJZLzsPUbvA8oYIOVBrKapNfdHNALCBaqdMW0ZiuBGtqRjQwA23iA1YiWG9jKJiv l+doHcGfZu2+qVtSvoBWnZlI86OD6lAMizcX10ItRU2fICfb09kQV0r1MEx1oNahTrkH k7Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="o9b/IpfO"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u28si2631712otg.14.2020.04.08.00.48.38; Wed, 08 Apr 2020 00:48:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="o9b/IpfO"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726855AbgDHH04 (ORCPT + 99 others); Wed, 8 Apr 2020 03:26:56 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:34161 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726605AbgDHH04 (ORCPT ); Wed, 8 Apr 2020 03:26:56 -0400 Received: by mail-pf1-f193.google.com with SMTP id v23so2669640pfm.1 for ; Wed, 08 Apr 2020 00:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=RR92PJz/vfU5+w5Mw1m+JK7ovH9yXMWn2/XVn86hUF4=; b=o9b/IpfOWX3nEWUPGPu6RG3SPuwiAKT/BMhB1+9/Kqv0fSB7vvdjWW1G+KaVsOfOgM r63wgBLsagQyRFpa3sML0m01aNH73sDIWQr5AZk2BUBOnjfhPmwj15A4J9269Y4eQL3A Aiy5PKV4bPb7xjbvqrNthovakqZ4XwH4m8acy7b+ipuIaF+yCnQ823+p4WB5HuSQTczU hS9RoyvPcKYjCNRfA4LDhhuNw0jrxtbeA9tcxUYpeFKJ6nQ645+j5wa2jjWRL3LhsdxQ sFmH767KJfS6IpcxfZ1FUM8vvbmAYo605CSd+aaSpnObNA4IR4EsC+FdYbwxWONGAjKA 9/Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RR92PJz/vfU5+w5Mw1m+JK7ovH9yXMWn2/XVn86hUF4=; b=QEnO2mkgx1Z9hGJihHZNqBmEJQ5thVc2ork1GCDvof+4h6dmekHpsQslFFFf7/JDNq 7ffWM8iHhiNEl2lsO/ixYgCsqAUxzD/kOGMsMI92m6EBHALTLcX+A8nVp8KIEhea2uZ1 H4KoaM+aTL5DNODxgkL6uno25zYKEoHsittVKeUgPtZ+20GzdjE6A1n4ro6dUcC5kmSv bXBsa3s1fnXq78yKiEJTsObRPD+E6bIiOUxaJ8qabkgPbZY1pOp6LpM61KaPo2kTgrd5 GeZw/MG6pQC8rDqn/mymQOpKz/DN0TA9K0TiW9EuCqjXenqIEcKkgJqaj3Pj+7unznJv mDBQ== X-Gm-Message-State: AGi0PuaZ1H5hhF2EGmTqpOuxvSI0hZV6i+gPMjbOLsa531zg8Z6X9gA7 1dXw2QfZNmt95zYaWyyZws91r1ugz0Q= X-Received: by 2002:aa7:880c:: with SMTP id c12mr5940143pfo.77.1586330814919; Wed, 08 Apr 2020 00:26:54 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id e187sm15356066pfe.143.2020.04.08.00.26.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2020 00:26:54 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , Jakub Kicinski , Greg Kroah-Hartman , "Rafael J . Wysocki" , Rob Herring , Geert Uytterhoeven , Yoshihiro Shimoda , netdev , linux-pm@vger.kernel.org Subject: [RFC][PATCH v2 1/2] driver core: Revert default driver_deferred_probe_timeout value to 0 Date: Wed, 8 Apr 2020 07:26:49 +0000 Message-Id: <20200408072650.1731-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In commit c8c43cee29f6 ("driver core: Fix driver_deferred_probe_check_state() logic"), we both cleaned up the logic and also set the default driver_deferred_probe_timeout value to 30 seconds to allow for drivers that are missing dependencies to have some time so that the dependency may be loaded from userland after initcalls_done is set. However, Yoshihiro Shimoda reported that on his device that expects to have unmet dependencies (due to "optional links" in its devicetree), was failing to mount the NFS root. In digging further, it seemed the problem was that while the device properly probes after waiting 30 seconds for any missing modules to load, the ip_auto_config() had already failed, resulting in NFS to fail. This was due to ip_auto_config() calling wait_for_device_probe() which doesn't wait for the driver_deferred_probe_timeout to fire. Fixing that issue is possible, but could also introduce 30 second delays in bootups for users who don't have any missing dependencies, which is not ideal. So I think the best solution to avoid any regressions is to revert back to a default timeout value of zero, and allow systems that need to utilize the timeout in order for userland to load any modules that supply misisng dependencies in the dts to specify the timeout length via the exiting documented boot argument. Thanks to Geert for chasing down that ip_auto_config was why NFS was failing in this case! Cc: "David S. Miller" Cc: Alexey Kuznetsov Cc: Hideaki YOSHIFUJI Cc: Jakub Kicinski Cc: Greg Kroah-Hartman Cc: Rafael J. Wysocki Cc: Rob Herring Cc: Geert Uytterhoeven Cc: Yoshihiro Shimoda Cc: netdev Cc: linux-pm@vger.kernel.org Reported-by: Yoshihiro Shimoda Fixes: c8c43cee29f6 ("driver core: Fix driver_deferred_probe_check_state() logic") Signed-off-by: John Stultz --- drivers/base/dd.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 06ec0e851fa1..908ae4d7805e 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -224,16 +224,7 @@ static int deferred_devs_show(struct seq_file *s, void *data) } DEFINE_SHOW_ATTRIBUTE(deferred_devs); -#ifdef CONFIG_MODULES -/* - * In the case of modules, set the default probe timeout to - * 30 seconds to give userland some time to load needed modules - */ -int driver_deferred_probe_timeout = 30; -#else -/* In the case of !modules, no probe timeout needed */ -int driver_deferred_probe_timeout = -1; -#endif +int driver_deferred_probe_timeout; EXPORT_SYMBOL_GPL(driver_deferred_probe_timeout); static int __init deferred_probe_timeout_setup(char *str) @@ -266,7 +257,7 @@ int driver_deferred_probe_check_state(struct device *dev) return -ENODEV; } - if (!driver_deferred_probe_timeout) { + if (!driver_deferred_probe_timeout && initcalls_done) { dev_WARN(dev, "deferred probe timeout, ignoring dependency"); return -ETIMEDOUT; } -- 2.17.1