linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio-dwapb: reset mask register on probe
@ 2015-03-03  8:47 Alexey Brodkin
  2015-03-09 13:59 ` Linus Walleij
  0 siblings, 1 reply; 6+ messages in thread
From: Alexey Brodkin @ 2015-03-03  8:47 UTC (permalink / raw)
  To: linux-gpio
  Cc: linux-kernel, Alexey Brodkin, Vineet Gupta, Linus Walleij,
	Alexandre Courbot

It's possible that boot-loader that worked on CPU before Linux kernel
made some changes in GPIO controller registers. For example interrupts
could be all masked.

Current implementation of DW GPIO driver relies on default values in
mask register.

This is especially problematic in this DW GPIO driver because it sets 2
pairs of methods: .irq_eable/.irq_disable and .irq_mask/.irq_unmask. In
this case generic "irq_enable" function will use only
.irq_enable call-back and mask register will be never modified so
required interrupts will be finally unmasked.

To troubleshoot described problem on driver probe we just need to make
sure mask register is zeroed.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
---
 drivers/gpio/gpio-dwapb.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
index 58faf04..be75860 100644
--- a/drivers/gpio/gpio-dwapb.c
+++ b/drivers/gpio/gpio-dwapb.c
@@ -370,6 +370,9 @@ static void dwapb_configure_irqs(struct dwapb_gpio *gpio,
 		irq_create_mapping(gpio->domain, hwirq);
 
 	port->bgc.gc.to_irq = dwapb_gpio_to_irq;
+
+	/* Reset mask register */
+	dwapb_write(gpio, GPIO_INTMASK, 0);
 }
 
 static void dwapb_irq_teardown(struct dwapb_gpio *gpio)
-- 
2.1.0

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

end of thread, other threads:[~2015-03-26  9:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-03  8:47 [PATCH] gpio-dwapb: reset mask register on probe Alexey Brodkin
2015-03-09 13:59 ` Linus Walleij
2015-03-09 20:56   ` Alexey Brodkin
2015-03-17 16:54     ` Linus Walleij
2015-03-19  8:44       ` Alexey Brodkin
2015-03-26  9:29         ` 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).