Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jan 2019 13:17:18 +0100
From:      Hans Petter Selasky <hps@selasky.org>
To:        freebsd-usb@freebsd.org, Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
Subject:   Re: r342378: usbconfig takes 3-5 minutes to read the bus
Message-ID:  <34dfc02b-b252-9f38-a905-31a713012c6a@selasky.org>
In-Reply-To: <20190103113512.GA2547@c720-r342378>
References:  <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> <20190103094850.GA2595@c720-r342378> <076e01a2-51e7-b140-28c9-1c58d034327b@selasky.org> <20190103113512.GA2547@c720-r342378>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1/3/19 12:35 PM, Matthias Apitz wrote:
> but is doing so 3000++ times:
> 
> $ dmesg | grep 'PID 544' | wc -l
>      3441
> 
> This proc is started by devd(8)  with that devd(8) hook:
> 

Hi,

Basically pcscd is congesting the enumeration SX lock, preventing 
usbconfig from running because it tries to open the same USB device over 
and over again. I'm not sure why, but it can have something to do with 
how you start pcscd.

Can you try to use the example rules given by the pcscd packet message?

attach 100 {
         device-name "ugen[0-9]+";
         action "/usr/local/sbin/pcscd -H";
};

detach 100 {
         device-name "ugen[0-9]+";
         action "/usr/local/sbin/pcscd -H";
};

Maybe there is a bug in pcsd that it tries to open the same USB device 
over and over again if there is an libusb error? Maybe it should sleep a 
bit before trying to re-enumerate devices?

I'm CC'ing Ludovic Rousseau, in case he has any comments.

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?34dfc02b-b252-9f38-a905-31a713012c6a>