From owner-freebsd-usb@freebsd.org Mon Nov 2 12:22:28 2015 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 CC81AA246EA for ; Mon, 2 Nov 2015 12:22:28 +0000 (UTC) (envelope-from sebastian.huber@embedded-brains.de) Received: from mail.embedded-brains.de (host-82-135-62-35.customer.m-online.net [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 7BF331195 for ; Mon, 2 Nov 2015 12:22:27 +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 A5E8F2A181A; Mon, 2 Nov 2015 13:23:02 +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 qCu504VXYRsw; Mon, 2 Nov 2015 13:23:02 +0100 (CET) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 3AA5F2A1930; Mon, 2 Nov 2015 13:23:02 +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 M1ctQLF7o02W; Mon, 2 Nov 2015 13:23:02 +0100 (CET) Received: from [192.168.96.129] (unknown [192.168.96.129]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 227802A181A; Mon, 2 Nov 2015 13:23:02 +0100 (CET) Subject: Re: [PATCH] dwc_otg: Reduce interrupt load To: Hans Petter Selasky , freebsd-usb@freebsd.org References: <1446212307-4660-1-git-send-email-sebastian.huber@embedded-brains.de> <56338480.3090607@selasky.org> From: Sebastian Huber Message-ID: <5637557A.1070007@embedded-brains.de> Date: Mon, 2 Nov 2015 13:22:18 +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: <56338480.3090607@selasky.org> Content-Type: text/plain; charset=windows-1252; 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: Mon, 02 Nov 2015 12:22:28 -0000 On 30/10/15 15:53, Hans Petter Selasky wrote: > On 10/30/15 14:38, Sebastian Huber wrote: >> Tested on an Altera Cyclone V development kit. Here the controller ha= s >> 16 host channels. This change significantly reduced the time spent in >> the dwc_otg_interrupt_poll_locked() function. > > Hi, > > Thank you for your optimisation patch: > > https://svnweb.freebsd.org/changeset/base/290195 Thanks. > > > How does the DWC OTG driver from FreeBSD work with your setup?=20 After an update of the USB stack from 9.3 to current it worked out of=20 the box. Thanks a lot for your great USB stack! It seems that this driver doesn't support DMA. I see a quite high CPU=20 utilization in this area: static void dwc_otg_interrupt_poll_locked(struct dwc_otg_softc *sc) { [...] if (sc->sc_last_rx_status !=3D 0) { [...] temp =3D GRXSTSRD_BCNT_GET( sc->sc_last_rx_status); ep_no =3D GRXSTSRD_CHNUM_GET( sc->sc_last_rx_status); /* receive data, if any */ if (temp !=3D 0) { DPRINTF("Reading %d bytes from ep %d\n", temp, ep_no); bus_space_read_region_4(sc->sc_io_tag, sc->sc_io_hdl, DOTG_DFIFO(ep_no), sc->sc_rx_bounce_buffer, (temp + 3) / 4); } --=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=E4ftliche Mitteilung im Sinne des EHUG.