NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/59576: viogpu causes race condition between pckbd_enable and pckbd_set_leds



From: "Martin Husemann via gnats" <gnats-admin%NetBSD.org@localhost>
Date: Tue, 12 Aug 2025 06:45:02 +0000 (UTC)
On Wed, Aug 06, 2025 at 08:20:00AM +0000, alex14fr%gmail.com@localhost wrote:

>> - pckbd_enable uses pckbport_poll_cmd to send KBC_ENABLE command
>> - pckbcintr fires, causing a call to pckbd_set_leds
>> - pckbd_set_leds sends a KBC_MODEIND keyboard command, waits for 
>> acknowledgement but eats the acknowledgement of KBC_ENABLE that 
>> should have been read by pckbd_enable/pckbport_poll_cmd 

>  Wouldn't it be better to make pckbd_set_leds() return immediately if
>  sc->sc_enabled is not yet set?
>  
>  Could you test that?

I tested and it doesn't work (back to "command error" message). pckbcintr()
fires between entry of pckbd_enable and the return from pckbport_poll_cmd,
and calls bus_space_read_1 to read on KBC I/O ports 0x60 and 0x64 and 
consume the ack.

Alexandre




Home | Main Index | Thread Index | Old Index