All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] ARM: pxa27x_keypad: clear pending interrupts on keypad config
@ 2012-10-28 15:46 ` Vasily Khoruzhick
  0 siblings, 0 replies; 10+ messages in thread
From: Vasily Khoruzhick @ 2012-10-28 15:46 UTC (permalink / raw)
  To: Dmitry Torokhov, Chao Xie, Haojian Zhuang, Mark Brown,
	Robert Jarzmik, linux-input, linux-arm-kernel
  Cc: Vasily Khoruzhick

Bootloader can leave interrupt bit pending, and it confuses driver.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
Rebased against v3.7-rc2

 drivers/input/keyboard/pxa27x_keypad.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index 803ff6f..cad9d5d 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -368,6 +368,9 @@ static void pxa27x_keypad_config(struct pxa27x_keypad *keypad)
 	unsigned int mask = 0, direct_key_num = 0;
 	unsigned long kpc = 0;
 
+	/* clear pending interrupt bit */
+	keypad_readl(KPC);
+
 	/* enable matrix keys with automatic scan */
 	if (pdata->matrix_key_rows && pdata->matrix_key_cols) {
 		kpc |= KPC_ASACT | KPC_MIE | KPC_ME | KPC_MS_ALL;
-- 
1.7.12.4


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

* [PATCH RESEND] ARM: pxa27x_keypad: clear pending interrupts on keypad config
@ 2012-10-28 15:46 ` Vasily Khoruzhick
  0 siblings, 0 replies; 10+ messages in thread
From: Vasily Khoruzhick @ 2012-10-28 15:46 UTC (permalink / raw)
  To: linux-arm-kernel

Bootloader can leave interrupt bit pending, and it confuses driver.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
Rebased against v3.7-rc2

 drivers/input/keyboard/pxa27x_keypad.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index 803ff6f..cad9d5d 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -368,6 +368,9 @@ static void pxa27x_keypad_config(struct pxa27x_keypad *keypad)
 	unsigned int mask = 0, direct_key_num = 0;
 	unsigned long kpc = 0;
 
+	/* clear pending interrupt bit */
+	keypad_readl(KPC);
+
 	/* enable matrix keys with automatic scan */
 	if (pdata->matrix_key_rows && pdata->matrix_key_cols) {
 		kpc |= KPC_ASACT | KPC_MIE | KPC_ME | KPC_MS_ALL;
-- 
1.7.12.4

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

* Re: [PATCH RESEND] ARM: pxa27x_keypad: clear pending interrupts on keypad config
  2012-10-28 15:46 ` Vasily Khoruzhick
@ 2012-10-28 17:55   ` Robert Jarzmik
  -1 siblings, 0 replies; 10+ messages in thread
From: Robert Jarzmik @ 2012-10-28 17:55 UTC (permalink / raw)
  To: Vasily Khoruzhick
  Cc: Dmitry Torokhov, Chao Xie, Haojian Zhuang, Mark Brown,
	linux-input, linux-arm-kernel

Vasily Khoruzhick <anarsoul@gmail.com> writes:

> Bootloader can leave interrupt bit pending, and it confuses driver.
OK, looks good to me.
One question though, just to make sure everything is covered :
  Suppose that the resume is the consequence of keypad press. If anybody relied
  previously on "reading the keypad" to know which key was pressed to wakeup the
  SoC, is it still working after your patch ?

And I suppose you can't "convince" your bootloader to behave correctly, can you ?

Cheers.

--
Robert

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

* [PATCH RESEND] ARM: pxa27x_keypad: clear pending interrupts on keypad config
@ 2012-10-28 17:55   ` Robert Jarzmik
  0 siblings, 0 replies; 10+ messages in thread
From: Robert Jarzmik @ 2012-10-28 17:55 UTC (permalink / raw)
  To: linux-arm-kernel

Vasily Khoruzhick <anarsoul@gmail.com> writes:

> Bootloader can leave interrupt bit pending, and it confuses driver.
OK, looks good to me.
One question though, just to make sure everything is covered :
  Suppose that the resume is the consequence of keypad press. If anybody relied
  previously on "reading the keypad" to know which key was pressed to wakeup the
  SoC, is it still working after your patch ?

And I suppose you can't "convince" your bootloader to behave correctly, can you ?

Cheers.

--
Robert

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

* Re: [PATCH RESEND] ARM: pxa27x_keypad: clear pending interrupts on keypad config
  2012-10-28 17:55   ` Robert Jarzmik
@ 2012-10-28 18:09     ` Vasily Khoruzhick
  -1 siblings, 0 replies; 10+ messages in thread
From: Vasily Khoruzhick @ 2012-10-28 18:09 UTC (permalink / raw)
  To: Robert Jarzmik
  Cc: Dmitry Torokhov, Chao Xie, Haojian Zhuang, Mark Brown,
	linux-input, linux-arm-kernel

On Sun, Oct 28, 2012 at 8:55 PM, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
> Vasily Khoruzhick <anarsoul@gmail.com> writes:
>
>> Bootloader can leave interrupt bit pending, and it confuses driver.
> OK, looks good to me.
> One question though, just to make sure everything is covered :
>   Suppose that the resume is the consequence of keypad press. If anybody relied
>   previously on "reading the keypad" to know which key was pressed to wakeup the
>   SoC, is it still working after your patch ?

Hi Robert,

Code from git master will not call pxa27x_keypad_config on resume if
device can cause wakeup,
so everything is OK (however it's another issue for pxa27x, because
device is not resuming correctly)

> And I suppose you can't "convince" your bootloader to behave correctly, can you ?

It behaves correctly, it just can't handle last keypress (because it's
booting Linux).
Even if it would be possible to fix this issue in bootloader it's
always nice to keep driver
failure-proof, so it does not fail even if bootloader left something
in non-consistent state.

Regards
Vasily

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

* [PATCH RESEND] ARM: pxa27x_keypad: clear pending interrupts on keypad config
@ 2012-10-28 18:09     ` Vasily Khoruzhick
  0 siblings, 0 replies; 10+ messages in thread
From: Vasily Khoruzhick @ 2012-10-28 18:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Oct 28, 2012 at 8:55 PM, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
> Vasily Khoruzhick <anarsoul@gmail.com> writes:
>
>> Bootloader can leave interrupt bit pending, and it confuses driver.
> OK, looks good to me.
> One question though, just to make sure everything is covered :
>   Suppose that the resume is the consequence of keypad press. If anybody relied
>   previously on "reading the keypad" to know which key was pressed to wakeup the
>   SoC, is it still working after your patch ?

Hi Robert,

Code from git master will not call pxa27x_keypad_config on resume if
device can cause wakeup,
so everything is OK (however it's another issue for pxa27x, because
device is not resuming correctly)

> And I suppose you can't "convince" your bootloader to behave correctly, can you ?

It behaves correctly, it just can't handle last keypress (because it's
booting Linux).
Even if it would be possible to fix this issue in bootloader it's
always nice to keep driver
failure-proof, so it does not fail even if bootloader left something
in non-consistent state.

Regards
Vasily

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

* Re: [PATCH RESEND] ARM: pxa27x_keypad: clear pending interrupts on keypad config
  2012-10-28 18:09     ` Vasily Khoruzhick
@ 2012-10-28 18:34       ` Robert Jarzmik
  -1 siblings, 0 replies; 10+ messages in thread
From: Robert Jarzmik @ 2012-10-28 18:34 UTC (permalink / raw)
  To: Vasily Khoruzhick
  Cc: Dmitry Torokhov, Chao Xie, Haojian Zhuang, Mark Brown,
	linux-input, linux-arm-kernel

Vasily Khoruzhick <anarsoul@gmail.com> writes:

> It behaves correctly, it just can't handle last keypress (because it's
> booting Linux).
> Even if it would be possible to fix this issue in bootloader it's
> always nice to keep driver
> failure-proof, so it does not fail even if bootloader left something
> in non-consistent state.
True.
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

-- 
Robert

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

* [PATCH RESEND] ARM: pxa27x_keypad: clear pending interrupts on keypad config
@ 2012-10-28 18:34       ` Robert Jarzmik
  0 siblings, 0 replies; 10+ messages in thread
From: Robert Jarzmik @ 2012-10-28 18:34 UTC (permalink / raw)
  To: linux-arm-kernel

Vasily Khoruzhick <anarsoul@gmail.com> writes:

> It behaves correctly, it just can't handle last keypress (because it's
> booting Linux).
> Even if it would be possible to fix this issue in bootloader it's
> always nice to keep driver
> failure-proof, so it does not fail even if bootloader left something
> in non-consistent state.
True.
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

-- 
Robert

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

* Re: [PATCH RESEND] ARM: pxa27x_keypad: clear pending interrupts on keypad config
  2012-10-28 18:34       ` Robert Jarzmik
@ 2012-11-01  9:35         ` Haojian Zhuang
  -1 siblings, 0 replies; 10+ messages in thread
From: Haojian Zhuang @ 2012-11-01  9:35 UTC (permalink / raw)
  To: Robert Jarzmik
  Cc: Vasily Khoruzhick, Dmitry Torokhov, Chao Xie, Mark Brown,
	linux-input, linux-arm-kernel

On Mon, Oct 29, 2012 at 2:34 AM, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
> Vasily Khoruzhick <anarsoul@gmail.com> writes:
>
>> It behaves correctly, it just can't handle last keypress (because it's
>> booting Linux).
>> Even if it would be possible to fix this issue in bootloader it's
>> always nice to keep driver
>> failure-proof, so it does not fail even if bootloader left something
>> in non-consistent state.
> True.
> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
>
> --
> Robert

Applied

Thanks
Haojian

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

* [PATCH RESEND] ARM: pxa27x_keypad: clear pending interrupts on keypad config
@ 2012-11-01  9:35         ` Haojian Zhuang
  0 siblings, 0 replies; 10+ messages in thread
From: Haojian Zhuang @ 2012-11-01  9:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 29, 2012 at 2:34 AM, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
> Vasily Khoruzhick <anarsoul@gmail.com> writes:
>
>> It behaves correctly, it just can't handle last keypress (because it's
>> booting Linux).
>> Even if it would be possible to fix this issue in bootloader it's
>> always nice to keep driver
>> failure-proof, so it does not fail even if bootloader left something
>> in non-consistent state.
> True.
> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
>
> --
> Robert

Applied

Thanks
Haojian

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

end of thread, other threads:[~2012-11-01  9:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-28 15:46 [PATCH RESEND] ARM: pxa27x_keypad: clear pending interrupts on keypad config Vasily Khoruzhick
2012-10-28 15:46 ` Vasily Khoruzhick
2012-10-28 17:55 ` Robert Jarzmik
2012-10-28 17:55   ` Robert Jarzmik
2012-10-28 18:09   ` Vasily Khoruzhick
2012-10-28 18:09     ` Vasily Khoruzhick
2012-10-28 18:34     ` Robert Jarzmik
2012-10-28 18:34       ` Robert Jarzmik
2012-11-01  9:35       ` Haojian Zhuang
2012-11-01  9:35         ` Haojian Zhuang

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.