From owner-freebsd-current@freebsd.org Wed Jan 2 10:49:00 2019 Return-Path: Delivered-To: freebsd-current@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 3C3AD143E710; Wed, 2 Jan 2019 10:49:00 +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 D5C6885F16; Wed, 2 Jan 2019 10:48:58 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from [89.204.130.4] (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 1gee51-0006Mc-U3; Wed, 02 Jan 2019 11:48:56 +0100 Received: from localhost.my.domain (localhost [127.0.0.1]) by localhost.unixarea.de (8.15.2/8.14.9) with ESMTPS id x02Ams2g002743 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 2 Jan 2019 11:48:54 +0100 (CET) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.15.2/8.14.9/Submit) id x02AmrrG002742; Wed, 2 Jan 2019 11:48:53 +0100 (CET) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Wed, 2 Jan 2019 11:48:53 +0100 From: Matthias Apitz To: freebsd-current@freebsd.org, freebsd-usb@freebsd.org Subject: Re: r342378: usbconfig takes 3-5 minutes to read the bus Message-ID: <20190102104853.GA2622@c720-r342378> Reply-To: Matthias Apitz Mail-Followup-To: freebsd-current@freebsd.org, freebsd-usb@freebsd.org References: <20190101135156.GA3557@c720-r342378> <3ac801b2-899a-ee09-1398-ecab6ec7130a@selasky.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline In-Reply-To: <3ac801b2-899a-ee09-1398-ecab6ec7130a@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.130.4 X-Rspamd-Queue-Id: D5C6885F16 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[guru@unixarea.de]; HAS_XOIP(0.00)[]; HAS_XAW(0.00)[]; TO_DN_NONE(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.97)[-0.965,0]; SIGNED_PGP(-2.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[101.4.254.178.list.dnswl.org : 127.0.5.1]; RECEIVED_SPAMHAUS_PBL(0.00)[4.130.204.89.zen.spamhaus.org : 127.0.0.11]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:42730, ipnet:178.254.0.0/19, country:DE]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[unixarea.de]; AUTH_NA(1.00)[]; MIME_TRACE(0.00)[0:+,1:+]; R_SPF_NA(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; IP_SCORE(-2.92)[ip: (-8.21), ipnet: 178.254.0.0/19(-3.54), asn: 42730(-2.83), country: DE(-0.01)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 10:49:00 -0000 --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable El d=C3=ADa mi=C3=A9rcoles, enero 02, 2019 a las 09:44:06a. m. +0100, Hans = Petter Selasky escribi=C3=B3: > On 1/1/19 2:51 PM, Matthias Apitz wrote: > > Now with r342378, it works only after boot but not after withdraw/re-in= sert > > anymore. To separate the problem from GnuPG and it's software stack, I = have here some > > small tests with usbconfig(8). First usbconfig reads fine the bus, but = then > > it takes 3-5 minutes to get any results, see below. >=20 > Did you update the user-space libusb aswell? I did a complete 'make installworld' and they look updated: $ ls -l /usr/lib/libusb* -r--r--r-- 1 root wheel 573256 31 dic. 12:19 /usr/lib/libusb_p.a -r--r--r-- 1 root wheel 541506 31 dic. 12:19 /usr/lib/libusb.a lrwxr-xr-x 1 root wheel 11 31 dic. 12:33 /usr/lib/libusb.so -> libu= sb.so.3 -r--r--r-- 1 root wheel 98016 31 dic. 12:33 /usr/lib/libusb.so.3 -r--r--r-- 1 root wheel 73910 31 dic. 12:19 /usr/lib/libusbhid_p.a -r--r--r-- 1 root wheel 71390 31 dic. 12:19 /usr/lib/libusbhid.a lrwxr-xr-x 1 root wheel 14 31 dic. 12:33 /usr/lib/libusbhid.so -> l= ibusbhid.so.4 -r--r--r-- 1 root wheel 23720 31 dic. 12:33 /usr/lib/libusbhid.so.4 At boot time a process is launched by devd(8) which reads the OpenPGP card and this works fine and has the device open: $ ps ax | grep pcs 501 v0- S 0:00,22 /usr/local/sbin/pcscd --debug --foreground # lsof -p 501 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME pcscd 501 root cwd VDIR 0,113 1024 2 / pcscd 501 root rtd VDIR 0,113 1024 2 / pcscd 501 root txt VREG 0,113 121992 15279826 /usr/loca= l/sbin/pcscd pcscd 501 root txt VREG 0,113 151560 29294355 /libexec/= ld-elf.so.1 pcscd 501 root txt VREG 0,113 98016 29294906 /usr/lib/= libusb.so.3 pcscd 501 root txt VREG 0,113 27640 29294864 /usr/lib/= librt.so.1 pcscd 501 root txt VREG 0,113 135712 29293769 /lib/libt= hr.so.3 pcscd 501 root txt VREG 0,113 2063072 29294412 /lib/libc= =2Eso.7 pcscd 501 root txt VREG 0,113 135192 19033335 /usr/loca= l/lib/pcsc/drivers/ifd-ccid.bundle/Contents/FreeBSD/libccid.so pcscd 501 root 0r VCHR 0,43 0t0 43 /dev/null pcscd 501 root 1u VREG 0,113 35688824 11580 / (/dev/a= da0p2) pcscd 501 root 2u VREG 0,113 35688824 11580 / (/dev/a= da0p2) pcscd 501 root 3u VREG 0,113 35688824 11580 / (/dev/a= da0p2) pcscd 501 root 4u PIPE 0xfffff800162fd8e8 16384 ->0xfffff= 800162fda50 pcscd 501 root 5u PIPE 0xfffff800162fda50 0 ->0xfffff= 800162fd8e8 pcscd 501 root 6u unix 0xfffff800164036d0 0t0 /var/run/= pcscd/pcscd.comm pcscd 501 root 7u unix 0xfffff80016feaa38 0t0 /var/run/= pcscd/pcscd.comm pcscd 501 root 9u PIPE 0xfffff800162fd2f8 16384 ->0xfffff= 800162fd460, cnt=3D2, in=3D2 pcscd 501 root 10u PIPE 0xfffff800162fd460 0 ->0xfffff= 800162fd2f8 pcscd 501 root 11u PIPE 0xfffff800162f28e8 16384 ->0xfffff= 800162f2a50 pcscd 501 root 12u PIPE 0xfffff800162f2a50 0 ->0xfffff= 800162f28e8 pcscd 501 root 13u VCHR 0,87 0t0 87 /dev/usb/= 0.4.0 pcscd 501 root 14u VCHR 0,87 0t0 87 /dev/usb/= 0.4.0 $ gpg2 --card-status Reader ...........: Identiv uTrust 3512 SAM slot Token (55511725600891) 00 = 00 Application ID ...: D27600012401020100050000532B0000 Version ..........: 2.1 Manufacturer .....: ZeitControl Serial number ....: 0000532B Name of cardholder: Matthias Apitz =2E.. When I withdraw the OpenPGP card devd(8) hooks kill that proc and restarts a new one on card insert. But this new proc hangs.=20 The same happens when I disable the devd(8) start of this proc and start the same proc from a shell (for debugging). This hangs too. Looks like something makes the USB stack broken after the point where devd(8) can launch fine the first proc of pcscd. > Any error messages in dmesg? Nothing. Only on boot it sees the card: Jan 2 11:25:39 c720-r342378 kernel: ugen0.1: <0x8086 XHCI root HUB> at usb= us0 Jan 2 11:25:39 c720-r342378 kernel: ugen1.1: at usbu= s1 Jan 2 11:25:39 c720-r342378 kernel: ugen1.2: at usbus1 Jan 2 11:25:39 c720-r342378 kernel: ugen0.2: at = usbus0 Jan 2 11:25:39 c720-r342378 kernel: ugen0.3: at usbus0 Jan 2 11:25:39 c720-r342378 kernel: ugen0.4: at usbus0 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. --J2SCkAp4GZ/dPZZf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEXmn7rBYYViyzy/vBR8z35Hb+nREFAlwslw8ACgkQR8z35Hb+ nREDYA//UlEunH3uDlbt7/CN2sjhRs/4sk77FDRbQCMcKhKM9m344ROc1UQTWdgl 4WTEuej2i0ySQn6dwMzfovn5nLxblH7OkSM5nGI6mS5+X/K29gpZsQV4cikKQHLg 0srtcBdiYYZEoDUJAH4XJ1HILsB93J52czhG2yC4DKjvJxI4izWO5s9V9P5VDXpZ Zrzfmoc4vZ6RXkNYkr/RHvtRprF1TR42nRk4Pwr2jbyVfT3IdYECziZnY0EEXY7n 2UV043tqFVm9DfhCohtkUeYyUiTmPz/aHOnN2zcRYK4ZSaUNL3MhlOpjKZ41sSZe m3ND9rTloxcJrYpjX4aWUvU4Ib1snzBbWCeR8bi1JeOfe+Ohz65SPF+Kcao0jlQC X0EWfhWiSSKQa5zXmM6magDTkyIK6C8NGU1YpTu16yP4aCS0tNDorQfiOwQK8T+j 9nUkdIJ/64lh3+11nrPakjfbEnCUb/bPLeL6Hnjv77xfyCXKj46dB28hGUc5XM38 2Jlmm0s2IQcyu9RtHqbI9x7OCFeA8lwgj/anOY9zR5Cqlf6p4Exo88v9R87FpMUO hRggkyy7WbLRq9Ygag0mOoxb7K3dI3Hdm3hojCyFvqWUdZf2iMaBp7R4WDdFEbgw jxnLdiNy7P87ifpCcIq0V0PPdzhNyLTY3rT/ETLuwPDjakf6bnk= =ck2N -----END PGP SIGNATURE----- --J2SCkAp4GZ/dPZZf--