diff options
author | Francesco VIRLINZI <francesco.virlinzi@st.com> | 2015-01-05 05:04:13 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-01-07 04:43:41 -0500 |
commit | 96d16c3088a924a44175d2923cc0eafa0d8bbecc (patch) | |
tree | 03308ef2873f09f6e45e491e0d1e788fa4e99e0e | |
parent | f2dd028c2632d107c26b1daed543d9efd4f0decd (diff) |
pinctrl: st: avoid multiple mutex lock
Using the sysfs inteface to inspect the pins configuration
the system can walk around a path which acquires the same
mutex twice.
On STiH407 platform, for example :
cat /sys/kernel/debug/pinctrl/920f080.pin-controller-front0/pinconf-pins
hangs the kernel and never returns.
With this patch the mutex is temporary freed.
Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/pinctrl-st.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c index 7c9d51382248..87570e68deed 100644 --- a/drivers/pinctrl/pinctrl-st.c +++ b/drivers/pinctrl/pinctrl-st.c | |||
@@ -1012,8 +1012,10 @@ static void st_pinconf_dbg_show(struct pinctrl_dev *pctldev, | |||
1012 | struct seq_file *s, unsigned pin_id) | 1012 | struct seq_file *s, unsigned pin_id) |
1013 | { | 1013 | { |
1014 | unsigned long config; | 1014 | unsigned long config; |
1015 | st_pinconf_get(pctldev, pin_id, &config); | ||
1016 | 1015 | ||
1016 | mutex_unlock(&pctldev->mutex); | ||
1017 | st_pinconf_get(pctldev, pin_id, &config); | ||
1018 | mutex_lock(&pctldev->mutex); | ||
1017 | seq_printf(s, "[OE:%ld,PU:%ld,OD:%ld]\n" | 1019 | seq_printf(s, "[OE:%ld,PU:%ld,OD:%ld]\n" |
1018 | "\t\t[retime:%ld,invclk:%ld,clknotdat:%ld," | 1020 | "\t\t[retime:%ld,invclk:%ld,clknotdat:%ld," |
1019 | "de:%ld,rt-clk:%ld,rt-delay:%ld]", | 1021 | "de:%ld,rt-clk:%ld,rt-delay:%ld]", |