From owner-freebsd-current@FreeBSD.ORG Thu Sep 24 14:51:12 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03713106566B; Thu, 24 Sep 2009 14:51:12 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.swip.net [212.247.154.161]) by mx1.freebsd.org (Postfix) with ESMTP id 3857C8FC13; Thu, 24 Sep 2009 14:51:10 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=et49sEvzLegA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=Hxkus8EOlPmee2Otn8gA:9 a=HZPOj_pWmBhg_LoUYgYA:7 a=oAWoRoMsvHUyuSFcmq_dneDhLCoA:4 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop.adsl.tele2.no) by mailfe06.swip.net (CommuniGate Pro SMTP 5.2.16) with ESMTPA id 1305994898; Thu, 24 Sep 2009 16:51:09 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Thu, 24 Sep 2009 16:51:46 +0200 User-Agent: KMail/1.11.4 (FreeBSD/9.0-CURRENT; KDE/4.2.4; i386; ; ) References: <4ABA36B1.9070706@icyb.net.ua> In-Reply-To: <4ABA36B1.9070706@icyb.net.ua> X-Face: (%:6u[ldzJ`0qjD7sCkfdMmD*RxpOwEEQ+KWt[{J#x6ow~JO:,zwp.(t; @Aq :4:&nFCgDb8[3oIeTb^'",;u{5{}C9>"PuY\)!=#\u9SSM-nz8+SR~B\!qBv MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909241651.47850.hselasky@c2i.net> Cc: freebsd-current@freebsd.org, Andriy Gapon Subject: Re: sb600/sb700 ohci experimental patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 14:51:12 -0000 On Wednesday 23 September 2009 16:54:41 Andriy Gapon wrote: > If you have a system with SB600, SB700, etc chipset and you have problems > with low speed USB devices attached during boot (keyboard, mouse), could > you please try the following experimental patch and report back? > I am primarily interested in the first several lines produced during boot > with printfs that are introduced by the patch. Preferably in the context of > surrounding USB-related dmesg messages. No need to report subsequent > same-looking ever-repeating messages (if any). > > WARNING: this is an experimental patch, it is probably not even close to > what a real fix could be, it might not fix the problem (but perhaps it > would), it might introduce instabilities into OHCI driver and it is noisy > (unconditional printf). The primary purpose of this patch is to gather > information necessary for a real fix. > > Thank you! > > diff --git a/sys/dev/usb/controller/ohci.c b/sys/dev/usb/controller/ohci.c > index 30592c1..fb6ba34 100644 > --- a/sys/dev/usb/controller/ohci.c > +++ b/sys/dev/usb/controller/ohci.c > @@ -247,8 +249,8 @@ reset: > OWRITE4(sc, OHCI_INTERRUPT_ENABLE, sc->sc_eintrs | OHCI_MIE); > /* switch on desired functional features */ > ctl = OREAD4(sc, OHCI_CONTROL); > - ctl &= ~(OHCI_CBSR_MASK | OHCI_LES | OHCI_HCFS_MASK | OHCI_IR); > - ctl |= OHCI_PLE | OHCI_IE | OHCI_CLE | OHCI_BLE | > + ctl &= ~(OHCI_CBSR_MASK | OHCI_LES | OHCI_HCFS_MASK | OHCI_IR | OHCI_CLE > | OHCI_CLF); > + ctl |= OHCI_PLE | OHCI_IE | /*OHCI_CLE |*/ OHCI_BLE | > OHCI_RATIO_1_4 | OHCI_HCFS_OPERATIONAL; > /* And finally start it! */ > OWRITE4(sc, OHCI_CONTROL, ctl); > @@ -2727,8 +2729,17 @@ ohci_set_hw_power(struct usb_bus *bus) > temp = OREAD4(sc, OHCI_CONTROL); > temp &= ~(OHCI_PLE | OHCI_IE | OHCI_CLE | OHCI_BLE); > > - if (flags & USB_HW_POWER_CONTROL) > + if (flags & USB_HW_POWER_CONTROL) { > + struct usb_page_search buf_res; > + > + buf_res.physaddr = OREAD4(sc, OHCI_CONTROL_HEAD_ED); > + printf("(hw power) control head <= %p\n", (void*)buf_res.physaddr); > + usbd_get_page(&sc->sc_hw.ctrl_start_pc, 0, &buf_res); > + printf("(hw power) control head => %p\n", (void*)buf_res.physaddr); > + OWRITE4(sc, OHCI_CONTROL_HEAD_ED, buf_res.physaddr); > + > temp |= OHCI_CLE; > + } > > if (flags & USB_HW_POWER_BULK) > temp |= OHCI_BLE; Hi, Your patch looks good. Send me the final version when it is ready and testers report OK. I will then review and commit it. I think that if you need to reload the control head, you will also need to reload the other head list pointers? Could you check that? --HPS