Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Jan 2019 16:47:01 +0100
From:      Matthias Apitz <guru@unixarea.de>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        freebsd-current@freebsd.org, freebsd-usb@freebsd.org
Subject:   Re: r342378: usbconfig takes 3-5 minutes to read the bus
Message-ID:  <20190102154701.GA13702@c720-r342378>
In-Reply-To: <4bf80067-8e3a-572f-c1b5-ae83b1c40c22@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>

next in thread | previous in thread | raw e-mail | index | archive | help
El d=C3=ADa mi=C3=A9rcoles, enero 02, 2019 a las 12:37:37p. m. +0100, Hans =
Petter Selasky escribi=C3=B3:

> > Nothing. Only on boot it sees the card:
>=20
> And you are using the latest version of pcsd ?

Yes. Compiled with all ports from December 23.

>=20
> > Jan  2 11:25:39 c720-r342378 kernel: ugen0.1: <0x8086 XHCI root HUB> at=
 usbus0
> > Jan  2 11:25:39 c720-r342378 kernel: ugen1.1: <Intel EHCI root HUB> at =
usbus1
> > Jan  2 11:25:39 c720-r342378 kernel: ugen1.2: <vendor 0x8087 product 0x=
8000> at usbus1
> > Jan  2 11:25:39 c720-r342378 kernel: ugen0.2: <SunplusIT Inc HD WebCam>=
 at usbus0
> > Jan  2 11:25:39 c720-r342378 kernel: ugen0.3: <vendor 0x0489 product 0x=
e056> at usbus0
> > Jan  2 11:25:39 c720-r342378 kernel: ugen0.4: <Identiv uTrust 3512 SAM =
slot Token> at usbus0
>=20
> There has been some changes in libusb recently .

After card removal and insert devd(8) starts a new pcsd:

Jan  2 16:39:11 c720-r342378 kernel: ugen0.4: <Identiv uTrust 3512 SAM slot=
 Token> at usbus0
Jan  2 16:39:11 c720-r342378 root[13636]: CCID uTrust, type: ATTACH, system=
: USB, subsystem: INTERFACE
Jan  2 16:39:11 c720-r342378 root[13637]: /usr/local/sbin/pcscd --debug --f=
oreground

This sits hanging on /dev/usb/1.1.0:

# lsof -p 13639
COMMAND   PID USER   FD   TYPE             DEVICE SIZE/OFF     NODE NAME
pcscd   13639 root  cwd   VDIR              0,113     1024        2 /
pcscd   13639 root  rtd   VDIR              0,113     1024        2 /
pcscd   13639 root  txt   VREG              0,113   121992 15279826 /usr/lo=
cal/sbin/pcscd
pcscd   13639 root  txt   VREG              0,113   151560 29294355 /libexe=
c/ld-elf.so.1
pcscd   13639 root  txt   VREG              0,113    98016 29294906 /usr/li=
b/libusb.so.3
pcscd   13639 root  txt   VREG              0,113    27640 29294864 /usr/li=
b/librt.so.1
pcscd   13639 root  txt   VREG              0,113   135712 29293769 /lib/li=
bthr.so.3
pcscd   13639 root  txt   VREG              0,113  2063072 29294412 /lib/li=
bc.so.7
pcscd   13639 root    0r  VCHR               0,43      0t0       43 /dev/nu=
ll
pcscd   13639 root    1u  VCHR               0,43      0t0       43 /dev/nu=
ll
pcscd   13639 root    2u  VCHR               0,43      0t0       43 /dev/nu=
ll
pcscd   13639 root    3u  unix 0xfffff800609ff6d0      0t0          ->0xfff=
ff800163fa368
pcscd   13639 root    4u  PIPE 0xfffff8004f13c2f8    16384          ->0xfff=
ff8004f13c460
pcscd   13639 root    5u  PIPE 0xfffff8004f13c460        0          ->0xfff=
ff8004f13c2f8
pcscd   13639 root    6u  unix 0xfffff80072b03a38      0t0          /var/ru=
n/pcscd/pcscd.comm
pcscd   13639 root    7u  PIPE 0xfffff8004e5422f8    16384          ->0xfff=
ff8004e542460
pcscd   13639 root    8u  PIPE 0xfffff8004e542460        0          ->0xfff=
ff8004e5422f8
pcscd   13639 root    9u  PIPE 0xfffff8004e509000    16384          ->0xfff=
ff8004e509168
pcscd   13639 root   10u  PIPE 0xfffff8004e509168        0          ->0xfff=
ff8004e509000
pcscd   13639 root   11u  VCHR               0,52      0t0       52 /dev/us=
b/1.1.0
pcscd   13639 root   12u  VCHR               0,52      0t0       52 /dev/us=
b/1.1.0

(note: the older working proc had open /dev/usb/0.4.0)

> What does "procstat -ak" output. Does it hang on any "usb" functions?

# ps ax | grep pcs
13639  -  I      0:00,01 /usr/local/sbin/pcscd --debug --foreground
13967  4  S+     0:00,01 grep pcs

# procstat -k 13639
  PID    TID COMM                TDNAME              KSTACK
13639 100287 pcscd               -                   mi_switch sleepq_switc=
h sleepq_catch_signals sleepq_wait_sig _sleep pipe_read dofileread kern_rea=
dv sys_read amd64_syscall fast_syscall_common
13639 100821 pcscd               -                   mi_switch sleepq_switc=
h sleepq_catch_signals sleepq_wait_sig _sleep pipe_read dofileread kern_rea=
dv sys_read amd64_syscall fast_syscall_common
13639 100822 pcscd               -                   mi_switch sleepq_switc=
h sleepq_catch_signals sleepq_wait_sig _sx_xlock_hard _sx_xlock usbd_enum_l=
ock_sig usb_ref_device usb_open devfs_open VOP_OPEN_APV vn_open_vnode vn_op=
en_cred kern_openat amd64_syscall fast_syscall_common

	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.



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