Current-Users archive

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

Issues with ukbd.c Rev. 1.147?



	hello.  Since upgrading my kernel to -.99.77 a couple of weeks ago, I've noticed a strange
problem with my USB keyboard.  If I'm in vi, editing a file, if I try to scroll  down the file
using the j key rapidly, instead of scrolling, I get usage errors from vi.  In most cases, I'm
editing files that I'm reaching via ssh from the host which I upgraded, i.e. I log in using the
keyboard in question to the local host, then ssh over to another host, which is on the same LAN
and do my editing, which exhibits the problem.
The USB controller is an xhci(4) chip, but I don't think that's important, though it may
contribute to the problem.  I actually think the problem is related to the changes introduced
in Rev. 1.146 of sys/dev/usb/ukbd.c.  Specifically, the introduction of a ring buffer for
keystrokes.  I think the comment beginning on line 689 of the 1.147 version of the file, shown
below, suggests the problem I'm seeing.  In any case, I think the read pointer is bypassing the
write pointer in the ring buffer and generating garbage when I hit keystrokes.  If I scroll
more slowly, then things work.  This problem did not occur with NetBSD-9.1, using the same
hardware, though it exhibited other USB issues under 9.1.  Has anyone else run into this issue?
-thanks
-Brian


		/*
		 * Some keyboards have a peculiar quirk.  They sometimes
		 * generate a key up followed by a key down for the same
		 * key after about 10 ms.
		 * We avoid this bug by holding off decoding for 20 ms.
		 * Note that this comes at a cost: we deliberately overwrite
		 * the data for any keyboard event that is followed by
		 * another one within this time window.
		 */


NetBSD 9.99.77 (MIRKWOOD) #0: Tue Jan 19 14:34:20 PST 2021
	buhrow%loth-9.nfbcal.org@localhost:/usr/local/netbsd/obj-current/sys/arch/amd64/compile/MIRKWOOD
total memory = 16088 MB
avail memory = 15564 MB

 . . .

xhci0 at pci0 dev 20 function 0: vendor 8086 product a2af (rev. 0x00)
xhci0: 64-bit DMA
xhci0: interrupting at msi0 vec 0
xhci0: xHCI version 1.0
usb1 at xhci0: USB revision 2.0
uhub1 at usb1: NetBSD (0x0000) xHCI root hub (0x0000), class 9/0, rev 2.00/1.00, addr 0
uhub2 at uhub1 port 4: API (0x04a5) API USB KB HUB (0x9213), class 9/0, rev 1.00/1.01, addr 2
uhub2: 3 ports with 2 removable, bus powered
uhidev1 at uhub2 port 1 configuration 1 interface 0
uhidev1: API (0x04a5) API USB KB HUB (0x0001), rev 1.00/1.01, addr 3, iclass 3/1
ukbd0 at uhidev1


Home | Main Index | Thread Index | Old Index