Re: [PATCH 11/11] pinctrl: single: Clear pin interrupts enabled by bootloader

2014-04-23 Thread Linus Walleij
On Tue, Apr 22, 2014 at 6:10 PM, Tony Lindgren t...@atomide.com wrote:

 Shall I apply this patch or will you funnel it through ARM SoC
 due to deps?

 No deps except boards hanging without it.. Please feel free to
 take this one, prererrably as a fix for the -rc series if no
 objections.

Yes this is -rc material. Queued for fixes. Thanks!

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 11/11] pinctrl: single: Clear pin interrupts enabled by bootloader

2014-04-22 Thread Linus Walleij
On Fri, Apr 11, 2014 at 1:47 AM, Tony Lindgren t...@atomide.com wrote:

 Since we set up device wake-up interrupts as pinctrl-single
 interrupts, we now must use the standard request_irq and
 related functions to manage them.

 If the pin interrupts are enabled for some pins at boot,
 the wake-up events can show up as constantly pending
 at least on omaps and will hang the system unless the related
 device driver clears the event at the device.

 To fix this, let's clear the interrupt flags during init,
 and print out a warning so the board maintainers can update
 their drivers to do proper request_irq for the driver specific
 wake-up events.

 Cc: Haojian Zhuang haojian.zhu...@linaro.org
 Cc: Linus Walleij linus.wall...@linaro.org
 Signed-off-by: Tony Lindgren t...@atomide.com

Looks clean.

Acked-by: Linus Walleij linus.wall...@linaro.org

Shall I apply this patch or will you funnel it through ARM SoC
due to deps?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 11/11] pinctrl: single: Clear pin interrupts enabled by bootloader

2014-04-22 Thread Tony Lindgren
* Linus Walleij linus.wall...@linaro.org [140422 04:55]:
 On Fri, Apr 11, 2014 at 1:47 AM, Tony Lindgren t...@atomide.com wrote:
 
  Since we set up device wake-up interrupts as pinctrl-single
  interrupts, we now must use the standard request_irq and
  related functions to manage them.
 
  If the pin interrupts are enabled for some pins at boot,
  the wake-up events can show up as constantly pending
  at least on omaps and will hang the system unless the related
  device driver clears the event at the device.
 
  To fix this, let's clear the interrupt flags during init,
  and print out a warning so the board maintainers can update
  their drivers to do proper request_irq for the driver specific
  wake-up events.
 
  Cc: Haojian Zhuang haojian.zhu...@linaro.org
  Cc: Linus Walleij linus.wall...@linaro.org
  Signed-off-by: Tony Lindgren t...@atomide.com
 
 Looks clean.
 
 Acked-by: Linus Walleij linus.wall...@linaro.org
 
 Shall I apply this patch or will you funnel it through ARM SoC
 due to deps?

No deps except boards hanging without it.. Please feel free to
take this one, prererrably as a fix for the -rc series if no
objections.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/11] pinctrl: single: Clear pin interrupts enabled by bootloader

2014-04-10 Thread Tony Lindgren
Since we set up device wake-up interrupts as pinctrl-single
interrupts, we now must use the standard request_irq and
related functions to manage them.

If the pin interrupts are enabled for some pins at boot,
the wake-up events can show up as constantly pending
at least on omaps and will hang the system unless the related
device driver clears the event at the device.

To fix this, let's clear the interrupt flags during init,
and print out a warning so the board maintainers can update
their drivers to do proper request_irq for the driver specific
wake-up events.

Cc: Haojian Zhuang haojian.zhu...@linaro.org
Cc: Linus Walleij linus.wall...@linaro.org
Signed-off-by: Tony Lindgren t...@atomide.com
---
 drivers/pinctrl/pinctrl-single.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index de64596..ba1f4b1 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -808,6 +808,7 @@ static const struct pinconf_ops pcs_pinconf_ops = {
 static int pcs_add_pin(struct pcs_device *pcs, unsigned offset,
unsigned pin_pos)
 {
+   struct pcs_soc_data *pcs_soc = pcs-socdata;
struct pinctrl_pin_desc *pin;
struct pcs_name *pn;
int i;
@@ -819,6 +820,18 @@ static int pcs_add_pin(struct pcs_device *pcs, unsigned 
offset,
return -ENOMEM;
}
 
+   if (pcs_soc-irq_enable_mask) {
+   unsigned val;
+
+   val = pcs-read(pcs-base + offset);
+   if (val  pcs_soc-irq_enable_mask) {
+   dev_dbg(pcs-dev, irq enabled at boot for pin at %lx 
(%x), clearing\n,
+   (unsigned long)pcs-res-start + offset, val);
+   val = ~pcs_soc-irq_enable_mask;
+   pcs-write(val, pcs-base + offset);
+   }
+   }
+
pin = pcs-pins.pa[i];
pn = pcs-names[i];
sprintf(pn-name, %lx.%d,
-- 
1.8.1.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html