linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH 0/2] pinctrl-st: various fixes
@ 2015-01-05 10:04 Patrice CHOTARD
  2015-01-05 10:04 ` [RESEND PATCH 1/2] pinctrl: st: avoid multiple mutex lock Patrice CHOTARD
  2015-01-05 10:04 ` [RESEND PATCH 2/2] pinctrl: st: Add irq_disable hook to st_gpio_irqchip Patrice CHOTARD
  0 siblings, 2 replies; 6+ messages in thread
From: Patrice CHOTARD @ 2015-01-05 10:04 UTC (permalink / raw)
  To: linux-kernel, Linus Walleij; +Cc: linux-arm-kernel

Resend this series, it seems that the one i send in 
December has been lost despite it was visible on lkml

Two fixes for pinctrl-st pinctrl driver

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

Patrice Chotard (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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [RESEND PATCH 1/2] pinctrl: st: avoid multiple mutex lock
  2015-01-05 10:04 [RESEND PATCH 0/2] pinctrl-st: various fixes Patrice CHOTARD
@ 2015-01-05 10:04 ` Patrice CHOTARD
  2015-01-07  9:44   ` Linus Walleij
  2015-01-05 10:04 ` [RESEND PATCH 2/2] pinctrl: st: Add irq_disable hook to st_gpio_irqchip Patrice CHOTARD
  1 sibling, 1 reply; 6+ messages in thread
From: Patrice CHOTARD @ 2015-01-05 10:04 UTC (permalink / raw)
  To: linux-kernel, Linus Walleij; +Cc: linux-arm-kernel

From: Francesco VIRLINZI <francesco.virlinzi@st.com>

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>
---
 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 7c9d513..87570e6 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [RESEND PATCH 2/2] pinctrl: st: Add irq_disable hook to st_gpio_irqchip
  2015-01-05 10:04 [RESEND PATCH 0/2] pinctrl-st: various fixes Patrice CHOTARD
  2015-01-05 10:04 ` [RESEND PATCH 1/2] pinctrl: st: avoid multiple mutex lock Patrice CHOTARD
@ 2015-01-05 10:04 ` Patrice CHOTARD
  2015-01-07  9:45   ` Linus Walleij
  1 sibling, 1 reply; 6+ messages in thread
From: Patrice CHOTARD @ 2015-01-05 10:04 UTC (permalink / raw)
  To: linux-kernel, Linus Walleij; +Cc: linux-arm-kernel

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 <pankaj.dev@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
---
 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 87570e6..9e5ec00 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [RESEND PATCH 1/2] pinctrl: st: avoid multiple mutex lock
  2015-01-05 10:04 ` [RESEND PATCH 1/2] pinctrl: st: avoid multiple mutex lock Patrice CHOTARD
@ 2015-01-07  9:44   ` Linus Walleij
  2015-01-07 10:30     ` Patrice Chotard
  0 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2015-01-07  9:44 UTC (permalink / raw)
  To: Patrice CHOTARD; +Cc: linux-kernel, linux-arm-kernel

On Mon, Jan 5, 2015 at 11:04 AM, Patrice CHOTARD <patrice.chotard@st.com> wrote:

> From: Francesco VIRLINZI <francesco.virlinzi@st.com>
>
> 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>

Patch applied to fixes. Sorry for the delay.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RESEND PATCH 2/2] pinctrl: st: Add irq_disable hook to st_gpio_irqchip
  2015-01-05 10:04 ` [RESEND PATCH 2/2] pinctrl: st: Add irq_disable hook to st_gpio_irqchip Patrice CHOTARD
@ 2015-01-07  9:45   ` Linus Walleij
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2015-01-07  9:45 UTC (permalink / raw)
  To: Patrice CHOTARD; +Cc: linux-kernel, linux-arm-kernel

On Mon, Jan 5, 2015 at 11:04 AM, Patrice CHOTARD <patrice.chotard@st.com> wrote:

> 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 <pankaj.dev@st.com>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

Patch applied to fixes. Sorry for the delay.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RESEND PATCH 1/2] pinctrl: st: avoid multiple mutex lock
  2015-01-07  9:44   ` Linus Walleij
@ 2015-01-07 10:30     ` Patrice Chotard
  0 siblings, 0 replies; 6+ messages in thread
From: Patrice Chotard @ 2015-01-07 10:30 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-kernel, linux-arm-kernel

Hi Linus
On 01/07/2015 10:44 AM, Linus Walleij wrote:
> On Mon, Jan 5, 2015 at 11:04 AM, Patrice CHOTARD <patrice.chotard@st.com> wrote:
>
>> From: Francesco VIRLINZI <francesco.virlinzi@st.com>
>>
>> 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>
> Patch applied to fixes. Sorry for the delay.

Don't worry ;-)

Thanks

>
> Yours,
> Linus Walleij


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-01-07 10:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-05 10:04 [RESEND PATCH 0/2] pinctrl-st: various fixes Patrice CHOTARD
2015-01-05 10:04 ` [RESEND PATCH 1/2] pinctrl: st: avoid multiple mutex lock Patrice CHOTARD
2015-01-07  9:44   ` Linus Walleij
2015-01-07 10:30     ` Patrice Chotard
2015-01-05 10:04 ` [RESEND PATCH 2/2] pinctrl: st: Add irq_disable hook to st_gpio_irqchip Patrice CHOTARD
2015-01-07  9:45   ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).