From owner-freebsd-usb@FreeBSD.ORG Tue Feb 28 02:20:07 2006 Return-Path: X-Original-To: freebsd-usb@hub.freebsd.org Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 09A7816A420 for ; Tue, 28 Feb 2006 02:20:07 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id ACDF743D45 for ; Tue, 28 Feb 2006 02:20:06 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k1S2K6eG018103 for ; Tue, 28 Feb 2006 02:20:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k1S2K67L018102; Tue, 28 Feb 2006 02:20:06 GMT (envelope-from gnats) Date: Tue, 28 Feb 2006 02:20:06 GMT Message-Id: <200602280220.k1S2K67L018102@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Ian Dowse Cc: Subject: Re: usb/81524 : panic: usb_cold_explore: busses to explore when !cold X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ian Dowse List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2006 02:20:07 -0000 The following reply was made to PR usb/81524; it has been noted by GNATS. From: Ian Dowse To: Eugene Grosbein Cc: bug-followup@freebsd.org Subject: Re: usb/81524 : panic: usb_cold_explore: busses to explore when !cold Date: Tue, 28 Feb 2006 02:17:07 +0000 In message <20060227154754.GA396@grosbein.pp.ru>, Eugene Grosbein writes: >I've applied your patch to 1.26.2.14 (that's the latest revision >in RELENG_4 for now) and it broke my USB. The kernel prints at the boot time: > >usb_new_device: set address 2 failed - trying a port reset >usb_new_device: set address 2 failed - trying a port reset >usb_new_device: set address 2 failed - trying a port reset >usb_new_device: set address 2 failed >uhub_explore: usb_new_device failed, error=SET_ADDR_FAILED >uhub0: device problem (SET_ADDR_FAILED), disabling port 1 Oops, I must have missed updating to 1.26.2.14, so I didn't see that polling mode had been commented out. Could you try this patch instead? Thanks, Ian Index: usb.c =================================================================== RCS file: /home/iedowse/CVS/src/sys/dev/usb/usb.c,v retrieving revision 1.26.2.14 diff -u -r1.26.2.14 usb.c --- usb.c 16 May 2005 09:39:25 -0000 1.26.2.14 +++ usb.c 28 Feb 2006 02:10:46 -0000 @@ -961,6 +961,7 @@ usb_cold_explore(void *arg) { struct usb_softc *sc; + int s; KASSERT(cold || TAILQ_EMPTY(&usb_coldexplist), ("usb_cold_explore: busses to explore when !cold")); @@ -968,15 +969,17 @@ sc = TAILQ_FIRST(&usb_coldexplist); TAILQ_REMOVE(&usb_coldexplist, sc, sc_coldexplist); -/* sc->sc_bus->use_polling++; */ + s = splusb(); + sc->sc_bus->use_polling++; sc->sc_port.device->hub->explore(sc->sc_bus->root_hub); -/* sc->sc_bus->use_polling--; */ + sc->sc_bus->use_polling--; + splx(s); } } DRIVER_MODULE(usb, ohci, usb_driver, usb_devclass, 0, 0); DRIVER_MODULE(usb, uhci, usb_driver, usb_devclass, 0, 0); DRIVER_MODULE(usb, ehci, usb_driver, usb_devclass, 0, 0); -SYSINIT(usb_cold_explore, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_FIRST, +SYSINIT(usb_cold_explore, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, usb_cold_explore, NULL); #endif