All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ps2kbd: default to scan enabled after reset
@ 2018-10-21 19:07 Hervé Poussineau
  2018-11-10 20:53 ` Hervé Poussineau
  2018-11-10 21:25 ` [Qemu-devel] [PATCH] " Philippe Mathieu-Daudé
  0 siblings, 2 replies; 6+ messages in thread
From: Hervé Poussineau @ 2018-10-21 19:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Geoffrey McRae, qemu-ppc, Hervé Poussineau

A check for scan_enabled has been added to ps2_keyboard_event in commit
143c04c7e0639e53086519592ead15d2556bfbf2 to prevent stream corruption.
This works well as long as operating system is resetting keyboard, or enabling it.

This fixes IBM 40p firmware, which doesn't bother sending KBD_CMD_RESET,
KBD_CMD_ENABLE or KBD_CMD_RESET_ENABLE before trying to use the keyboard.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 hw/input/ps2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index fdfcadf9a1..eded4f0f8d 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -938,7 +938,7 @@ static void ps2_kbd_reset(void *opaque)
 
     trace_ps2_kbd_reset(opaque);
     ps2_common_reset(&s->common);
-    s->scan_enabled = 0;
+    s->scan_enabled = 1;
     s->translate = 0;
     s->scancode_set = 2;
     s->modifiers = 0;
-- 
2.11.0

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

* Re: [Qemu-devel] [PATCH] ps2kbd: default to scan enabled after reset
  2018-10-21 19:07 [Qemu-devel] [PATCH] ps2kbd: default to scan enabled after reset Hervé Poussineau
@ 2018-11-10 20:53 ` Hervé Poussineau
  2018-11-18 10:09   ` [Qemu-devel] [PATCH-for-3.1] " Hervé Poussineau
  2018-11-10 21:25 ` [Qemu-devel] [PATCH] " Philippe Mathieu-Daudé
  1 sibling, 1 reply; 6+ messages in thread
From: Hervé Poussineau @ 2018-11-10 20:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Geoffrey McRae, qemu-ppc

Ping.

Le 21/10/2018 à 21:07, Hervé Poussineau a écrit :
> A check for scan_enabled has been added to ps2_keyboard_event in commit
> 143c04c7e0639e53086519592ead15d2556bfbf2 to prevent stream corruption.
> This works well as long as operating system is resetting keyboard, or enabling it.
> 
> This fixes IBM 40p firmware, which doesn't bother sending KBD_CMD_RESET,
> KBD_CMD_ENABLE or KBD_CMD_RESET_ENABLE before trying to use the keyboard.
> 
> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
> ---
>   hw/input/ps2.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/input/ps2.c b/hw/input/ps2.c
> index fdfcadf9a1..eded4f0f8d 100644
> --- a/hw/input/ps2.c
> +++ b/hw/input/ps2.c
> @@ -938,7 +938,7 @@ static void ps2_kbd_reset(void *opaque)
>   
>       trace_ps2_kbd_reset(opaque);
>       ps2_common_reset(&s->common);
> -    s->scan_enabled = 0;
> +    s->scan_enabled = 1;
>       s->translate = 0;
>       s->scancode_set = 2;
>       s->modifiers = 0;
> 

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

* Re: [Qemu-devel] [PATCH] ps2kbd: default to scan enabled after reset
  2018-10-21 19:07 [Qemu-devel] [PATCH] ps2kbd: default to scan enabled after reset Hervé Poussineau
  2018-11-10 20:53 ` Hervé Poussineau
@ 2018-11-10 21:25 ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-11-10 21:25 UTC (permalink / raw)
  To: Hervé Poussineau
  Cc: qemu-devel@nongnu.org Developers, Geoffrey McRae,
	qemu-ppc@nongnu.org list:PowerPC

Hi Hervé,

On Sun, Oct 21, 2018 at 9:12 PM Hervé Poussineau <hpoussin@reactos.org> wrote:
> A check for scan_enabled has been added to ps2_keyboard_event in commit
> 143c04c7e0639e53086519592ead15d2556bfbf2 to prevent stream corruption.
> This works well as long as operating system is resetting keyboard, or enabling it.
>
> This fixes IBM 40p firmware, which doesn't bother sending KBD_CMD_RESET,
> KBD_CMD_ENABLE or KBD_CMD_RESET_ENABLE before trying to use the keyboard.
>
> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
> ---
>  hw/input/ps2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/input/ps2.c b/hw/input/ps2.c
> index fdfcadf9a1..eded4f0f8d 100644
> --- a/hw/input/ps2.c
> +++ b/hw/input/ps2.c
> @@ -938,7 +938,7 @@ static void ps2_kbd_reset(void *opaque)
>
>      trace_ps2_kbd_reset(opaque);
>      ps2_common_reset(&s->common);
> -    s->scan_enabled = 0;
> +    s->scan_enabled = 1;
>      s->translate = 0;
>      s->scancode_set = 2;
>      s->modifiers = 0;
> --
> 2.11.0
>

I think QOM'ifying this device would force a cleanup of those various
reset functions.
Then ps2_kbd_reset could call ps2_reset_keyboard.

In the meantime this patch makes sense as a bugfix.
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Regards,

Phil.

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

* Re: [Qemu-devel] [PATCH-for-3.1] ps2kbd: default to scan enabled after reset
  2018-11-10 20:53 ` Hervé Poussineau
@ 2018-11-18 10:09   ` Hervé Poussineau
  2018-11-22 18:30     ` [Qemu-devel] [PATCH-for-3.1] [REGRESSION FIX] " Hervé Poussineau
  0 siblings, 1 reply; 6+ messages in thread
From: Hervé Poussineau @ 2018-11-18 10:09 UTC (permalink / raw)
  To: Hervé Poussineau, qemu-devel; +Cc: Geoffrey McRae, qemu-ppc, Gerd Hoffmann

Ping again.

v3.0 didn't contain 143c04c7e0639e53086519592ead15d2556bfbf2, so this commit fixes a regression.

Le 10/11/2018 à 21:53, Hervé Poussineau a écrit :
> Ping.
> 
> Le 21/10/2018 à 21:07, Hervé Poussineau a écrit :
>> A check for scan_enabled has been added to ps2_keyboard_event in commit
>> 143c04c7e0639e53086519592ead15d2556bfbf2 to prevent stream corruption.
>> This works well as long as operating system is resetting keyboard, or enabling it.
>>
>> This fixes IBM 40p firmware, which doesn't bother sending KBD_CMD_RESET,
>> KBD_CMD_ENABLE or KBD_CMD_RESET_ENABLE before trying to use the keyboard.
>>
>> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
>> ---
>>   hw/input/ps2.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/input/ps2.c b/hw/input/ps2.c
>> index fdfcadf9a1..eded4f0f8d 100644
>> --- a/hw/input/ps2.c
>> +++ b/hw/input/ps2.c
>> @@ -938,7 +938,7 @@ static void ps2_kbd_reset(void *opaque)
>>       trace_ps2_kbd_reset(opaque);
>>       ps2_common_reset(&s->common);
>> -    s->scan_enabled = 0;
>> +    s->scan_enabled = 1;
>>       s->translate = 0;
>>       s->scancode_set = 2;
>>       s->modifiers = 0;
>>
> 

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

* Re: [Qemu-devel] [PATCH-for-3.1] [REGRESSION FIX] ps2kbd: default to scan enabled after reset
  2018-11-18 10:09   ` [Qemu-devel] [PATCH-for-3.1] " Hervé Poussineau
@ 2018-11-22 18:30     ` Hervé Poussineau
  2018-11-23  6:25       ` Gerd Hoffmann
  0 siblings, 1 reply; 6+ messages in thread
From: Hervé Poussineau @ 2018-11-22 18:30 UTC (permalink / raw)
  To: Hervé Poussineau, qemu-devel, Paolo Bonzini, Michael S. Tsirkin
  Cc: Geoffrey McRae, qemu-ppc, Gerd Hoffmann

Ping again.

Le 18/11/2018 à 11:09, Hervé Poussineau a écrit :
> Ping again.
> 
> v3.0 didn't contain 143c04c7e0639e53086519592ead15d2556bfbf2, so this commit fixes a regression.
> 
> Le 10/11/2018 à 21:53, Hervé Poussineau a écrit :
>> Ping.
>>
>> Le 21/10/2018 à 21:07, Hervé Poussineau a écrit :
>>> A check for scan_enabled has been added to ps2_keyboard_event in commit
>>> 143c04c7e0639e53086519592ead15d2556bfbf2 to prevent stream corruption.
>>> This works well as long as operating system is resetting keyboard, or enabling it.
>>>
>>> This fixes IBM 40p firmware, which doesn't bother sending KBD_CMD_RESET,
>>> KBD_CMD_ENABLE or KBD_CMD_RESET_ENABLE before trying to use the keyboard.
>>>
>>> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
>>> ---
>>>   hw/input/ps2.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/hw/input/ps2.c b/hw/input/ps2.c
>>> index fdfcadf9a1..eded4f0f8d 100644
>>> --- a/hw/input/ps2.c
>>> +++ b/hw/input/ps2.c
>>> @@ -938,7 +938,7 @@ static void ps2_kbd_reset(void *opaque)
>>>       trace_ps2_kbd_reset(opaque);
>>>       ps2_common_reset(&s->common);
>>> -    s->scan_enabled = 0;
>>> +    s->scan_enabled = 1;
>>>       s->translate = 0;
>>>       s->scancode_set = 2;
>>>       s->modifiers = 0;
>>>
>>
> 
> 

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

* Re: [Qemu-devel] [PATCH-for-3.1] [REGRESSION FIX] ps2kbd: default to scan enabled after reset
  2018-11-22 18:30     ` [Qemu-devel] [PATCH-for-3.1] [REGRESSION FIX] " Hervé Poussineau
@ 2018-11-23  6:25       ` Gerd Hoffmann
  0 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2018-11-23  6:25 UTC (permalink / raw)
  To: Hervé Poussineau
  Cc: qemu-devel, Paolo Bonzini, Michael S. Tsirkin, Geoffrey McRae, qemu-ppc

On Thu, Nov 22, 2018 at 07:30:41PM +0100, Hervé Poussineau wrote:
> Ping again.

Queued up for 3.1

thanks,
  Gerd

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

end of thread, other threads:[~2018-11-23  6:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-21 19:07 [Qemu-devel] [PATCH] ps2kbd: default to scan enabled after reset Hervé Poussineau
2018-11-10 20:53 ` Hervé Poussineau
2018-11-18 10:09   ` [Qemu-devel] [PATCH-for-3.1] " Hervé Poussineau
2018-11-22 18:30     ` [Qemu-devel] [PATCH-for-3.1] [REGRESSION FIX] " Hervé Poussineau
2018-11-23  6:25       ` Gerd Hoffmann
2018-11-10 21:25 ` [Qemu-devel] [PATCH] " Philippe Mathieu-Daudé

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.