All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv3] pinctrl: baytrail: Clear DIRECT_IRQ bit
@ 2014-09-26 14:14 Loic Poulain
  2014-09-29  7:27 ` Mika Westerberg
  2014-10-15  9:01 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Loic Poulain @ 2014-09-26 14:14 UTC (permalink / raw)
  To: mika.westerberg, linus.walleij
  Cc: linux-kernel, samuel.ortiz, mathias.nyman, heikki.krogerus, Loic Poulain

Direct irq en bit should be cleared for pads using io mode.
If not, the io based irq will never be detected.
However, this bit can sometimes be misconfigured (BIOS issue).
Force clearing of this bit in io mode and trigger a WARN.

Signed-off-by: Loic Poulain <loic.poulain@intel.com>
---
 v2: Apply over ff998356b644ebe723127bd9eec6040b59a4a4f6 + add Warning
 v3: Update commit message & warn message

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

diff --git a/drivers/pinctrl/pinctrl-baytrail.c b/drivers/pinctrl/pinctrl-baytrail.c
index 701a646..d1e9484 100644
--- a/drivers/pinctrl/pinctrl-baytrail.c
+++ b/drivers/pinctrl/pinctrl-baytrail.c
@@ -230,10 +230,14 @@ static int byt_irq_type(struct irq_data *d, unsigned type)
 	spin_lock_irqsave(&vg->lock, flags);
 	value = readl(reg);

+	WARN(value & BYT_DIRECT_IRQ_EN,
+		"Bad pad config for io mode, force direct_irq_en bit clearing");
+
 	/* For level trigges the BYT_TRIG_POS and BYT_TRIG_NEG bits
 	 * are used to indicate high and low level triggering
 	 */
-	value &= ~(BYT_TRIG_POS | BYT_TRIG_NEG | BYT_TRIG_LVL);
+	value &= ~(BYT_DIRECT_IRQ_EN | BYT_TRIG_POS | BYT_TRIG_NEG |
+		   BYT_TRIG_LVL);

 	switch (type) {
 	case IRQ_TYPE_LEVEL_HIGH:
--
1.8.3.2


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

* Re: [PATCHv3] pinctrl: baytrail: Clear DIRECT_IRQ bit
  2014-09-26 14:14 [PATCHv3] pinctrl: baytrail: Clear DIRECT_IRQ bit Loic Poulain
@ 2014-09-29  7:27 ` Mika Westerberg
  2014-10-15  9:01 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Mika Westerberg @ 2014-09-29  7:27 UTC (permalink / raw)
  To: Loic Poulain
  Cc: linus.walleij, linux-kernel, samuel.ortiz, mathias.nyman,
	heikki.krogerus

On Fri, Sep 26, 2014 at 04:14:51PM +0200, Loic Poulain wrote:
> Direct irq en bit should be cleared for pads using io mode.
> If not, the io based irq will never be detected.
> However, this bit can sometimes be misconfigured (BIOS issue).
> Force clearing of this bit in io mode and trigger a WARN.
> 
> Signed-off-by: Loic Poulain <loic.poulain@intel.com>

That's more like it,

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Thanks!

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

* Re: [PATCHv3] pinctrl: baytrail: Clear DIRECT_IRQ bit
  2014-09-26 14:14 [PATCHv3] pinctrl: baytrail: Clear DIRECT_IRQ bit Loic Poulain
  2014-09-29  7:27 ` Mika Westerberg
@ 2014-10-15  9:01 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2014-10-15  9:01 UTC (permalink / raw)
  To: Loic Poulain
  Cc: Westerberg, Mika, linux-kernel, Samuel Ortiz, Mathias Nyman,
	Heikki Krogerus

On Fri, Sep 26, 2014 at 4:14 PM, Loic Poulain <loic.poulain@intel.com> wrote:

> Direct irq en bit should be cleared for pads using io mode.
> If not, the io based irq will never be detected.
> However, this bit can sometimes be misconfigured (BIOS issue).
> Force clearing of this bit in io mode and trigger a WARN.
>
> Signed-off-by: Loic Poulain <loic.poulain@intel.com>
> ---
>  v2: Apply over ff998356b644ebe723127bd9eec6040b59a4a4f6 + add Warning
>  v3: Update commit message & warn message

Patch applied for fixes with Mika's ACK.. Sorry for the
delay.

Yours,
Linus Walleij

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

end of thread, other threads:[~2014-10-15  9:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-26 14:14 [PATCHv3] pinctrl: baytrail: Clear DIRECT_IRQ bit Loic Poulain
2014-09-29  7:27 ` Mika Westerberg
2014-10-15  9:01 ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.