From owner-freebsd-usb@freebsd.org Thu Jan 3 09:49:02 2019 Return-Path: Delivered-To: freebsd-usb@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 770171422E2D for ; Thu, 3 Jan 2019 09:49:02 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms-10.1blu.de (ms-10.1blu.de [178.254.4.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 247076D2A1 for ; Thu, 3 Jan 2019 09:49:01 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from [89.204.135.249] (helo=localhost.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2) (envelope-from ) id 1gezcX-000871-J4; Thu, 03 Jan 2019 10:48:58 +0100 Received: from localhost.my.domain (localhost [127.0.0.1]) by localhost.unixarea.de (8.15.2/8.14.9) with ESMTPS id x039mqhE002675 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 3 Jan 2019 10:48:52 +0100 (CET) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.15.2/8.14.9/Submit) id x039mpd0002674; Thu, 3 Jan 2019 10:48:51 +0100 (CET) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Thu, 3 Jan 2019 10:48:50 +0100 From: Matthias Apitz To: Hans Petter Selasky Cc: freebsd-usb@freebsd.org Subject: Re: r342378: usbconfig takes 3-5 minutes to read the bus Message-ID: <20190103094850.GA2595@c720-r342378> Reply-To: Matthias Apitz Mail-Followup-To: Hans Petter Selasky , freebsd-usb@freebsd.org References: <20190101135156.GA3557@c720-r342378> <3ac801b2-899a-ee09-1398-ecab6ec7130a@selasky.org> <20190102104853.GA2622@c720-r342378> <4bf80067-8e3a-572f-c1b5-ae83b1c40c22@selasky.org> <20190102154701.GA13702@c720-r342378> <2f013cf9-b073-04fd-9932-079f86fa24b1@selasky.org> <20190103060431.GA2711@c720-r342378> <5950d771-ffa9-9325-b102-295fd092052e@selasky.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0eh6TmSyL6TZE2Uz" Content-Disposition: inline In-Reply-To: <5950d771-ffa9-9325-b102-295fd092052e@selasky.org> X-Operating-System: FreeBSD 13.0-CURRENT r342378 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. User-Agent: Mutt/1.11.1 (2018-12-01) X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 89.204.135.249 X-Rspamd-Queue-Id: 247076D2A1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.86 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[guru@unixarea.de]; HAS_XOIP(0.00)[]; TO_DN_SOME(0.00)[]; IP_SCORE(-3.23)[ip: (-8.81), ipnet: 178.254.0.0/19(-4.06), asn: 42730(-3.25), country: DE(-0.01)]; HAS_ATTACHMENT(0.00)[]; HAS_XAW(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mail.unixarea.de]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.92)[-0.923,0]; SIGNED_PGP(-2.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[249.135.204.89.zen.spamhaus.org : 127.0.0.11]; RCVD_IN_DNSWL_LOW(-0.10)[101.4.254.178.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:42730, ipnet:178.254.0.0/19, country:DE]; MIME_UNKNOWN(0.10)[application/x-troff]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~]; DMARC_NA(0.00)[unixarea.de]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_LAST(0.00)[] X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2019 09:49:02 -0000 --0eh6TmSyL6TZE2Uz Content-Type: multipart/mixed; boundary="fdj2RfSjLxBAspz7" Content-Disposition: inline --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable El d=C3=ADa jueves, enero 03, 2019 a las 09:31:53a. m. +0100, Hans Petter S= elasky escribi=C3=B3: > On 1/3/19 7:04 AM, Matthias Apitz wrote: > > I think, we should isolate the problem from PCSC and focus (first) on t= he > > question why are calls to usbconfig(8) are not answered anymore > > *without* any kind of PCSC software being involved as I wrote in the > > originating email of this thread. Here it is again in case in got lost > > while talking about PCSC: >=20 > Hi, >=20 > Usually this happens if a user-space component is not closing its device= =20 > handle while enumeration happens. Can you run pcsd in the foreground=20 > with debugging enabled and show what it prints while you plug unplug the= =20 > device. >=20 > Also try setting the hw.usb.uhub.debug=3D16 sysctl and collect messages i= n=20 > dmesg. Hi, I wasn't lazy and did several tests as root: 1. booting to single user mode with the token attached: running usbconfig(8) works fine and fast; tested multiple times the cmd, no delays; 2. booting to multiuser, login as root, no KDE started, just first login as root in multiuser; devd(8) hook was moved away before booting; running 'truss -o usbconfig.tr -d usbconfig list' gives the attached output; long delays on open of the ugen0.X files: 3. re-boot again to multiuser, login as root, no KDE starting as root; again without the devd(8) hook for the card: running as root: /usr/local/sbin/pcscd --debug --foreground > pcscd.stdout gives: 00000000 pcscdaemon.c:347:main() pcscd set to foreground with debug send= to stdout 00000554 configfile.l:361:DBGetReaderList() Parsing conf file: /usr/loca= l/etc/reader.conf.d 00000062 pcscdaemon.c:662:main() pcsc-lite 1.8.23 daemon ready. no reaction on plug-in or card detach; then I killed it with Ctrl-C 77360913 pcscdaemon.c:193:signal_thread() Received signal: 2 00000063 pcscdaemon.c:226:signal_thread() Preparing for suicide 02189136 pcscdaemon.c:193:signal_thread() Received signal: 2 00639842 pcscdaemon.c:193:signal_thread() Received signal: 2 00000055 pcscdaemon.c:247:signal_thread() Forced suicide 00000020 pcscdaemon.c:785:at_exit() cleaning /var/run/pcscd 4. with devd(8) hook active, booted into multiuser the pcscd started by devd(8) works fine until detaching the card (which let devd(8) kill the running pcscd; a new started pcscd will not work anymore; This means: something during boot damages the USB stack; this must be something after devd(8) bring up pcscd (because this is still fine working). Is there a way log log any init call to libusb.so to see which process is doing something with libusb.so after devd(8) started pcscd? An option to test is deleting the devd(8) hooks for DETACH and let pcscd just continue and see if ATTACH of the card works ... matthias --=20 Matthias Apitz, =E2=9C=89 guru@unixarea.de, http://www.unixarea.de/ +49-176= -38902045 Public GnuPG key: http://www.unixarea.de/key.pub October, 7 -- The GDR was different: Peace instead of Bundeswehr and wars, = Druschba instead of Nazis, to live instead of to survive. --fdj2RfSjLxBAspz7-- --0eh6TmSyL6TZE2Uz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEXmn7rBYYViyzy/vBR8z35Hb+nREFAlwt2n8ACgkQR8z35Hb+ nRG9jA//ehpKbPABPl2KrxN6WlFWnD7Sichf1lTwYfHBcQMPYlgmtbUYg5Yk0DMG ZC3xD47EqN47FNDJt6BsICOtgj6hIxS2SuvdXAjlhmlRsqVRBAg7HXo6pkDF+xwD QDrOVan8E+/yIYwQsOi3n5rHUNW3KqFZtKCQH635nQH7myzzt9gKzHuu0HMtuN6M QfYUq9HVk8V2Oo40fTOUYQk9qFRGrSnCuOAmJPihFekAJoCurmfJcZRU4/3H747s xF3ETNe4zdtC+6xjVd0Mo5i4nBlFwNHxXOj+NRwxXw4aDIOwYoXFfkgjugfBxOMn BF7gfZhcPE2ypzXvcCUUQ3MhP0TzWNgzBjPwA8SxlzVcu8YspPS08idvjdSJc/h9 NxwhkGfGWVoGCBLqjMT4Z3vqfuzddkqaSXKZupzGpLrooydJFFjD468RQmcV6ken qxsiqbnAh2/StNvcJ8B2QDdJdGdvCLT+TJfBdkJM1X812Z4NM9sxrb51eUduhYrX leZb89Mi+AYi0BfyaguVSeDhk2jsxOtdPRqzmrnZ9hVV1mwOosUZPflN10NwFtGv MnDA2G2NUJpki5dSE919Dk0deBKrdjbCbRjEWZgYTQjBOif+Ph8BTO71ZrbPwogU jhbXUj1wujsmnp+KP3owFUg4EuJLFKWkuqtHUDZmm7oBWtv4+XI= =cEbF -----END PGP SIGNATURE----- --0eh6TmSyL6TZE2Uz--