From owner-freebsd-usb@FreeBSD.ORG Thu Jul 17 17:13:55 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 804F21065678 for ; Thu, 17 Jul 2008 17:13:55 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe05.swip.net [212.247.154.129]) by mx1.freebsd.org (Postfix) with ESMTP id DF0A38FC1A for ; Thu, 17 Jul 2008 17:13:54 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=fmz6DLpbJQzOEhVCPt8A:9 a=PS8LhMUJt6fGw2_VtasA:7 a=fCIabgIf31BJJcT4B65siuDlf4gA:4 a=9aOQ2cSd83gA:10 a=SV7veod9ZcQA:10 a=gi0PWCVxevcA:10 Received: from [193.217.167.134] (account mc467741@c2i.net HELO [10.0.0.249]) by mailfe05.swip.net (CommuniGate Pro SMTP 5.2.4b) with ESMTPA id 909573116; Thu, 17 Jul 2008 19:13:52 +0200 From: Hans Petter Selasky To: Luoqi Chen Date: Thu, 17 Jul 2008 19:15:29 +0200 User-Agent: KMail/1.9.7 References: <0707E37B6D2E244C85660487B602C92217ABC04434@ex02.briontech.com> <200807171420.52900.hselasky@c2i.net> <0707E37B6D2E244C85660487B602C92217ABC04449@ex02.briontech.com> In-Reply-To: <0707E37B6D2E244C85660487B602C92217ABC04449@ex02.briontech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807171915.31598.hselasky@c2i.net> Cc: "freebsd-usb@freebsd.org" Subject: Re: Maintainer of usb code X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2008 17:13:55 -0000 I think your patch is Ok. It should look similar to this: /* Determine in what context we are running. */ ctl = OREAD4(sc, OHCI_CONTROL); if (ctl & OHCI_IR) { /* SMM active, request change */ DPRINTF(0, "SMM active, request owner change\n"); s = OREAD4(sc, OHCI_COMMAND_STATUS); OWRITE4(sc, OHCI_COMMAND_STATUS, s | OHCI_OCR); for (i = 0; (i < 100) && (ctl & OHCI_IR); i++) { DELAY(1000 * 1); ctl = OREAD4(sc, OHCI_CONTROL); } if ((ctl & OHCI_IR) == 0) { device_printf(sc->sc_bus.bdev, "SMM does not respond, resetting\n"); OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET); goto reset; } --HPS On Thursday 17 July 2008, Luoqi Chen wrote: > Hans, > > It probably doesn't matter, this part of code hasn't been touched > for years. I did a quick check on the latest svn version, it looked > the same. > > -lq > > > -----Original Message----- > > From: Hans Petter Selasky [mailto:hselasky@c2i.net] > > Sent: Thursday, July 17, 2008 5:21 AM > > To: freebsd-usb@freebsd.org > > Cc: Luoqi Chen > > Subject: Re: Maintainer of usb code > > > > Hi Luoqi, > > > > From what version of FreeBSD did you fetch your ohci.c ? > > > > --HPS > > > > On Thursday 17 July 2008, Luoqi Chen wrote: > > > Hello, > > > > > > Do we have an official maintainer of the usb code? I came > > > > across some quite > > > > > trivial errors while debugging another problem (which > > > > turned out not to be > > > > > usb related), please see the diff below. I'm not terribly > > > > familiar with the > > > > > usb code, so I'd like to seek someone to review this change, > > > > > > Index: ohci.c > > > =================================================================== > > > RCS file: /home/ncvs/src/sys/dev/usb/ohci.c,v > > > retrieving revision 1.170 > > > diff -u -r1.170 ohci.c > > > --- ohci.c 20 Jun 2007 05:10:52 -0000 1.170 > > > +++ ohci.c 17 Jul 2008 10:07:07 -0000 > > > @@ -815,20 +815,19 @@ > > > ohci_controller_init(ohci_softc_t *sc) > > > { > > > int i; > > > - u_int32_t s, ctl, ival, hcr, fm, per, desca; > > > + u_int32_t ctl, ival, hcr, fm, per, desca; > > > > > > /* Determine in what context we are running. */ > > > ctl = OREAD4(sc, OHCI_CONTROL); > > > if (ctl & OHCI_IR) { > > > /* SMM active, request change */ > > > DPRINTF(("ohci_init: SMM active, request > > > > owner change\n")); > > > > > - s = OREAD4(sc, OHCI_COMMAND_STATUS); > > > - OWRITE4(sc, OHCI_COMMAND_STATUS, s | OHCI_OCR); > > > + OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_OCR); > > > for (i = 0; i < 100 && (ctl & OHCI_IR); i++) { > > > usb_delay_ms(&sc->sc_bus, 1); > > > ctl = OREAD4(sc, OHCI_CONTROL); > > > } > > > - if ((ctl & OHCI_IR) == 0) { > > > + if (ctl & OHCI_IR) { > > > printf("%s: SMM does not respond, > > > > resetting\n", > > > > device_get_nameunit(sc->sc_bus.bdev)); > > > > > OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET); > > > > > > Thanks > > > -lq