From owner-freebsd-current@freebsd.org Sun Jul 7 18:28:01 2019 Return-Path: Delivered-To: freebsd-current@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 35B6D15EA815 for ; Sun, 7 Jul 2019 18:28:01 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F4856BB3E; Sun, 7 Jul 2019 18:28:00 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id C754D260347; Sun, 7 Jul 2019 20:27:56 +0200 (CEST) Subject: Re: Someone broke USB From: Hans Petter Selasky To: sgk@troutmask.apl.washington.edu Cc: Ian Lepore , freebsd-current@freebsd.org, takawata@freebsd.org References: <20190706182301.GA45149@troutmask.apl.washington.edu> <770bc251-7d0f-d56f-6b86-89245b79945f@selasky.org> <20190706194124.GA45536@troutmask.apl.washington.edu> <8ccf4066-7edc-e8c3-d669-16f649ec03c2@selasky.org> <20190706210613.GA45709@troutmask.apl.washington.edu> <4d866257df0aa0a671973555b4a9a0eb27088d5c.camel@freebsd.org> <20190706231453.GA46470@troutmask.apl.washington.edu> <20190707080510.GA48223@troutmask.apl.washington.edu> <20190707165429.GA50543@troutmask.apl.washington.edu> <025dfdc1-b2d2-ef88-c2d6-32d8f3620a9d@selasky.org> Message-ID: <99a61cc8-495f-a333-b4bc-46fc929bae37@selasky.org> Date: Sun, 7 Jul 2019 20:27:18 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <025dfdc1-b2d2-ef88-c2d6-32d8f3620a9d@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 1F4856BB3E X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-5.36 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: mail.turbocat.net]; NEURAL_HAM_SHORT(-0.49)[-0.489,0]; IP_SCORE(-2.57)[ip: (-9.10), ipnet: 2a01:4f8::/29(-1.94), asn: 24940(-1.78), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2019 18:28:01 -0000 On 2019-07-07 18:58, Hans Petter Selasky wrote: > On 2019-07-07 18:54, Steve Kargl wrote: >> This a 7720 line, 262KB file, do you want me to send it >> to you in private email or put in my home directory on >> freefall (i.e.,kargl@freefall.freebsd.org). > > Send it to the people CC'ed, except the list. > Hi, I'm wondering if there is a race by default, that wee need to explore the root HUBs in a certain order? Can you try to reverse the order in usb_needs_explore_all() in sys/dev/usb and put a pause("W", hz); call between each iteration? --HPS > void > usb_needs_explore_all(void) > { > struct usb_bus *bus; > devclass_t dc; > device_t dev; > int max; > > DPRINTFN(3, "\n"); > > dc = usb_devclass_ptr; > if (dc == NULL) { > DPRINTFN(0, "no devclass\n"); > return; > } > /* > * Explore all USB buses in parallel. > */ > max = devclass_get_maxunit(dc); > while (max >= 0) { > dev = devclass_get_device(dc, max); > if (dev) { > bus = device_get_softc(dev); > if (bus) { > usb_needs_explore(bus, 1); > } > } > max--; > } > }