NetBSD-Bugs archive

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

Re: kern/11018 (VIA VT83C572 UHCI USB controller does not work)



On 02/14/17 14:40, Izumi Tsutsui wrote:
The following reply was made to PR kern/11018; it has been noted by GNATS.

From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: skrll%NetBSD.org@localhost, tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: kern/11018 (VIA VT83C572 UHCI USB controller does not work)
Date: Tue, 14 Feb 2017 23:36:25 +0900

  > I'll check details with USB_DEUBG and UHCI_DEBUG later in this week.
Here is usbhist output with hw.usb.debug=127 and hw.uhci.debug=127
  on plugging a USB mouse:

[snip]

  1487082222.-989968917 uhci_check_intr#1@0: called!
  1487082222.-989953885 uhci_check_intr#1@0: ux 0x3e08e00
  1487082222.-989923820 uhci_check_intr#1@0: active ux=0x3e08e00
  1487082222.-989888172 uhci_check_intr#1@0: ux=0x3e08e00 done
  1487082222.-989822888 uhci_idone#1@0: called!
  1487082222.-989807856 uhci_idone#1@0: ux=0x3e08e00
  1487082222.-989781656 uhci_idone#1@0: ux=0x3e08e00, xfer=0x3e08e00, pipe=0x3dcaac8 ready
  1487082222.-989764047 uhci_idone#1@0: --- dump start ---
  1487082222.-989743431 uhci_dump_td#22@0: called!
  1487082222.-989733123 uhci_dump_td#22@0: TD(0xd247a0) at 0x00d247a0
  1487082222.-989721956 uhci_dump_td#22@0:    link=0x00d245f0 status=0x1c000007 token=0x00e0002d buffer=0x00d5df80
  1487082222.-989707783 uhci_dump_td#22@0: bitstuff=0 crcto   =0 nak     =0 babble  =0
  1487082222.-989690603 uhci_dump_td#22@0: dbuffer =0 stalled =0 active  =0 ioc     =0
  1487082222.-989679866 uhci_dump_td#22@0: ios     =0 ls      =1 spd     =0
  1487082222.-989669987 uhci_dump_td#22@0: errcnt  =3 actlen  =8 pid=2d
  1487082222.-989657532 uhci_dump_td#22@0: addr=0  endpt=0  D=0  maxlen=8,
  1487082222.-989643358 uhci_dump_td#23@0: called!
  1487082222.-989636916 uhci_dump_td#23@0: TD(0xd245f0) at 0x00d245f0
  1487082222.-989627467 uhci_dump_td#23@0:    link=0x00d24624 status=0x1c000007 token=0x00e80069 buffer=0x00d5df40
  1487082222.-989619307 uhci_dump_td#23@0: bitstuff=0 crcto   =0 nak     =0 babble  =0
  1487082222.-989611146 uhci_dump_td#23@0: dbuffer =0 stalled =0 active  =0 ioc     =0
  1487082222.-989605133 uhci_dump_td#23@0: ios     =0 ls      =1 spd     =0
  1487082222.-989596114 uhci_dump_td#23@0: errcnt  =3 actlen  =8 pid=69
  1487082222.-989587094 uhci_dump_td#23@0: addr=0  endpt=0  D=1  maxlen=8,
  1487082222.-989575498 uhci_dump_td#24@0: called!
  1487082222.-989569055 uhci_dump_td#24@0: TD(0xd24620) at 0x00d24620
  1487082222.-989560466 uhci_dump_td#24@0:    link=0x00d24654 status=0x1c000007 token=0x00e00069 buffer=0x00d5df48
  1487082222.-989552305 uhci_dump_td#24@0: bitstuff=0 crcto   =0 nak     =0 babble  =0
  1487082222.-989544574 uhci_dump_td#24@0: dbuffer =0 stalled =0 active  =0 ioc     =0
  1487082222.-989538561 uhci_dump_td#24@0: ios     =0 ls      =1 spd     =0
  1487082222.-989528253 uhci_dump_td#24@0: errcnt  =3 actlen  =8 pid=69
  1487082222.-989518804 uhci_dump_td#24@0: addr=0  endpt=0  D=0  maxlen=8,
  1487082222.-989507637 uhci_dump_td#25@0: called!
  1487082222.-989501195 uhci_dump_td#25@0: TD(0xd24650) at 0x00d24650
  1487082222.-989491746 uhci_dump_td#25@0:    link=0x00d24684 status=0x1c4007ff token=0x00e80069 buffer=0x00d5df50
  1487082222.-989483586 uhci_dump_td#25@0: bitstuff=0 crcto   =0 nak     =0 babble  =0
  1487082222.-989475425 uhci_dump_td#25@0: dbuffer =0 stalled =1 active  =0 ioc     =0
  1487082222.-989468983 uhci_dump_td#25@0: ios     =0 ls      =1 spd     =0
  1487082222.-989458675 uhci_dump_td#25@0: errcnt  =3 actlen  =0 pid=69
  1487082222.-989450514 uhci_dump_td#25@0: addr=0  endpt=0  D=1  maxlen=8,
  1487082222.-989439777 uhci_dump_td#26@0: called!
  1487082222.-989433764 uhci_dump_td#26@0: TD(0xd24680) at 0x00d24680

After 16bytes the device sends STALL.


Does this patch help?

Nick
Index: sys/dev/usb/usb_subr.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usb_subr.c,v
retrieving revision 1.218
diff -u -p -r1.218 usb_subr.c
--- sys/dev/usb/usb_subr.c	19 Jan 2017 16:05:00 -0000	1.218
+++ sys/dev/usb/usb_subr.c	15 Feb 2017 07:35:25 -0000
@@ -1131,7 +1131,8 @@ usbd_reattach_device(device_t parent, st
  * MaxPacketSize is known by the host) by exactly this length.
  */
 usbd_status
-usbd_get_initial_ddesc(struct usbd_device *dev, usb_device_descriptor_t *desc)
+usbd_get_initial_ddesc(struct usbd_device *dev, usb_device_descriptor_t *desc,
+    int len)
 {
 	USBHIST_FUNC(); USBHIST_CALLED(usbdebug);
 	usb_device_request_t req;
@@ -1144,7 +1145,7 @@ usbd_get_initial_ddesc(struct usbd_devic
 	req.bRequest = UR_GET_DESCRIPTOR;
 	USETW2(req.wValue, UDESC_DEVICE, 0);
 	USETW(req.wIndex, 0);
-	USETW(req.wLength, 64);
+	USETW(req.wLength, len);
 	res = usbd_do_request_flags(dev, &req, buf, USBD_SHORT_XFER_OK,
 		&actlen, USBD_DEFAULT_TIMEOUT);
 	if (res)
@@ -1260,7 +1261,7 @@ usbd_new_device(device_t parent, struct 
 	/* Try a few times in case the device is slow (i.e. outside specs.) */
 	for (i = 0; i < 10; i++) {
 		/* Get the first 8 bytes of the device descriptor. */
-		err = usbd_get_initial_ddesc(dev, dd);
+		err = usbd_get_initial_ddesc(dev, dd, i % 2 == 0 ? 64 : 8);
 		if (!err)
 			break;
 		/*
Index: sys/dev/usb/usbdivar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usbdivar.h,v
retrieving revision 1.114
diff -u -p -r1.114 usbdivar.h
--- sys/dev/usb/usbdivar.h	19 Jan 2017 16:05:00 -0000	1.114
+++ sys/dev/usb/usbdivar.h	15 Feb 2017 07:35:27 -0000
@@ -338,7 +338,7 @@ void		usbd_kill_pipe(struct usbd_pipe *)
 usbd_status	usbd_attach_roothub(device_t, struct usbd_device *);
 usbd_status	usbd_probe_and_attach(device_t, struct usbd_device *, int, int);
 usbd_status	usbd_get_initial_ddesc(struct usbd_device *,
-				       usb_device_descriptor_t *);
+		    usb_device_descriptor_t *, int);
 
 /* Routines from usb.c */
 void		usb_needs_explore(struct usbd_device *);
Index: sys/dev/usb/xhci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/xhci.c,v
retrieving revision 1.70
diff -u -p -r1.70 xhci.c
--- sys/dev/usb/xhci.c	21 Jan 2017 07:39:30 -0000	1.70
+++ sys/dev/usb/xhci.c	15 Feb 2017 07:35:32 -0000
@@ -2289,7 +2301,7 @@ xhci_new_device(device_t parent, struct 
 	if (depth == 0 && port == 0) {
 		KASSERT(bus->ub_devices[USB_ROOTHUB_INDEX] == NULL);
 		bus->ub_devices[USB_ROOTHUB_INDEX] = dev;
-		err = usbd_get_initial_ddesc(dev, dd);
+		err = usbd_get_initial_ddesc(dev, dd, 64);
 		if (err) {
 			DPRINTFN(1, "get_initial_ddesc %u", err, 0, 0, 0);
 			goto bad;
@@ -2357,7 +2369,7 @@ xhci_new_device(device_t parent, struct 
 		 */
 		bus->ub_devices[usb_addr2dindex(dev->ud_addr)] = dev;
 
-		err = usbd_get_initial_ddesc(dev, dd);
+		err = usbd_get_initial_ddesc(dev, dd, 64);
 		if (err) {
 			DPRINTFN(1, "get_initial_ddesc %u", err, 0, 0, 0);
 			goto bad;


Home | Main Index | Thread Index | Old Index