From owner-freebsd-usb@FreeBSD.ORG Tue Sep 17 16:16:13 2013 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A8E5E144; Tue, 17 Sep 2013 16:16:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7863C2F9B; Tue, 17 Sep 2013 16:16:13 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VLxwi-000AGq-3d; Tue, 17 Sep 2013 16:16:12 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r8HGG7Bt014013; Tue, 17 Sep 2013 10:16:07 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18YTcW/y6Y+EMXalaNTWrVN Subject: Re: umcs (4-Port-USB-serial) triggering way too much ehci IRQs From: Ian Lepore To: Harald Schmalzbauer In-Reply-To: <5238775C.8010000@omnilan.de> References: <52372DBA.6020703@omnilan.de> <875323075.20130917124437@serebryakov.spb.ru> <523816E1.10603@omnilan.de> <1857258551.20130917124737@serebryakov.spb.ru> <5238198C.3070604@bitfrost.no> <52381BAC.5010801@omnilan.de> <52381FCA.5030509@bitfrost.no> <5238775C.8010000@omnilan.de> Content-Type: text/plain; charset="ISO-8859-1" Date: Tue, 17 Sep 2013 10:16:07 -0600 Message-ID: <1379434567.1197.48.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by damnhippie.dyndns.org id r8HGG7Bt014013 Cc: lev@FreeBSD.org, FreeBSD Stable , freebsd-usb@FreeBSD.org, Hans Petter Selasky X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2013 16:16:13 -0000 On Tue, 2013-09-17 at 17:38 +0200, Harald Schmalzbauer wrote: > Bez=FCglich Hans Petter Selasky's Nachricht vom 17.09.2013 11:24 > (localtime): > > On 09/17/13 11:06, Harald Schmalzbauer wrote: > >> ... > >> Shall we switch to non-list-comm? > > > > Hi, > > > > That's OK. > > > >> Hmm, in my case, this 4-port-serial-USB-hub will be used as console > >> concentrator. So most time it's doing nothing, just feeding tmux wit= h > >> consoles output. What latency are we talking about? Less than a some > >> milliseconds should be fine. > >> What I'm curious about is why my prolific USB-serial converter doesn= 't > >> generate these high irqs. > > > > Try this patch and see what happens: > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- umcs.c (revision 255492) > > +++ umcs.c (local) > > @@ -230,6 +230,7 @@ > > .bufsize =3D 0, /* use wMaxPacketSize */ > > .callback =3D &umcs7840_intr_callback, > > .if_index =3D 0, > > + .interval =3D 20, /* ms */ > > }, > > }; > > > > > > BTW: I see that the umcs driver shouldn't do synchronous control > > transfers from the USB interrupt transfer callback. This should be > > postponed into some worker thread, for example the USB explore thread. > > See USB audio driver for an example. > > > > --HPS >=20 > I tried your patch and it works as expected: IRQs decreased to ~64/s > when idle/disconnected. >=20 > One interesting thing I never measured before: > Console connection with 115k2 via umcs and 'while ( 2>1 ) echo "---..." > end' results in 8000 irqs/s :-( But that's also true for the prolific > (uplcom). The latter just goes down to 0.0 irqs/s when idle. >=20 > Doing the same with uart0 results in 1444irqs/s. > Is it by design/unavoidable that transfering the same via USB multiplie= s > by factor 5-6? >=20 > Thanks, >=20 > -Harry >=20 I don't know about that chipset, but with the FTDI chips it does xfers in 64 byte chunks and high speed bulk data results in an astronomical number of interrupts (and if you go fast enough, lost data). I have some patches that assemble lots of the little chip-size buffers into bigger xfers that the ohci/ehci controller can handle without interrupting the processor; that helps the problem a bunch. -- Ian