summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2018-07-09 11:41:50 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-10 11:22:35 -0400
commitd19c5e79d46efdf89306be99f3c8824cf58e35f6 (patch)
treec264ec79e263828ad363e8658bc516aebf5aea04
parent7930eb919feb59b8c799cb3085d0e9f7b5ae34d1 (diff)
pinctrl: Support stopping deferred probe after initcalls
Pinctrl drivers are a common dependency which can prevent a system booting even if the default or bootloader configured settings can work. If a pinctrl node in DT indicates that the default pin setup can be used with the 'pinctrl-use-default' property, then only defer probe until initcalls are done. If the deferred probe timeout is enabled or loadable modules are disabled, then we'll stop deferring probe regardless of the DT property. This gives platforms the option to work without their pinctrl driver being enabled. Dropped the pinctrl specific deferring probe message as the driver core can print deferred probe related messages if needed. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/pinctrl/devicetree.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c
index c4aa411f5935..2969ff3162c3 100644
--- a/drivers/pinctrl/devicetree.c
+++ b/drivers/pinctrl/devicetree.c
@@ -111,17 +111,24 @@ static int dt_to_map_one_config(struct pinctrl *p,
111 int ret; 111 int ret;
112 struct pinctrl_map *map; 112 struct pinctrl_map *map;
113 unsigned num_maps; 113 unsigned num_maps;
114 bool allow_default = false;
114 115
115 /* Find the pin controller containing np_config */ 116 /* Find the pin controller containing np_config */
116 np_pctldev = of_node_get(np_config); 117 np_pctldev = of_node_get(np_config);
117 for (;;) { 118 for (;;) {
119 if (!allow_default)
120 allow_default = of_property_read_bool(np_pctldev,
121 "pinctrl-use-default");
122
118 np_pctldev = of_get_next_parent(np_pctldev); 123 np_pctldev = of_get_next_parent(np_pctldev);
119 if (!np_pctldev || of_node_is_root(np_pctldev)) { 124 if (!np_pctldev || of_node_is_root(np_pctldev)) {
120 dev_info(p->dev, "could not find pctldev for node %pOF, deferring probe\n",
121 np_config);
122 of_node_put(np_pctldev); 125 of_node_put(np_pctldev);
123 /* OK let's just assume this will appear later then */ 126 ret = driver_deferred_probe_check_state(p->dev);
124 return -EPROBE_DEFER; 127 /* keep deferring if modules are enabled unless we've timed out */
128 if (IS_ENABLED(CONFIG_MODULES) && !allow_default && ret == -ENODEV)
129 ret = -EPROBE_DEFER;
130
131 return ret;
125 } 132 }
126 /* If we're creating a hog we can use the passed pctldev */ 133 /* If we're creating a hog we can use the passed pctldev */
127 if (hog_pctldev && (np_pctldev == p->dev->of_node)) { 134 if (hog_pctldev && (np_pctldev == p->dev->of_node)) {