2014-12-09 08:35:28

by Patrice CHOTARD

[permalink] [raw]
Subject: [PATCH 0/2] various fixes for pinctrl-st

Fix deadlock when using debugfs pinconf-pins entry
Add missing hook .irq_disable

Francesco VIRLINZI (1):
pinctrl: st: avoid multiple mutex lock

Pankaj Dev (1):
pinctrl: st: Add irq_disable hook to st_gpio_irqchip

drivers/pinctrl/pinctrl-st.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

--
1.9.1


2014-12-09 08:35:29

by Patrice CHOTARD

[permalink] [raw]
Subject: [PATCH 1/2] pinctrl: st: avoid multiple mutex lock

From: Francesco VIRLINZI <[email protected]>

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]>
---
drivers/pinctrl/pinctrl-st.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
index caeeb1c..2870a68 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,
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]",
--
1.9.1

2014-12-09 08:35:54

by Patrice CHOTARD

[permalink] [raw]
Subject: [PATCH 2/2] pinctrl: st: Add irq_disable hook to st_gpio_irqchip

From: Pankaj Dev <[email protected]>

Currently disable_irq() doesn't work for pinctrl-st driver, due to
missing irq_disable hook in the driver.
disable_irq() is required only for level-triggered interrupts, which
is not the case normally.

Signed-off-by: Pankaj Dev <[email protected]>
Signed-off-by: Patrice Chotard <[email protected]>
---
drivers/pinctrl/pinctrl-st.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
index 2870a68..217259b 100644
--- a/drivers/pinctrl/pinctrl-st.c
+++ b/drivers/pinctrl/pinctrl-st.c
@@ -1445,6 +1445,7 @@ static struct gpio_chip st_gpio_template = {

static struct irq_chip st_gpio_irqchip = {
.name = "GPIO",
+ .irq_disable = st_gpio_irq_mask,
.irq_mask = st_gpio_irq_mask,
.irq_unmask = st_gpio_irq_unmask,
.irq_set_type = st_gpio_irq_set_type,
--
1.9.1