From patchwork Thu Feb 20 05:04:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 183652 Delivered-To: patches@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp140932ile; Wed, 19 Feb 2020 21:05:02 -0800 (PST) X-Received: by 2002:a63:4281:: with SMTP id p123mr30838972pga.371.1582175101991; Wed, 19 Feb 2020 21:05:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582175101; cv=none; d=google.com; s=arc-20160816; b=dK6ltudj8Wb47x1Bi4vrppR7aFFbiKsfrHZ5/QWF7ljY/ofHVTkx3QYsFPlWo86sYf 8hGeDW+tp+5HyQtuYmtzG/J+biVEeSqjfHVUm9NpezRlMRyB0YUaBxobguMfsAbAOK8V pZcRiSefKZzyGmATX44yLNCFzmFiKUT8DhAk+VyBtuWjGatTXLSAcW+ewMlBZmfldZ40 VTqXkAKxP/7JqumWKLhm1LpcrOAHQX7IcDiT8PKi4a2DH9AuH26t3VfXnTUIRIDGQiyC fmTXh4e92/RR3OwmBYcGUvJg/QSFOZ8w1pRKzeQ/BFzgbQU335bbBUcfGVgvMAs1nFQg C12w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dyNzXT8jLD/h3SHy8a6cXUYQMkAeXAKSKv5N+Mj3VNM=; b=da1kvPDcwFfcoz0m2dOD01/1MUOHoaE+YfMOLL8EgfOzWR850GxvawvCAzmuIs3zCn rieRF8ympV7DH+KAXRY8JJrr78Ysu4DDux+UVXnPtocNBOQ88pIV/QRHwUP/MQgBTR6W 75HuIhrdHgWQ/8HIpiarCqf72551DO0LwZZU4+ROWmdZ9pzdhJ4bqwewCcNrTgdzJqt2 bU2aZ4D9szUerd/2NZoa3pd6y7EttNVTZu1Fqo2sN+28SjxGpT7f9nLouX04Z/5j6Jnr dlvyGN+dQqMmVVM2+BwqaxhnObjn7Y19zP9bXLsaNJIS8B4gaMODhFSO34ybokj8XjZg YAsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qDZfr9MC; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id m15sor2040330pgh.36.2020.02.19.21.05.01 for (Google Transport Security); Wed, 19 Feb 2020 21:05:01 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qDZfr9MC; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=dyNzXT8jLD/h3SHy8a6cXUYQMkAeXAKSKv5N+Mj3VNM=; b=qDZfr9MCt0H7vO2O2iGnZXpDtP5E3Qw9y7loJoWPu3Sj//W9D1V3bwpfmBtms4Xo0c y6yfy3huIAtnE5UxWFpK65fS4DIrSHQFpLXMYKAj6NImy/HuUzvlH38b2SN336GjLW2P +grV3nLOxp0DzcR0vqK1R92Ly+imwIohlL8Xpci5eFMJR0vPC9Q4YNZtns4C3XB1J/rT iLYeXLknGxrnrOsXDUQuWLZ6vXxoXWbxjjXuLwZgC+dT9w/QcUb+OAsmwh1RW+9SLOgc 82NKg5tXDHCXkDfMmQbjifdqPgWa6yDzv1kwkFqvuVL6iPJ7/9X4UGYmWTylJYSBgUJG DTGg== 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=dyNzXT8jLD/h3SHy8a6cXUYQMkAeXAKSKv5N+Mj3VNM=; b=f2QFLGq+KGgh+/IGp7AusaTKMm6jh0cdeNaBNlY4vNObKD5Fm83/ytslAj0omiGxKR uyh1KzmGj3qQM9IQFrPWmwB3wv8fWpEUZ/ggymC24CblTQZOv4ttz3ikRw8iLuOWsAzQ bqWLj2a1sZZTaJFsD79+YgofOFEvPAwAgXt9zwkhv+g7Fy6VFmrKmunqDyfpLU7XzzlG AWh/47XMJ+BBoqWuBlOnjxjFORd8eVkpoYt/PCl4RvYtx8jQ9TrmRV/5IoO1pMzOzxXV s+2ertv8b5a9xb2jogEvKObitY133NU3xyKfxHxOpYBwirNDEzoryspGPbaqxg1pyOPF Ry8Q== X-Gm-Message-State: APjAAAUduBrz8O02fXC9UK+YScTu4GtCSE5T23uU1gY9OfObA5/NIGpf 2n82PQOSKJS9Y8MBCnuIB6A01Wpb X-Google-Smtp-Source: APXvYqwKxpJ3up3gMovM7cilewhjBB7h6jVLv5FEJQ5jkpiNN8ZLL6nciC7CXK+kdMoSse7byXh8eg== X-Received: by 2002:a63:ec07:: with SMTP id j7mr30998730pgh.187.1582175101605; Wed, 19 Feb 2020 21:05:01 -0800 (PST) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id z4sm1400847pfn.42.2020.02.19.21.04.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 21:05:01 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , Rob Herring , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Pavel Machek , Len Brown , Todd Kjos , Bjorn Andersson , Liam Girdwood , Mark Brown , Thierry Reding , Linus Walleij , Greg Kroah-Hartman , linux-pm@vger.kernel.org Subject: [PATCH v4 2/6] driver core: Set deferred_probe_timeout to a longer default if CONFIG_MODULES is set Date: Thu, 20 Feb 2020 05:04:36 +0000 Message-Id: <20200220050440.45878-3-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200220050440.45878-1-john.stultz@linaro.org> References: <20200220050440.45878-1-john.stultz@linaro.org> When using modules, its common for the modules not to be loaded until quite late by userland. With the current code, driver_deferred_probe_check_state() will stop returning EPROBE_DEFER after late_initcall, which can cause module dependency resolution to fail after that. So allow a longer window of 30 seconds (picked somewhat arbitrarily, but influenced by the similar regulator core timeout value) in the case where modules are enabled. Cc: Rob Herring Cc: "Rafael J. Wysocki" Cc: Kevin Hilman Cc: Ulf Hansson Cc: Pavel Machek Cc: Len Brown Cc: Todd Kjos Cc: Bjorn Andersson Cc: Liam Girdwood Cc: Mark Brown Cc: Thierry Reding Cc: Linus Walleij Cc: Greg Kroah-Hartman Cc: linux-pm@vger.kernel.org Signed-off-by: John Stultz Change-Id: I9c5a02a54915ff53f9f14d49c601f41d7105e05e --- v4: * Split out into its own patch as suggested by Mark * Made change conditional on CONFIG_MODULES --- drivers/base/dd.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.17.1 diff --git a/drivers/base/dd.c b/drivers/base/dd.c index bb383dca39c1..fa138f24e2d3 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -224,7 +224,16 @@ 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 + */ +static int deferred_probe_timeout = 30; +#else +/* In the case of !modules, no probe timeout needed */ static int deferred_probe_timeout = -1; +#endif static int __init deferred_probe_timeout_setup(char *str) { int timeout;