From owner-freebsd-usb@freebsd.org Thu Jan 3 12:52:58 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 709B01429C92 for ; Thu, 3 Jan 2019 12:52:58 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE61173A89 for ; Thu, 3 Jan 2019 12:52:57 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 862CB26026A; Thu, 3 Jan 2019 13:52:55 +0100 (CET) Subject: Re: r342378: usbconfig takes 3-5 minutes to read the bus To: Ludovic Rousseau Cc: freebsd-usb@freebsd.org 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> <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> <34dfc02b-b252-9f38-a905-31a713012c6a@selasky.org> From: Hans Petter Selasky Message-ID: <4ad0bb5d-aa55-fdc0-e801-3d42b60e14e1@selasky.org> Date: Thu, 3 Jan 2019 13:50:36 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE61173A89 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-6.61 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: mail.turbocat.net]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; IP_SCORE(-3.34)[ip: (-9.52), ipnet: 88.99.0.0/16(-4.74), asn: 24940(-2.42), country: DE(-0.01)]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] 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 12:52:58 -0000 On 1/3/19 1:36 PM, Ludovic Rousseau wrote: > I hope this email will go to freebsd-usb@ since I am not a member of this list. > > Le jeu. 3 janv. 2019 à 13:19, Hans Petter Selasky a écrit : >> >> 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. > Hi Matthias, Can you try this: > You can enable pcscd hotplug debug by editing DEBUG_HOTPLUG at > https://salsa.debian.org/rousseau/PCSC/blob/master/src/hotplug_libusb.c#L69 > > A pcscd trace would be helpful. See https://pcsclite.apdu.fr/#support > --HPS