From owner-freebsd-hackers@freebsd.org Fri Mar 8 23:36:24 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39C0C152DF4C for ; Fri, 8 Mar 2019 23:36:24 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by mx1.freebsd.org (Postfix) with ESMTP id 2F7F891D23 for ; Fri, 8 Mar 2019 23:36:14 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from ppp118-210-135-201.adl-adc-lon-bras33.tpg.internode.on.net (HELO midget.dons.net.au) ([118.210.135.201]) by ipmail07.adl2.internode.on.net with ESMTP; 09 Mar 2019 10:00:53 +1030 Received: from midget.dons.net.au (localhost [127.0.0.1]) by midget.dons.net.au (8.15.2/8.15.2) with ESMTPS id x28NUgQt013125 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 9 Mar 2019 10:00:47 +1030 (ACDT) (envelope-from darius@dons.net.au) Received: (from mailnull@localhost) by midget.dons.net.au (8.15.2/8.15.2/Submit) id x28N8fHB094865 for ; Sat, 9 Mar 2019 09:38:41 +1030 (ACDT) (envelope-from darius@dons.net.au) X-Authentication-Warning: midget.dons.net.au: mailnull set sender to using -f Received: from [10.0.2.26] ([10.0.2.26]) by ns.dons.net.au (envelope-sender ) (MIMEDefang) with ESMTP id x28N8fq1094864; Sat, 09 Mar 2019 09:38:41 +1030 From: "O'Connor, Daniel" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Date: Sat, 9 Mar 2019 09:38:40 +1030 Subject: USB stack getting confused Message-Id: To: FreeBSD Hackers X-Mailer: Apple Mail (2.3445.102.3) X-Spam-Score: -1 () No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.1 X-Scanned-By: MIMEDefang 2.83 on 10.0.2.1 X-Rspamd-Queue-Id: 2F7F891D23 X-Spamd-Bar: +++++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [5.16 / 15.00]; MV_CASE(0.50)[]; HAS_XAW(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[midget.dons.net.au]; RCVD_NO_TLS_LAST(0.10)[]; RECEIVED_SPAMHAUS_PBL(0.00)[201.135.210.118.zen.spamhaus.org : 127.0.0.11]; RCVD_IN_DNSWL_LOW(-0.10)[131.137.101.150.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:4739, ipnet:150.101.0.0/16, country:AU]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; IP_SCORE(0.80)[ip: (2.65), ipnet: 150.101.0.0/16(1.08), asn: 4739(0.33), country: AU(-0.04)]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.97)[0.970,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(1.00)[1.000,0]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[dons.net.au]; NEURAL_SPAM_LONG(1.00)[1.000,0]; R_SPF_NA(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2019 23:36:24 -0000 Hi, I'm developing a data acquisition system on FreeBSD using a USB3 = interface (the OrangeTree ZestSC3) and I find that the USB stack appears = to 'lose' the device after a while. My program normally runs continually doing acquisitions of data for N = seconds, doing some checks and restarting. After a while (~30 1 minute = acquisitions or ~8 30 minute ones) my program can't 'see' the device (it = uses libusb10) any more (it reconnects each acquisition for $REASONS). = Also pretty weirdly usbconfig can't see it either(!). If I stop my program the device reappears in usbconfig. If I restart my = program it works. I did some GDB'ing and it appears that ugen20_enumerate (the libusb10 = interface is implemented by calling libusb20 functions) can't open = /dev/ugenX.Y and errno is 12 (ENOMEM). After digging with dtrace I have seen the open method be something = different for this device. I have also seen it where opening the device = doesn't call usb_fifo_open (not sure what it *does* call though - I see = user land call openat but haven't traced through what gets called). I'm still digging but am somewhat hopeful someone can suggest some = things to look at :) This is on 11.2 if it matters. Thanks. -- Daniel O'Connor "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum