Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1101296ybz; Wed, 22 Apr 2020 13:34:31 -0700 (PDT) X-Google-Smtp-Source: APiQypLRt9TE3ISAkKus8hv/QMVK8JLOq0eViM2g8KrO8ptff9WWguJwSGlfXchxOT6wih92NBHh X-Received: by 2002:a17:906:a390:: with SMTP id k16mr123648ejz.219.1587587671145; Wed, 22 Apr 2020 13:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587587671; cv=none; d=google.com; s=arc-20160816; b=T2ISlZL73ZXezFogDD6thT6EddKjPy0uXy3Vqxo0x6V1rJth5i4l2M5Xh8ZhbFBZs/ I8HA+8jrmu2IBm+N4OIwSLlkXU8X0KDJNw7jnMsUOzwAjI5SiFzfOo48nO5tD8x7Z0Wu X+dB/SAZUpALGcZ3Me+6UMQPRjc55HVQFMHe+cXsX65Z++9lx7koLT+icgi9BAMxKLPR 39iB5PzMVesrnd9OmDuMcO+5eR5Ye0mx7+m8RaadLtvH16eNty4ZDLMOWsslFC4DV0a0 v8IaKDafUWEsXRefdjTLdcYIY5iq0Q8fsakcRl6jAsArapGEFgH9wFp3LObId/M4IR/b kEwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=tKbiuFbiZC2D1ImIHBQi0x36vK7Jcd27HL1H3KbbNwE=; b=C9svIssg+eXIRVQ+xnQ0ZlGQWraBqKURPMB1BwtA/RP1/oaGHuT4cVWvLZbFPJq9P4 a76OMOAeDCbEC6HP59d2IsG40C7sfgyQIEDVawUim7q8p3AJdCRD7b80XUkMJrefvYdE LHUEECO4mayIXxLSdY0GZein/ayod3yHJqg8wn4dcO+R3G/c+xKgsQJd20V3MgVuvK3J uZZEJ/5U1ikbamfS1Jm+zRvROf2t6XSOykJrcL581vXL4mtH8bdol4srDHS69LPmTshK TF/NwnWuQsscBB4ClVV82VYHQ/kbTmQxymKWFM4D7JTOumFUEt0GKzBSJPJ/jlDy9Pa0 GzSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jtXnZxTj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id n9si126910edb.87.2020.04.22.13.34.07; Wed, 22 Apr 2020 13:34:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jtXnZxTj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726503AbgDVUdI (ORCPT + 99 others); Wed, 22 Apr 2020 16:33:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726319AbgDVUdD (ORCPT ); Wed, 22 Apr 2020 16:33:03 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8630C03C1AB for ; Wed, 22 Apr 2020 13:33:03 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id w3so1402211plz.5 for ; Wed, 22 Apr 2020 13:33:03 -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:in-reply-to:references; bh=tKbiuFbiZC2D1ImIHBQi0x36vK7Jcd27HL1H3KbbNwE=; b=jtXnZxTje+esnJi9OvNJ9lL0EfuD8nLu8pEU2HsoVZcg/CcP2zGyKA3ip87zMACuqC 8IlyHWtGZ3RDEGhMv1ojVcGzgcQ2UzGav1z8V9DVG46RPsrPFRbAQJKI1wqNKsZ/VnLa g3d28TJUfTOc2mB+OAcyAD67MLfZPLhPHuZLuE4I0tNKuDK5j5se4VPIjC56kkPNukxW nKMInSzxn/+VkR9MDaoQqWec8Mas1GxhOcVr5cZg3aNUZJBGcm5thaecm/GrELurVIjW 8OlM2Vqbe0pj6/rPfZGfZSokntDvKsAiIJnmF8cDaXKsHjGu82Twh55kz59Q60VlC2ct 0XDA== 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:in-reply-to :references; bh=tKbiuFbiZC2D1ImIHBQi0x36vK7Jcd27HL1H3KbbNwE=; b=YewvlkyPKPPfHgTo1RYtUU3+dn9HN+pJXL6gcmg6UB+Iz4KPEZIQ3cEm+pM1NTaq9W 26LG7qiM9KIkrS6PRl2C3Ahib2sVEn+UDfWmkaIFB2xFKj4JdHK6z6oJmpCHeNXyoQJm zbJlid944TAqMHEnUhutQWWiMvLE9GhdUYtRib9UT9A3BOsZZEm3pYGKhj1LoGVdu5aC JkYVwUF9fzpPDWb/YwrsGu0yxF4mCvwWNX4YedqlEejUjMmoQnUulVBXnMugxnCG9aV6 DSigEsWfGQ4plSgBth3AVmxobAVUJE0AxxBiZb9Pp0c1mlJf3LF3Cd6Wx1uA4FgPyq4d FMAA== X-Gm-Message-State: AGi0PubFYagk4zOl7e9BM1BMjXf2Ghmigg0nQAuu3NON31x87RPb0VUO jfqgIKQQil2LadY80Vn+X7mmIDZ8YgM= X-Received: by 2002:a17:902:9347:: with SMTP id g7mr432520plp.77.1587587583090; Wed, 22 Apr 2020 13:33:03 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id b24sm360292pfd.175.2020.04.22.13.33.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2020 13:33:02 -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 , Robin Murphy , Andy Shevchenko , Sudeep Holla , Andy Shevchenko , Naresh Kamboju , Basil Eljuse , Ferry Toth , Arnd Bergmann , Anders Roxell , netdev , linux-pm@vger.kernel.org Subject: [PATCH v3 1/3] driver core: Revert default driver_deferred_probe_timeout value to 0 Date: Wed, 22 Apr 2020 20:32:43 +0000 Message-Id: <20200422203245.83244-2-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200422203245.83244-1-john.stultz@linaro.org> References: <20200422203245.83244-1-john.stultz@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch addresses a regression in 5.7-rc1+ 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: Robin Murphy Cc: Andy Shevchenko Cc: Sudeep Holla Cc: Andy Shevchenko Cc: Naresh Kamboju Cc: Basil Eljuse Cc: Ferry Toth Cc: Arnd Bergmann Cc: Anders Roxell Cc: netdev Cc: linux-pm@vger.kernel.org Reported-by: Yoshihiro Shimoda Tested-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