From patchwork Fri Feb 14 00:44:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 183451 Delivered-To: patches@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp1171871ile; Thu, 13 Feb 2020 16:44:23 -0800 (PST) X-Received: by 2002:a63:31d1:: with SMTP id x200mr645860pgx.206.1581641063406; Thu, 13 Feb 2020 16:44:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581641063; cv=none; d=google.com; s=arc-20160816; b=lfchvx0Ha89XQNZAbFvtgAr/LJDsWX4O4Ch35pqU5bfWtl1P61QgJ7f4BvIp+wCAzL pJxTtr882QqFu8UvB3/sJTM/vMyYoae2ISDLqsVvgv4RDJs+mvI4YPMiBjJhTSRMYRxG NuvhpshW9Dwrq99Nx/kOhF7GgTVWA82YtwLws7SDKRWIm86SoYoRpTXfQvpxKMDOKrQm lwT966+H/Gy9HWvhywh/CJ7QS301OZ8TcnjON4O5Xd0hoNQS5b2k0xV36CLZM7E7gZ/x EqVP3mEt0S2FBLo2r9rG/mqHP2pC1K+6per5QOVUQ7i9JMaMFcjDuxtrE7JnbcuVkpjF nsFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=3kKnrEZnWkNPVAd2iboNdWLqrlgxcpOSWe5JDchkAgM=; b=HfnQENSMtJUkeP5pnpBxug4JSWuENv3f7GFZymWj2fl6e3cvrVmLOunt1iHpPAK7xl iZJmyxjMSxFjBL3c0qoBwrUsav2FumX4b+bGDkm9/D9HsH9MqCpo7y+4drJ9bGq4V2g/ tlRFTVSJKgU1QZY8Ce7/A3nc9OUr/Ljw+flY4JgiePMg6dK6+sreZ/BPWgiLdIxWNgwV RNEXOTJaxvlyg4mXkfdOaH3ka9viWsL2AylR03EMANhP1qNDm9Rn3XZVqh/t9O9C31AC AHhCxz3By+DSOB38w/5kg3tNYAkNYtBmGuyBqpoR0awjrECQweDRPNpppj4LrwDY0JLH ZwJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jCt0BWX3; 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 r77sor4660373pgr.18.2020.02.13.16.44.21 for (Google Transport Security); Thu, 13 Feb 2020 16:44:23 -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=jCt0BWX3; 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; bh=3kKnrEZnWkNPVAd2iboNdWLqrlgxcpOSWe5JDchkAgM=; b=jCt0BWX3EOA8tmmzwv9m6xgX7LFDTeGfld9TPGumhKfCmQYLgEScq/1kDMuepH8odY adIltx1W8F3H3QNBIVPyTXLE3XS4gzq6tnIONKcdu6XSnlUBdq6JJdQIwoXdeb/hW4Xr 6YHBgzWsytRxxhcNm496CW6jToVTSKkfHHoN8Q5eUHYDY08hCxxqbeUD9TctvGdT613K OD8Ipc13FNQyHyH26iDSsAMmCN/ivzXLVToIMGZ+XQzAftiSCm6G48fkwKPvyBWtYqYA HPW6W+0BdjaTzQzzXPOZwPyhiA/qOJEDdogwuLeBUGGOfCR8RfjvW/FbqP8FErdrW4RF Ja6g== 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=3kKnrEZnWkNPVAd2iboNdWLqrlgxcpOSWe5JDchkAgM=; b=XfHr/JAIHBRWk7dQmrg6hTJMcztKfm8Z8RegCoZ+aQnT3INkaJ3nxUuBOU0rbftMJ/ NAmR+0ql6uAExtoQ/HbLYTvvjWSIIe7vjyj7OxOjFkfeZ64ZYZ67QzLVns2EjcOnwOxc 8YXyxzsj2mDDbHwp1S2VPx3mMgWZIYcFsdLxLsQXFWyQtbq2fmqR6mLlyLyEmPqcY4fY Qop2RAvJLG3IoWRcB3nVlHOBHor0xvDwkMIiTu8GKuvQEgcXjEu1IUbTk9hK6VPWxA8a aXdySpwtJ1Wlx75DS9ttJwETnVdODtGjZfLfpNu/1kH/bq2bkuAWYocL1qhU6Pr4xVIh AvGw== X-Gm-Message-State: APjAAAXvJlGai8sOSgF0LgKKArbBgqGd5zF6V+f+9mx+a9Hnsunpv6Y5 j6tax/19ijbMHVh5ZpUeO/zE93du X-Google-Smtp-Source: APXvYqyWjsGHbuLmeC0Qkr8LysXeNaNX6lbId4wRg4KfbMI1haOpAJPgKnApW0xvAZLeT6g9ThRvkA== X-Received: by 2002:a63:354b:: with SMTP id c72mr550271pga.99.1581641061330; Thu, 13 Feb 2020 16:44:21 -0800 (PST) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id l29sm4424333pgb.86.2020.02.13.16.44.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2020 16:44:20 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , Alexander Graf , Rob Herring , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Pavel Machek , Len Brown , Todd Kjos , Bjorn Andersson , Greg Kroah-Hartman , linux-pm@vger.kernel.org Subject: [RFC][PATCH] driver core: Extend returning EPROBE_DEFER for two minutes after late_initcall Date: Fri, 14 Feb 2020 00:44:13 +0000 Message-Id: <20200214004413.12450-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 Due to commit e01afc3250255 ("PM / Domains: Stop deferring probe at the end of initcall"), along with commit 25b4e70dcce9 ("driver core: allow stopping deferred probe after init") after late_initcall, drivers will stop getting EPROBE_DEFER, and instead see an error causing the driver to fail to load. That change causes trouble when trying to use many clk drivers as modules, as the clk modules may not load until much later after init has started. If a dependent driver loads and gets an error instead of EPROBE_DEFER, it won't try to reload later when the dependency is met, and will thus fail to load. Instead of reverting that patch, this patch tries to extend the time that EPROBE_DEFER is retruned by two minutes, to (hopefully) ensure that everything has had a chance to load. Specifically, on db845c, this change allows us to set SDM_GPUCC_845, QCOM_CLK_RPMH and COMMON_CLK_QCOM as modules and get a working system, where as without it the display will fail to load. Cc: Alexander Graf 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: Greg Kroah-Hartman Cc: linux-pm@vger.kernel.org Fixes: e01afc3250255 ("PM / Domains: Stop deferring probe at the end of initcall") Fixes: 25b4e70dcce9 ("driver core: allow stopping deferred probe after init") Signed-off-by: John Stultz --- drivers/base/dd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/base/dd.c b/drivers/base/dd.c index b25bcab2a26b..35ebae8b65be 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -311,6 +311,12 @@ static void deferred_probe_timeout_work_func(struct work_struct *work) } static DECLARE_DELAYED_WORK(deferred_probe_timeout_work, deferred_probe_timeout_work_func); +static void deferred_initcall_done_work_func(struct work_struct *work) +{ + initcalls_done = true; +} +static DECLARE_DELAYED_WORK(deferred_initcall_done_work, deferred_initcall_done_work_func); + /** * deferred_probe_initcall() - Enable probing of deferred devices * @@ -327,7 +333,7 @@ static int deferred_probe_initcall(void) driver_deferred_probe_trigger(); /* Sort as many dependencies as possible before exiting initcalls */ flush_work(&deferred_probe_work); - initcalls_done = true; + schedule_delayed_work(&deferred_initcall_done_work, 120 * HZ); /* * Trigger deferred probe again, this time we won't defer anything