Subject: kern/12601: ohch does not found attach/detach device from root USB HUB
To: None <gnats-bugs@gnats.netbsd.org>
From: None <seirios@matrix.iri.co.jp>
List: netbsd-bugs
Date: 04/10/2001 14:17:25
>Number:         12601
>Category:       kern
>Synopsis:       ohch does not found attach/detach device from root USB HUB
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 10 14:18:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     HEO SeonMeyong
>Release:        Powerbook Ti, macppc, NetBSD-current(2001/04/05)
>Organization:
>Environment:
NetBSD laysner.seirios.org 1.5T NetBSD 1.5T (LAYSNER) #2: Thu Apr 5 12:16:42 JST 2001 seirios@laysner.seirios.org:/usr/src/src/sys/arch/macppc/compile/LAYSNER macppc

>Description:
	Macintosh PowerBook Ti has 2 port of USB interface attached at
	ohci root HUB.
	I found serious probrem about attaching/detaching USB device on
	ohci root HUB.

	1) attach USB device to PowerBook's USB port, and boot NetBSD,
	   kernel can find attached device. But cannot find if USB device
	   were detached
	2) attach USB HUB to to PowerBook's USB port, and boot NetBSD,
	   kernel can find USB HUB, and attach/detacch any USB device
	   to the external HUB, kernel can find attach/detach device
	   dynamicaly. But cannot find if USB HUB which connected
	    powerboos's USB port are detached.
	3) attach USB device to PowerBook's USB port after running kernel,
	   kernel cannot found attached device.


>How-To-Repeat:
	Attach USB device to ohci root hub
	Detach USB device from ohci root hub


>Fix:
	Followings are temporaly hack.

*** ohci.c~	Tue Feb 27 17:29:11 2001
--- ohci.c	Sun Apr  8 04:42:46 2001
***************
*** 1126,1136 ****
--- 1126,1138 ----
  		ohci_rhsc(sc, sc->sc_intrxfer);
  		intrs &= ~OHCI_RHSC;
  
+ #if 0
  		/* 
  		 * Disable RHSC interrupt for now, because it will be
  		 * on until the port has been reset.
  		 */
  		ohci_rhsc_able(sc, 0);
+ #endif
  	}
  
  	sc->sc_bus.intr_context--;

-----
	I think followings.
	1) After enabling interrupt at autoconfig, RHSC intrrupt are appered
	2) This interrupt is "Port Power Status", but I do not know what
	   does it means.
	3) ochi.c perse only attach/detach device at RHSC.
	4) If kernel found RHSC interrupt, kernel set RHSC disable, but
	   kernel do nothing after RHSC was disabled, so never enable RHSC
	   enable.

	Attached patch affects not to disable RHSC, but I think it does
	not true patch.
	Please fix the root hubs bug.

	Regards.

HEO

>Release-Note:
>Audit-Trail:
>Unformatted: