Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jan 2019 10:48:50 +0100
From:      Matthias Apitz <guru@unixarea.de>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: r342378: usbconfig takes 3-5 minutes to read the bus
Message-ID:  <20190103094850.GA2595@c720-r342378>
In-Reply-To: <5950d771-ffa9-9325-b102-295fd092052e@selasky.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> <d0f569af-342f-dac8-8f6d-4fc0ff21924e@selasky.org> <20190103060431.GA2711@c720-r342378> <5950d771-ffa9-9325-b102-295fd092052e@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190103094850.GA2595>