From owner-freebsd-current@FreeBSD.ORG Fri Aug 30 06:41:07 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F29D9791; Fri, 30 Aug 2013 06:41:06 +0000 (UTC) (envelope-from hps@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id 81B642988; Fri, 30 Aug 2013 06:41:06 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id 9BC5E7A11F; Fri, 30 Aug 2013 08:41:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id B701C8F4F2B; Fri, 30 Aug 2013 08:41:18 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ktsQxUQBBvAx; Fri, 30 Aug 2013 08:41:18 +0200 (CEST) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id C62558F4F28; Fri, 30 Aug 2013 08:41:17 +0200 (CEST) Message-ID: <52203EC9.4060808@bitfrost.no> Date: Fri, 30 Aug 2013 08:42:17 +0200 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130522 Thunderbird/17.0.6 MIME-Version: 1.0 To: "Lundberg, Johannes" Subject: Re: xhci broken on 10-CURRENT and 2013 MacBook Air? References: <521B9CD7.8010902@bitfrost.no> <521C6C26.7050207@bitfrost.no> In-Reply-To: Content-Type: multipart/mixed; boundary="------------030709090608070304030300" Cc: FreeBSD Current , "freebsd-usb@freebsd.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 30 Aug 2013 06:41:07 -0000 This is a multi-part message in MIME format. --------------030709090608070304030300 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 08/30/13 08:09, Lundberg, Johannes wrote: > What I got so far is this; > > USB driver from current stops after > xhci0: 32 byte context size > > While driver from 9.1 continues to the next step which is > usbus0 on xhci0 > xhci0: usbpf: Attached > ... > > I can try adding some printf's in the code and see if I get some more.. > Hi, There are only a few commits to the xhci driver since 9.1 was releases, so this should be easy to figure out. I'm doing a wild guess. Can you try the attached patch. It will ensure that any BIOS generated interrupts get cleared before we reset the controller. --HPS --------------030709090608070304030300 Content-Type: text/x-patch; name="xhci_irq.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xhci_irq.diff" === sys/dev/usb/controller/xhci.c ================================================================== --- sys/dev/usb/controller/xhci.c (revision 254832) +++ sys/dev/usb/controller/xhci.c (local) @@ -320,6 +320,12 @@ device_printf(sc->sc_bus.parent, "32 byte context size.\n"); } + temp = XREAD4(sc, oper, XHCI_USBSTS); + /* clear all pending interrupts */ + XWRITE4(sc, oper, XHCI_USBSTS, temp); + /* clear and disable leftover interrupts */ + XWRITE4(sc, runt, XHCI_IMAN(0), XHCI_IMAN_INTR_PEND); + /* Reset controller */ XWRITE4(sc, oper, XHCI_USBCMD, XHCI_CMD_HCRST); @@ -385,10 +391,6 @@ sc->sc_exit_lat_max = XHCI_HCS3_U1_DEL(temp) + XHCI_HCS3_U2_DEL(temp) + 250 /* us */; - temp = XREAD4(sc, oper, XHCI_USBSTS); - - /* clear interrupts */ - XWRITE4(sc, oper, XHCI_USBSTS, temp); /* disable all device notifications */ XWRITE4(sc, oper, XHCI_DNCTRL, 0); @@ -462,11 +464,8 @@ XWRITE4(sc, runt, XHCI_ERSTBA_HI(0), (uint32_t)(addr >> 32)); /* Setup interrupter registers */ + XWRITE4(sc, runt, XHCI_IMAN(0), XHCI_IMAN_INTR_ENA); - temp = XREAD4(sc, runt, XHCI_IMAN(0)); - temp |= XHCI_IMAN_INTR_ENA; - XWRITE4(sc, runt, XHCI_IMAN(0), temp); - /* setup command ring control base address */ addr = buf_res.physaddr; addr += (uintptr_t)&((struct xhci_hw_root *)0)->hwr_commands[0]; --------------030709090608070304030300--