mbox series

[v2,00/11] PS/2 controller related fixes

Message ID a898b0d5-7086-9699-ae8b-9524ad319b01@t-online.de (mailing list archive)
Headers show
Series PS/2 controller related fixes | expand

Message

Volker Rümelin May 7, 2021, 6:08 p.m. UTC
This patch series fixes two different PS/2 mouse stream corruptions
and adds a feature that allows some old misbehaving DOS programs to
have a working keyboard. With the last few patches, the PS/2 con-
troller behaves more like a real controller.

v2:
Introduce the function kbd_pending() in a preliminary patch to ease
the review of patch "pckbd: correctly disable PS/2 communication",
as Philippe suggested.

Volker Rümelin (11):
   ps2: fix mouse stream corruption
   ps2: don't raise an interrupt if queue is full
   ps2: don't deassert irq twice if queue is empty
   pckbd: split out interrupt line changing code
   pckbd: don't update OBF flags if KBD_STAT_OBF is set
   pckbd: PS/2 keyboard throttle
   pckbd: add state variable for interrupt source
   pckbd: add controller response queue
   pckbd: add function kbd_pending()
   pckbd: correctly disable PS/2 communication
   pckbd: remove duplicated keyboard and mouse defines

  hw/input/pckbd.c | 293 ++++++++++++++++++++++++++++++++++-------------
  hw/input/ps2.c   |  11 +-
  2 files changed, 223 insertions(+), 81 deletions(-)

Comments

Volker Rümelin May 9, 2021, 4:03 p.m. UTC | #1
> This patch series fixes two different PS/2 mouse stream corruptions
> and adds a feature that allows some old misbehaving DOS programs to
> have a working keyboard. With the last few patches, the PS/2 con-
> troller behaves more like a real controller.
>
> v2:
> Introduce the function kbd_pending() in a preliminary patch to ease
> the review of patch "pckbd: correctly disable PS/2 communication",
> as Philippe suggested.
>
> Volker Rümelin (11):
>   ps2: fix mouse stream corruption
>   ps2: don't raise an interrupt if queue is full
>   ps2: don't deassert irq twice if queue is empty
>   pckbd: split out interrupt line changing code
>   pckbd: don't update OBF flags if KBD_STAT_OBF is set
>   pckbd: PS/2 keyboard throttle
>   pckbd: add state variable for interrupt source
>   pckbd: add controller response queue
>   pckbd: add function kbd_pending()
>   pckbd: correctly disable PS/2 communication
>   pckbd: remove duplicated keyboard and mouse defines

I'm sorry, there is a bug somewhere in this series. Seabios sometimes
doesn't detect the PS/2 keyboard. Please ignore this series for now.

With best regards,
Volker

>
>  hw/input/pckbd.c | 293 ++++++++++++++++++++++++++++++++++-------------
>  hw/input/ps2.c   |  11 +-
>  2 files changed, 223 insertions(+), 81 deletions(-)
>
Volker Rümelin May 10, 2021, 8:41 p.m. UTC | #2
>> This patch series fixes two different PS/2 mouse stream corruptions
>> and adds a feature that allows some old misbehaving DOS programs to
>> have a working keyboard. With the last few patches, the PS/2 con-
>> troller behaves more like a real controller.
>>
>> v2:
>> Introduce the function kbd_pending() in a preliminary patch to ease
>> the review of patch "pckbd: correctly disable PS/2 communication",
>> as Philippe suggested.
>>
>> Volker Rümelin (11):
>>   ps2: fix mouse stream corruption
>>   ps2: don't raise an interrupt if queue is full
>>   ps2: don't deassert irq twice if queue is empty
>>   pckbd: split out interrupt line changing code
>>   pckbd: don't update OBF flags if KBD_STAT_OBF is set
>>   pckbd: PS/2 keyboard throttle
>>   pckbd: add state variable for interrupt source
>>   pckbd: add controller response queue
>>   pckbd: add function kbd_pending()
>>   pckbd: correctly disable PS/2 communication
>>   pckbd: remove duplicated keyboard and mouse defines
>
> I'm sorry, there is a bug somewhere in this series. Seabios sometimes
> doesn't detect the PS/2 keyboard. Please ignore this series for now.
>

This is a Seabios bug. Seabios expects the PS/2 controller doesn't
generate interrupts after it sends the command KBD_CCMD_KBD_DISABLE
to the controller. Even the original author of the pckbd code wrote
in a comment that this is incorrect. I will send a version 3 series
where I don't fix the incorrectness.

> With best regards,
> Volker
>
>>
>>  hw/input/pckbd.c | 293 ++++++++++++++++++++++++++++++++++-------------
>>  hw/input/ps2.c   |  11 +-
>>  2 files changed, 223 insertions(+), 81 deletions(-)
>>
>