From patchwork Sat Aug 8 04:35:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 247555 Delivered-To: patches@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp3048910ilo; Fri, 7 Aug 2020 21:35:16 -0700 (PDT) X-Received: by 2002:a17:90a:b107:: with SMTP id z7mr17335475pjq.4.1596861316420; Fri, 07 Aug 2020 21:35:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596861316; cv=none; d=google.com; s=arc-20160816; b=hQ2r4KnHwmoCtC7+hB4wXsdqT+IrZezwO1MzNv6P+oEyUtxvsUBc7BInNwEKG28L0P Z+OgbtsUhsRc/qZ/v4SqcowuaEuG1dx2OSKfMg8dELjvN8zxpUPoJYzPgaGtSy9tJINl DCMRDZ3WhXOclvOkw/tKAVoR9d8bgDmDb4hA1yfHjJrBqOr5VX+T+PhNYC47RoRyMdVy NcFdgYFAsj7WJH540C6fXxg9GYwyAYaGI7Qb6ah99fkkgaR+bQHPeNo2ETphBt926Sdt ZIv4//Tx5ANXpNya6ZJjm4jx5gD6jfmhlYN02JNqqs/1+kQVu+TbfyXB49CO5bf4BXnJ UXOg== 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=FLH00sdB350zJ9xfj23oogVpb2S3tQu3JW6EcRNgLew=; b=Y/P9BWWbegD35DSSKGMejJZ/n5YNr5Zl/5HsqyH56UoJVay/PMy5nlQo7SPCkaWNZJ 1lHJYerLBV5+agdSzR/yWNzAUus/zCvMPb1U31cRg6nOi6+PyKBQXiQgyK7A4Y33vusf AQVq8M2cs8JjOprDzvR+sEKSoMFwdWyuLTWVXNxA3fz6pgTrc+w6jBeklO+LRL9t9pai 8X3Qa3Rc+E4/TkbFFkZEjPBJBktjYUybA6rJBhdbof5M+BCQXGMoHRGpy9vd38ujHKfm yXBkMf0FEmdd4eN/uDOKNX3mLzz0uVktudeiZo5YNxY1S5IgM5XarfHKy/Vufib9u+vD 97Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jxsmsVrP; 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 x15sor10189063pgx.2.2020.08.07.21.35.16 for (Google Transport Security); Fri, 07 Aug 2020 21:35:16 -0700 (PDT) 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=jxsmsVrP; 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=FLH00sdB350zJ9xfj23oogVpb2S3tQu3JW6EcRNgLew=; b=jxsmsVrPMXk3ia55RuurLWnSF4l/zKLQ3vl9KAAZyocpecHvuHBmvqNZ3/XplYR3Gu n64wEa8PfUTVNoNBErV1lJqro5vuj1nM156YV6puxX0VwIGA00GjYcltZ/n0CHtTmuzl K2dCPiCPxd74wNDhXQLkKGBo2IVHvYaeYFNG01vgjfXIz8zc4ApEPfoR14VwkWPo/3jX gsEkm2oobSufzAL5Borf0uY3W1ZJuoPEjN+7yEoaVyebCPQbU6AoPggfRtKb3JqQ42/A JwqVVpbzfnkJNscvxEW48HhBsrwYsNzeGeVgzqGq0KhbSns0HdL3r9jTSBsMGRJ+8XlJ 8GKg== 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=FLH00sdB350zJ9xfj23oogVpb2S3tQu3JW6EcRNgLew=; b=qScqdAFyv2Z5spMUj1gK0eX2rfvJ+03FjyahAix4xOrqOmxNSBSOjxyHjNFK/k0RPA gNwgyh/vCLKFBaTA7rm/ZoWxwL64Uf7/A9DzM4x2HmBfpo3JC0kLJChFJ1EqsgdRxeMm H6rovbBOsQOjIyFeqmQnxJx6wO4x1sps4SVsSciVYTG7CpSnP3q5xojXoSEKFMolAPy1 qEdNpScUU+61MKi1VcOt1CpThwcHFNomdGwzq7Cb6xeX4n+hAJohgqvgcUj8nKCQrITw po6D5FY98QjAq4SInVIXYX26Fh4uLlvqVrx1mAtrNxk/S8vY67fpK/6ctJK4PoPlpkMO LMgA== X-Gm-Message-State: AOAM530G3r7y3d4CWs/GrZno1iYQ3+tKOnq5R3//XXCGU2pGw94JTgnc bzhb6BlYhRQdzvuKSqgnqQXqs1qZ X-Google-Smtp-Source: ABdhPJwNTHQJhOGti3fSdIgHT3N5Ze4RXdBPrXTV4+YSlALH9wv8HLqMwbWjlTEZZ6jWzuIuQz6l9Q== X-Received: by 2002:a63:485f:: with SMTP id x31mr14308176pgk.49.1596861315980; Fri, 07 Aug 2020 21:35:15 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id u24sm14607963pfm.211.2020.08.07.21.35.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Aug 2020 21:35:15 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , linux-pm@vger.kernel.org, Greg Kroah-Hartman , Linus Walleij , Thierry Reding , Mark Brown , Liam Girdwood , Bjorn Andersson , Saravana Kannan , Todd Kjos , Len Brown , Pavel Machek , Ulf Hansson , Kevin Hilman , "Rafael J. Wysocki" , Rob Herring Subject: [RFC][PATCH] pinctrl: Rework driver_deferred_probe_check_state() evaluation since default timeout has changed Date: Sat, 8 Aug 2020 04:35:12 +0000 Message-Id: <20200808043512.106865-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In commit bec6c0ecb243 ("pinctrl: Remove use of driver_deferred_probe_check_state_continue()"), we removed the use of driver_deferred_probe_check_state_continue() which effectively never returned -ETIMED_OUT, with the driver_deferred_probe_check_state() function that had been reworked to properly return ETIMED_OUT when the deferred probe timeout expired. Along with that change, we set the default timeout to 30 seconds. However, since moving the timeout to 30 seconds caused some issues for some users with optional dt links, we set the default timeout back to zero - see commit ce68929f07de ("driver core: Revert default driver_deferred_probe_timeout value to 0") This in essence changed the behavior of the pinctrl's usage of driver_deferred_probe_check_state(), as it now would return ETIMED_OUT by default. Thierry reported this caused problems with resume on tegra platforms. Thus this patch tweaks the pinctrl logic so that it behaves as before. If modules are enabled, we'll only return EPROBE_DEFERRED while we're missing drivers linked in the DT. Cc: linux-pm@vger.kernel.org Cc: Greg Kroah-Hartman Cc: Linus Walleij Cc: Thierry Reding Cc: Mark Brown Cc: Liam Girdwood Cc: Bjorn Andersson Cc: Saravana Kannan Cc: Todd Kjos Cc: Len Brown Cc: Pavel Machek Cc: Ulf Hansson Cc: Kevin Hilman Cc: "Rafael J. Wysocki" Cc: Rob Herring Fixes: bec6c0ecb243 ("pinctrl: Remove use of driver_deferred_probe_check_state_continue()") Fixes: ce68929f07de ("driver core: Revert default driver_deferred_probe_timeout value to 0") Reported-by: Thierry Reding Signed-off-by: John Stultz --- drivers/pinctrl/devicetree.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c index c6fe7d64c913..09ddf567ccb4 100644 --- a/drivers/pinctrl/devicetree.c +++ b/drivers/pinctrl/devicetree.c @@ -129,9 +129,8 @@ static int dt_to_map_one_config(struct pinctrl *p, if (!np_pctldev || of_node_is_root(np_pctldev)) { of_node_put(np_pctldev); ret = driver_deferred_probe_check_state(p->dev); - /* keep deferring if modules are enabled unless we've timed out */ - if (IS_ENABLED(CONFIG_MODULES) && !allow_default && - (ret == -ENODEV)) + /* keep deferring if modules are enabled */ + if (IS_ENABLED(CONFIG_MODULES) && !allow_default) ret = -EPROBE_DEFER; return ret; }