From patchwork Tue Feb 25 05:08:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 183810 Delivered-To: patches@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp1262840ile; Mon, 24 Feb 2020 21:08:41 -0800 (PST) X-Received: by 2002:a17:902:aa88:: with SMTP id d8mr954840plr.201.1582607321584; Mon, 24 Feb 2020 21:08:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582607321; cv=none; d=google.com; s=arc-20160816; b=iiow/EWvmatJ7OYDbGaVaZdy+aOOCtJlqgRZ2su4Vuu609t2/HDooSvj/mCaElpZwW EoKvsVoeScFcASvbiRZ/V7oLUKyBM9YXUe3ikmM4YOOHoZMgF1USxnj6zgFrgt0MARnw CjMZrNBmx9o7RvpZyqbQ+LnkHa3C1m9FrfAV0k6SSvb4DBUxUwUNLPCzHvIXIe4Ijx2j 4gUmTBEqtFI1TYqSIBCEf9NTK29EPT2ZQVb0JySohAq0Grw6HuGm5fJf18KzVuz6Kij/ TjwMh2igMUJQ/LIr5vxQzOSqSG2KQ6XxmyvwDSOKL3ocbBBSAkBcYnL4C2t6RX8a2GQF 4Q0Q== 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=bdantuu/5XxtE9f3CRUqpZsUq5/+hM9onGf3l9IzGoE=; b=0fNRDAduejnw7HZ4kl+1Df1D1eBW7kDWroMrOlOhf2vZLW3W45VGACxiLwwUPpn9LM YjzPkuLTXbzRmwfsUscL0qkC80IoiRVAdWDzTbiwKU7n6u/FcFURod4huAKryAw2DyRF +vXT9Bzp4R6Pf59mdPZIZflEkGtLrRe6Q+GZvOSASYK+CSsS249O6wnZh+iRiwng3jxe o4N6XYsoF/gGj3tRuz/o/o4X97RgCoQuZ5sHM0j2H6R2S5oIpJ2zq3UkXNwsG5YSIC7u mxeQyRQzAVSqerKIMsN9KD4VE7mWZcr2AlrdGb1AshDJAQeJYtODzlHeXtzXdsNWrTnN /Alg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eseBaJpt; 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 l24sor4940730pgt.37.2020.02.24.21.08.41 for (Google Transport Security); Mon, 24 Feb 2020 21:08:41 -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=eseBaJpt; 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=bdantuu/5XxtE9f3CRUqpZsUq5/+hM9onGf3l9IzGoE=; b=eseBaJptDm8Ew+v8SqbkusD/nIsIJS5Q63dC5indg6vPCEKfEsMcIPCQ8LryIf6XAJ luL/+OrUx2Oy46HC+ptZ0HilMyfsc3zomlNmnYnHrzOLjZXAFyJ08p9/b5DGXYu8eaNo PUEltGUedjDLPkqZYyTqtRnfnUv2t/X/LDaRewmylTEofSd4xUVGA5OvCe0kLjUwXBn/ CRfUhK+/zob1g6uYsBJXymtFuGPFlDawi9R0laHsTU7R41pTUTtrKve6Bra6du4WP12c XCipO95SvbpgfSoF3P77ZiAEQSxcEhkwIXQFr7HKn24Gcs06BdepRKmhhhLGfZjwPG7U nieg== 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=bdantuu/5XxtE9f3CRUqpZsUq5/+hM9onGf3l9IzGoE=; b=bItBCEcEYWSaqJMr1s5/OfkJkkMjqEnnR+Ob5+pxo/tcL5/aJBZE2Eczn6ttsCrurc sk2/13pl6qtwx7w/8rlUOXoMAqjOHSRTjRQrg6Bxdesk9fmvMENtCugjzOyhgai3cnx2 mKy+RoXwIvtJAqVcFkSMlnM+0351PvENVVq/LaPv1LD3Pf3x7HxUTVd/HJZEvGIGizeg YGql6tNhxWqB+FKEpoLmmkiSR2qZgR3gPc1e/E8c+RshyfRqn2MQBbc3VBsHazKXXXK5 6RO2tq3o8VrJB3CN5ikDoqI1cuiZYf8CyDxpeWfRJRej/3SpyW5JfDRUkqMQ46GFypVg WykQ== X-Gm-Message-State: APjAAAVFkaTQs0bkpVluj7qWME5cdUfEfqWGKxaMMbx3OLK1oXjqCehO s7wrh1czpYzgPFZETAqjfDLr2f6r X-Google-Smtp-Source: APXvYqx5Kz8YB9icmd79yhCto0VvLnWu8Muf2e9T+i5OFmjE22x563qcKYydlVaxtypL+7AeLyRalw== X-Received: by 2002:a63:e5d:: with SMTP id 29mr9354407pgo.124.1582607321206; Mon, 24 Feb 2020 21:08:41 -0800 (PST) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id r66sm15156450pfc.74.2020.02.24.21.08.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 21:08:40 -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 , Saravana Kannan , Bjorn Andersson , Liam Girdwood , Mark Brown , Thierry Reding , Linus Walleij , Greg Kroah-Hartman , linux-pm@vger.kernel.org Subject: [PATCH v5 2/6] driver core: Set deferred_probe_timeout to a longer default if CONFIG_MODULES is set Date: Tue, 25 Feb 2020 05:08:24 +0000 Message-Id: <20200225050828.56458-3-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200225050828.56458-1-john.stultz@linaro.org> References: <20200225050828.56458-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: Saravana Kannan 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 Reviewed-by: Rafael J. Wysocki Reviewed-by: Bjorn Andersson Signed-off-by: John Stultz --- 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 d75b34de6964..fe26f2574a6d 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;