NetBSD Problem Report #53605

From www@NetBSD.org  Fri Sep 14 09:54:41 2018
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 962DC7A1E1
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 14 Sep 2018 09:54:41 +0000 (UTC)
Message-Id: <20180914095440.45E3C7A1FE@mollari.NetBSD.org>
Date: Fri, 14 Sep 2018 09:54:40 +0000 (UTC)
From: code@boerschig.net
Reply-To: code@boerschig.net
To: gnats-bugs@NetBSD.org
Subject: USB Keyboard not working: uhidev_intr: bad repid 5
X-Send-Pr-Version: www-1.0

>Number:         53605
>Category:       kern
>Synopsis:       USB Keyboard not working: uhidev_intr: bad repid 5
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 14 09:55:00 +0000 2018
>Last-Modified:  Sat Nov 17 19:15:01 +0000 2018
>Originator:     MB
>Release:        8.0 STABLE and 8.99.25
>Organization:
>Environment:
amd64, usb installation medium for 8.0 STABLE, 8.99.25 (snapshot). Both uefi and normal usb installation, tried USB HUB, USB2, USB3 Ports.
>Description:
The usb keyboard I have (a "magicforce" mechanical gaming keyboard) doesn't work with the installation media.
This keyboard works well with Windoze 10, Ubuntu 16.04 on the same machine. Also with no problems on two different machines.

I tried connecting it directly to the PC, USB2 and USB3 ports.
It appears as multiple ukbd, when pressing keys it only shows:
uhidev_intr: bad repid 5
uhidev_intr: bad repid 5
(two times per key)

The dmesg for the keyboard, when attaching (transcript from screenshot):

uhidev3 at uhub6 port 4 configuration 1 interface 0
uhidev3: HOLDCHIP (0x4d9) USB Gaming Keyboard (0xa0f8), rev 1.10/2.00, addr 6, iclass 3/1
ukbd1 at uhidev3: 8 Variable keys, 6 Array codes
wskbd1 at ukbd1 mux 1
uhidev4 at uhub6 port 4 configuration 1 interface 1
uhidev4: HOLDCHIP (0x4d9) USB Gaming Keyboard (0xa0f8), rev 1.10/2.00, addr 6, iclass 3/0
uhidev4: 4 report ids
uhid6 at uhidev4 reportid 1: input=1, output=0, feature=0
uhid7 at uhidev4 reportid 2: input=3, output=0, feature=0
ukbd2 at uhidev4 reportid 4: 0 Variable keys, 0 Array codes
wskbd2 at ukbd2 mux 1
uhidev5 at uhub6 port 4 configuration 1 interface 2
uhidev5:  HOLDCHIP (0x4d9) USB Gaming Keyboard (0xa0f8), rev 1.10/2.00, addr 6, iclass 3/0
uhid8 at uhidev5: input=32, output=32, feature=8





>How-To-Repeat:
Use a cheap mechanical USB keyboard, try to install NetBSD.
Keyboard doesn't work with UEFI or CSM (the old MBR boot).
>Fix:

>Audit-Trail:
From: MB <code@boerschig.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/53605: USB Keyboard not working: uhidev_intr: bad repid 5
Date: Sat, 22 Sep 2018 10:35:08 +0200

 Hi,

 I got the keyboard working by adding the following usb-quirk:

 diff --git a/sys/dev/usb/usb_quirks.c b/sys/dev/usb/usb_quirks.c
 index cbf562afff37..448f26140790 100644
 --- a/sys/dev/usb/usb_quirks.c
 +++ b/sys/dev/usb/usb_quirks.c
 @@ -150,6 +150,7 @@ Static const struct usbd_quirk_entry {
  	ANY, { UQ_ASSUME_CM_OVER_DATA }},
   { USB_VENDOR_ZOOM, USB_PRODUCT_ZOOM_3095,
  	ANY, { UQ_LOST_CS_DESC }},
 + { USB_VENDOR_HOLTEK, 0xa0f8, ANY, { UQ_NO_SET_PROTO}},
   { 0, 0, 0, { 0 } }
  };





 Am 14.09.2018 um 11:55 schrieb gnats-admin@netbsd.org:
 > Thank you very much for your problem report.
 > It has the internal identification `kern/53605'.
 > The individual assigned to look at your
 > report is: kern-bug-people. 
 > 
 >> Category:       kern
 >> Responsible:    kern-bug-people
 >> Synopsis:       USB Keyboard not working: uhidev_intr: bad repid 5
 >> Arrival-Date:   Fri Sep 14 09:55:00 +0000 2018
 > 

From: "Jonathan A. Kollasch" <jakllsch@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53605 CVS commit: src/sys/dev
Date: Thu, 15 Nov 2018 23:01:46 +0000

 Module Name:	src
 Committed By:	jakllsch
 Date:		Thu Nov 15 23:01:46 UTC 2018

 Modified Files:
 	src/sys/dev/bluetooth: bthidev.c
 	src/sys/dev/hid: hid.c hid.h
 	src/sys/dev/i2c: ihidev.c
 	src/sys/dev/usb: uhidev.c

 Log Message:
 Correctly handle signed/unsigned quantities in kernel HID parser.

 Should fix PR kern/53605.


 To generate a diff of this commit:
 cvs rdiff -u -r1.30 -r1.31 src/sys/dev/bluetooth/bthidev.c
 cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hid/hid.c src/sys/dev/hid/hid.h
 cvs rdiff -u -r1.5 -r1.6 src/sys/dev/i2c/ihidev.c
 cvs rdiff -u -r1.73 -r1.74 src/sys/dev/usb/uhidev.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: MB <code@boerschig.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: PR/53605 CVS commit: src/sys/dev
Date: Sat, 17 Nov 2018 08:46:58 +0100

 After applying this fix the keyboard still doesn't work (key presses
 show up as bad repid 5 ):

 [ 640.8601947] uhidev0: HOLDCHIP (0x4d9) USB Gaming Keyboard (0xa0f8),
 rev 1.10/2.00, addr 5, iclass 3/1
 [ 640.8601947] ukbd0 at uhidev0: 8 Variable keys, 6 Array codes
 [ 641.2703372] wskbd0 at ukbd0: console keyboard, using wsdisplay0
 [ 641.2703372] uhidev1 at uhub1 port 2 configuration 1 interface 1
 [ 641.2703372] uhidev1: HOLDCHIP (0x4d9) USB Gaming Keyboard (0xa0f8),
 rev 1.10/2.00, addr 5, iclass 3/0
 [ 641.2703372] uhidev1: 4 report ids
 [ 641.2703372] uhid0 at uhidev1 reportid 1: input=1, output=0, feature=0
 [ 641.2703372] uhid1 at uhidev1 reportid 2: input=3, output=0, feature=0
 [ 641.2703372] ukbd1 at uhidev1 reportid 4: 232 Variable keys, 0 Array codes
 [ 641.6804798] wskbd1 at ukbd1 mux 1
 [ 641.6804798] wskbd1: connecting to wsdisplay0
 [ 641.6804798] uhidev2 at uhub1 port 2 configuration 1 interface 2
 [ 641.6804798] uhidev2: HOLDCHIP (0x4d9) USB Gaming Keyboard (0xa0f8),
 rev 1.10/2.00, addr 5, iclass 3/0
 [ 641.6804798] uhid2 at uhidev2: input=32, output=32, feature=8
 [ 643.1709979] uhidev_intr: bad repid 5
 [ 643.2910395] uhidev_intr: bad repid 5

 If there is something I could test or if you need more debug logs please
 let me know.

 OTOH, it would be nice if someone could add the usb_quirk for the
 keyboard to work in boot protocol mode I proposed earlier.


 On 16.11.18 00:05, Jonathan A. Kollasch wrote:
 > The following reply was made to PR kern/53605; it has been noted by GNATS.
 > 
 > From: "Jonathan A. Kollasch" <jakllsch@netbsd.org>
 > To: gnats-bugs@gnats.NetBSD.org
 > Cc: 
 > Subject: PR/53605 CVS commit: src/sys/dev
 > Date: Thu, 15 Nov 2018 23:01:46 +0000
 > 
 >  Module Name:	src
 >  Committed By:	jakllsch
 >  Date:		Thu Nov 15 23:01:46 UTC 2018
 >  
 >  Modified Files:
 >  	src/sys/dev/bluetooth: bthidev.c
 >  	src/sys/dev/hid: hid.c hid.h
 >  	src/sys/dev/i2c: ihidev.c
 >  	src/sys/dev/usb: uhidev.c
 >  
 >  Log Message:
 >  Correctly handle signed/unsigned quantities in kernel HID parser.
 >  
 >  Should fix PR kern/53605.
 >  
 >  
 >  To generate a diff of this commit:
 >  cvs rdiff -u -r1.30 -r1.31 src/sys/dev/bluetooth/bthidev.c
 >  cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hid/hid.c src/sys/dev/hid/hid.h
 >  cvs rdiff -u -r1.5 -r1.6 src/sys/dev/i2c/ihidev.c
 >  cvs rdiff -u -r1.73 -r1.74 src/sys/dev/usb/uhidev.c
 >  
 >  Please note that diffs are not public domain; they are subject to the
 >  copyright notices on the relevant files.
 >  
 > 

From: "Jonathan A. Kollasch" <jakllsch@kollasch.net>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org, code@boerschig.net
Subject: Re: PR/53605 CVS commit: src/sys/dev
Date: Sat, 17 Nov 2018 12:53:08 -0600

 Did you test after removing the quirk flag you added?

From: MB <code@boerschig.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: PR/53605 CVS commit: src/sys/dev
Date: Sat, 17 Nov 2018 20:11:26 +0100

 On 17.11.18 19:55, Jonathan A. Kollasch wrote:
 > The following reply was made to PR kern/53605; it has been noted by GNATS.
 > 
 > From: "Jonathan A. Kollasch" <jakllsch@kollasch.net>
 > To: gnats-bugs@NetBSD.org
 > Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
 > 	netbsd-bugs@netbsd.org, code@boerschig.net
 > Subject: Re: PR/53605 CVS commit: src/sys/dev
 > Date: Sat, 17 Nov 2018 12:53:08 -0600
 > 
 >  Did you test after removing the quirk flag you added?
 >  
 > 

 Yes, I had a clean github checkout on my notebook. Initially tested in
 virtualbox with USB passthrough, but also ran it on a physical machine
 to make sure.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.