From owner-freebsd-usb@freebsd.org Tue Jan 5 07:07:00 2016 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC73EA6217B for ; Tue, 5 Jan 2016 07:07:00 +0000 (UTC) (envelope-from sebastian.huber@embedded-brains.de) Received: from mail.embedded-brains.de (mail.embedded-brains.de [82.135.62.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90CDD1A3A for ; Tue, 5 Jan 2016 07:07:00 +0000 (UTC) (envelope-from sebastian.huber@embedded-brains.de) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 88E972A0936 for ; Tue, 5 Jan 2016 08:00:33 +0100 (CET) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id oCXzMCNjmQfN for ; Tue, 5 Jan 2016 08:00:33 +0100 (CET) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 1B55F2A096D for ; Tue, 5 Jan 2016 08:00:33 +0100 (CET) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 2XHMV7OaECsc for ; Tue, 5 Jan 2016 08:00:33 +0100 (CET) Received: from [192.168.96.129] (unknown [192.168.96.129]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 027E32A0936 for ; Tue, 5 Jan 2016 08:00:32 +0100 (CET) To: freebsd-usb@freebsd.org From: Sebastian Huber Subject: dwc_otg: Problem with directly connected full/low speed devices Message-ID: <568B69FE.5030307@embedded-brains.de> Date: Tue, 5 Jan 2016 08:00:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 07:07:01 -0000 Hello, I use an Altera Cyclone V development kit which the dwc_otg driver from=20 FreeBSD. The device enumeration of full/low speed devices directly=20 connected to the root hub fails since split transactions are used. If I=20 connect them via a hub it works fine. I used the following hack to get=20 them working with a direct connection: diff --git a/sys/dev/usb/controller/dwc_otg.c=20 b/sys/dev/usb/controller/dwc_otg.c index 2110b94..37cca8e 100644 --- a/sys/dev/usb/controller/dwc_otg.c +++ b/sys/dev/usb/controller/dwc_otg.c @@ -3340,7 +3340,7 @@ dwc_otg_setup_standard_chain(struct usb_xfer *xfer) case USB_SPEED_FULL: case USB_SPEED_LOW: /* check if root HUB port is running High Speed = */ - if (xfer->xroot->udev->parent_hs_hub !=3D NULL) { + if (xfer->xroot->udev->parent_hs_hub !=3D NULL &&= 0) { hcsplt =3D HCSPLT_SPLTENA | (xfer->xroot->udev->hs_port_no << HCSPLT_PRTADDR_SHIFT) | I am not sure how to fix this properly. Is this a specific problem with=20 the Altera Cyclone V board or is this problem also present on other=20 boards e.g. RPI2? --=20 Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.huber@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine gesch=C3=A4ftliche Mitteilung im Sinne des EHUG= . From owner-freebsd-usb@freebsd.org Tue Jan 5 08:25:26 2016 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7FC7A560F2 for ; Tue, 5 Jan 2016 08:25:26 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7119A115D for ; Tue, 5 Jan 2016 08:25:26 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 3E6621FE022; Tue, 5 Jan 2016 09:25:23 +0100 (CET) Subject: Re: dwc_otg: Problem with directly connected full/low speed devices To: Sebastian Huber , freebsd-usb@freebsd.org References: <568B69FE.5030307@embedded-brains.de> From: Hans Petter Selasky Message-ID: <568B7E74.5080600@selasky.org> Date: Tue, 5 Jan 2016 09:27:32 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <568B69FE.5030307@embedded-brains.de> Content-Type: multipart/mixed; boundary="------------090207000504090507060103" X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 08:25:27 -0000 This is a multi-part message in MIME format. --------------090207000504090507060103 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 01/05/16 08:00, Sebastian Huber wrote: > Hello, > > I use an Altera Cyclone V development kit which the dwc_otg driver from > FreeBSD. The device enumeration of full/low speed devices directly > connected to the root hub fails since split transactions are used. If I > connect them via a hub it works fine. I used the following hack to get > them working with a direct connection: > > diff --git a/sys/dev/usb/controller/dwc_otg.c > b/sys/dev/usb/controller/dwc_otg.c > index 2110b94..37cca8e 100644 > --- a/sys/dev/usb/controller/dwc_otg.c > +++ b/sys/dev/usb/controller/dwc_otg.c > @@ -3340,7 +3340,7 @@ dwc_otg_setup_standard_chain(struct usb_xfer *xfer) > case USB_SPEED_FULL: > case USB_SPEED_LOW: > /* check if root HUB port is running High Speed */ > - if (xfer->xroot->udev->parent_hs_hub != NULL) { > + if (xfer->xroot->udev->parent_hs_hub != NULL && > 0) { > hcsplt = HCSPLT_SPLTENA | > (xfer->xroot->udev->hs_port_no << > HCSPLT_PRTADDR_SHIFT) | > > I am not sure how to fix this properly. Is this a specific problem with > the Altera Cyclone V board or is this problem also present on other > boards e.g. RPI2? > Hi, Does the attached patch solve your problem? --HPS --------------090207000504090507060103 Content-Type: text/x-patch; name="dwc_otg.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dwc_otg.c.diff" Index: dwc_otg.c =================================================================== --- dwc_otg.c (revision 293158) +++ dwc_otg.c (working copy) @@ -456,6 +456,18 @@ return (0); } +static uint8_t +dwc_otg_uses_split(struct usb_device *udev) +{ + /* + * When a LOW or FULL speed device is connected directly to + * the USB port we don't use split transactions: + */ + return (udev->speed != USB_SPEED_HIGH && + udev->parent_hs_hub != NULL && + udev->parent_hs_hub->parent_hub != NULL); +} + static void dwc_otg_update_host_frame_interval(struct dwc_otg_softc *sc) { @@ -3329,16 +3341,16 @@ else hcchar |= (td->ep_type << HCCHAR_EPTYPE_SHIFT); - if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_LOW) - hcchar |= HCCHAR_LSPDDEV; if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) hcchar |= HCCHAR_EPDIR_IN; switch (xfer->xroot->udev->speed) { + case USB_SPEED_LOW: + hcchar |= HCCHAR_LSPDDEV; + /* FALLTHROUGH */ case USB_SPEED_FULL: - case USB_SPEED_LOW: /* check if root HUB port is running High Speed */ - if (xfer->xroot->udev->parent_hs_hub != NULL) { + if (dwc_otg_uses_split(xfer->xroot->udev)) { hcsplt = HCSPLT_SPLTENA | (xfer->xroot->udev->hs_port_no << HCSPLT_PRTADDR_SHIFT) | @@ -4160,7 +4172,10 @@ framenum = DSTS_SOFFN_GET(temp); } - if (xfer->xroot->udev->parent_hs_hub != NULL) + /* + * Check if port is doing 8000 or 1000 frames per second: + */ + if (sc->sc_flags.status_high_speed) framenum /= 8; framenum &= DWC_OTG_FRAME_MASK; @@ -4837,7 +4852,7 @@ td = USB_ADD_BYTES(parm->buf, parm->size[0]); /* compute shared bandwidth resource index for TT */ - if (parm->udev->parent_hs_hub != NULL && parm->udev->speed != USB_SPEED_HIGH) { + if (dwc_otg_uses_split(parm->udev)) { if (parm->udev->parent_hs_hub->ddesc.bDeviceProtocol == UDPROTO_HSHUBMTT) td->tt_index = parm->udev->device_index; else --------------090207000504090507060103-- From owner-freebsd-usb@freebsd.org Tue Jan 5 08:40:58 2016 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7E2DA565C0 for ; Tue, 5 Jan 2016 08:40:58 +0000 (UTC) (envelope-from sebastian.huber@embedded-brains.de) Received: from mail.embedded-brains.de (mail.embedded-brains.de [82.135.62.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BAED187D for ; Tue, 5 Jan 2016 08:40:58 +0000 (UTC) (envelope-from sebastian.huber@embedded-brains.de) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 3B64C2A0936; Tue, 5 Jan 2016 09:41:14 +0100 (CET) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id QA_FJ43eLv7J; Tue, 5 Jan 2016 09:41:13 +0100 (CET) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id C44402A096D; Tue, 5 Jan 2016 09:41:13 +0100 (CET) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id XBe_YvQ8RKVG; Tue, 5 Jan 2016 09:41:13 +0100 (CET) Received: from [192.168.96.129] (unknown [192.168.96.129]) by mail.embedded-brains.de (Postfix) with ESMTPSA id A79622A0936; Tue, 5 Jan 2016 09:41:13 +0100 (CET) Subject: Re: dwc_otg: Problem with directly connected full/low speed devices To: Hans Petter Selasky , freebsd-usb@freebsd.org References: <568B69FE.5030307@embedded-brains.de> <568B7E74.5080600@selasky.org> From: Sebastian Huber Message-ID: <568B8196.7030008@embedded-brains.de> Date: Tue, 5 Jan 2016 09:40:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <568B7E74.5080600@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 08:40:58 -0000 Hello Hans Petter, On 05/01/16 09:27, Hans Petter Selasky wrote: > > Does the attached patch solve your problem?=20 yes, this patch solves the problem. Thanks for this extremely quick fix. Kind regards, Sebastian --=20 Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.huber@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine gesch=C3=A4ftliche Mitteilung im Sinne des EHUG= . From owner-freebsd-usb@freebsd.org Tue Jan 5 09:19:30 2016 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 359E0A5F6B7 for ; Tue, 5 Jan 2016 09:19:30 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 016741E47 for ; Tue, 5 Jan 2016 09:19:29 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 322251FE022; Tue, 5 Jan 2016 10:19:26 +0100 (CET) Subject: Re: dwc_otg: Problem with directly connected full/low speed devices To: Sebastian Huber , freebsd-usb@freebsd.org References: <568B69FE.5030307@embedded-brains.de> <568B7E74.5080600@selasky.org> <568B8196.7030008@embedded-brains.de> From: Hans Petter Selasky Message-ID: <568B8B1F.2000603@selasky.org> Date: Tue, 5 Jan 2016 10:21:35 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <568B8196.7030008@embedded-brains.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 09:19:30 -0000 On 01/05/16 09:40, Sebastian Huber wrote: > Hello Hans Petter, > > On 05/01/16 09:27, Hans Petter Selasky wrote: >> >> Does the attached patch solve your problem? > > yes, this patch solves the problem. Thanks for this extremely quick fix. > > Kind regards, > Sebastian > FYI: https://svnweb.freebsd.org/changeset/base/293192 --HPS From owner-freebsd-usb@freebsd.org Wed Jan 6 23:31:12 2016 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA4C9A65BDB for ; Wed, 6 Jan 2016 23:31:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6D501937 for ; Wed, 6 Jan 2016 23:31:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u06NVCBa029471 for ; Wed, 6 Jan 2016 23:31:12 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-usb@FreeBSD.org Subject: [Bug 174695] usb keeps disconnecting mouse or keyboard Date: Wed, 06 Jan 2016 23:31:13 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: leftfoot@siu.edu X-Bugzilla-Status: Closed X-Bugzilla-Resolution: Feedback Timeout X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 23:31:13 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D174695 --- Comment #6 from leftfoot@siu.edu --- Have tested with FBSD-9.3 and FBSD-10.1 Live CD. When in normal console boot mode (run level 3/5) moused is running and ther= e is no interruption as stated before. If moused is NOT running, then there are persistent console interruptions relating to a connected USB mouse. This normally only occurs now when in single user mode. However, I have found th= at if I start moused in single user mode, then the USB disconnect messages no longer occur. SO - the resolution to my problem is to make sure that moused is running al= l of the time as I have no choice with the current motherboard of using a PS/2 mouse. You may close this problem. Thanks. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-usb@freebsd.org Thu Jan 7 22:28:21 2016 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 930D3A673A1 for ; Thu, 7 Jan 2016 22:28:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 839811A5C for ; Thu, 7 Jan 2016 22:28:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u07MSLRd052635 for ; Thu, 7 Jan 2016 22:28:21 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-usb@FreeBSD.org Subject: [Bug 205232] Stalled USB transfer Date: Thu, 07 Jan 2016 22:28:21 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: juraj@lutter.sk X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 22:28:21 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D205232 --- Comment #9 from Juraj Lutter --- Situation turned in the way that I'll not be able to reproduce the problem = any soon. Toshiba G450 I possess, has gone into production with Linux on ARM :-( --=20 You are receiving this mail because: You are the assignee for the bug.=