From owner-freebsd-usb@freebsd.org Thu Jan 3 12:36:22 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 7FEDA1427F93 for ; Thu, 3 Jan 2019 12:36:22 +0000 (UTC) (envelope-from ludovic.rousseau@gmail.com) Received: from mail-it1-x12c.google.com (mail-it1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DADF72FB0 for ; Thu, 3 Jan 2019 12:36:21 +0000 (UTC) (envelope-from ludovic.rousseau@gmail.com) Received: by mail-it1-x12c.google.com with SMTP id m8so41118048itk.0 for ; Thu, 03 Jan 2019 04:36:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=5rZSj5SLjPqBAbiE6yI48xOhj/tiiabKcTvlmNZrXTY=; b=QHlm7DbwiMlYFz94MCeljGsS9MNg+PWmZANo+qkUObE4QwokyyVg/kXGa4DSzcR87L 0NXcTrbSjUzQiCLnE2Mp8IaXfOlq8CCxoEggCRNPDMJ7L90S57+iunwTPgwar/OVcpR0 0y53ibY8ddaklCsnY0OZr0hLgYnR9JUxsST3HiRF1LG7pnJjkrS3jrVcqh/UZ9IO5+JP Ej2BMpqTLvYZLuSUKfWCYER2WgLSAco4fmWJ/gD1L1CeyR5E3yu5mtlMRkvC4qF/0/D9 u8A9fZ05uHwu5Ep+MyCYVC5Q0m3qKyQET7WSAim1b4BceNYLXLrF6paNmvMOsTEdQQlM MBXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=5rZSj5SLjPqBAbiE6yI48xOhj/tiiabKcTvlmNZrXTY=; b=el0iG9pFZXn0wijOQLUzRTFYKortWMI6+WzuX9SPEurttTcVKDMRFBPL3tBcASHn1g WAqXsQo/lU8UCEgu29HIloPY8en75xttQyLqiKO1zN4M9fToM1g+IQfXrDnaWoRPWpbT jNQXdaNXJnw5+KIPn0ssc59GH9rroGMu4KZRhaZ1r3XnFDnjdA0DRZgSPT/FzEXzmwyN 4dX2wrn+DxKL4FCKFDqv9rOzAQeh4Sm3Eugbv0sOrP4QovuiCjuIns52HEdaVXrLm6/6 oAAxkyuB+4hx9SlXt56SEV9b0/EI37buBg7n1kU7CItvLIgoXvCAgoHx+pSo4kymdNWq Nxyw== X-Gm-Message-State: AA+aEWaSfQSbD7lma7IUVo578Pej722LcSN+Me62hLJDIxalDRg5vdwY BiNImS2e0UkW6N5dj17JBgCpFZFH0kU48bfJn8M8qoeA X-Google-Smtp-Source: AFSGD/VLmsYCCut9cJ/oiF+EQW6WvCAtSLbJnMT9R+FXRQIfyJci5ExM7U/Gx7xkFJAcUDjlhTRMu9AILUNXKZ77+Qw= X-Received: by 2002:a24:1dce:: with SMTP id 197mr32588976itj.154.1546518980302; Thu, 03 Jan 2019 04:36:20 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: <34dfc02b-b252-9f38-a905-31a713012c6a@selasky.org> From: Ludovic Rousseau Date: Thu, 3 Jan 2019 13:36:08 +0100 Message-ID: Subject: Re: r342378: usbconfig takes 3-5 minutes to read the bus To: Hans Petter Selasky Cc: freebsd-usb@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4DADF72FB0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=QHlm7Dbw; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of ludovicrousseau@gmail.com designates 2607:f8b0:4864:20::12c as permitted sender) smtp.mailfrom=ludovicrousseau@gmail.com X-Spamd-Result: default: False [-6.55 / 15.00]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[c.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.58)[ip: (-9.07), ipnet: 2607:f8b0::/32(-2.13), asn: 15169(-1.64), country: US(-0.08)]; 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:36:22 -0000 I hope this email will go to freebsd-usb@ since I am not a member of this l= ist. Le jeu. 3 janv. 2019 =C3=A0 13:19, Hans Petter Selasky a = =C3=A9crit : > > 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. 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 Bye --=20 Dr. Ludovic Rousseau