Skip to content

Commit

Permalink
pinctrl: st: avoid multiple mutex lock
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Patrice Chotard <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
Francesco VIRLINZI authored and linusw committed Jan 7, 2015
1 parent f2dd028 commit 96d16c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/pinctrl/pinctrl-st.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,8 +1012,10 @@ static void st_pinconf_dbg_show(struct pinctrl_dev *pctldev,
struct seq_file *s, unsigned pin_id)
{
unsigned long config;
st_pinconf_get(pctldev, pin_id, &config);

mutex_unlock(&pctldev->mutex);
st_pinconf_get(pctldev, pin_id, &config);
mutex_lock(&pctldev->mutex);
seq_printf(s, "[OE:%ld,PU:%ld,OD:%ld]\n"
"\t\t[retime:%ld,invclk:%ld,clknotdat:%ld,"
"de:%ld,rt-clk:%ld,rt-delay:%ld]",
Expand Down

0 comments on commit 96d16c3

Please sign in to comment.