From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Date: Sun, 08 Jun 2003 07:23:18 +0000 Subject: Re: [PATCH] queue usb hotplug events Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Sat, Jun 07, David Brownell wrote: > Olaf Hering wrote: > >Hi, > > > >there is a hardcoded sleep 3 in the usb.agent. But this is wrong, > >because the kernel runs all hotplug events at once for a new hub. The > >result is that every event still runs in parallel, just 3 seconds later. > > That "sleep" is a workaround for "uhci" and "usb-uhci" bugs: you can change that to sleep 1 or sleep 42 or sleep $largenum, they will still run in parallel. This one solves it. touch "${REMOVER}.queue.$$" sleep 3 & MAX_DELAY=$! while [ -d /proc/$MAX_DELAY ] ; do lockfiles=`ls -t /var/run/usb/*.queue.* 2>/dev/null` pid=${lockfiles##*.} test "$pid" = "$$" && { debug_mesg pid $$ proceeds ; break; } test "$lockfiles" = "" && { debug_mesg all lockfiles gone ; break; } debug_mesg wait 1 second for pid $pid sleep 0.5 done Now you have zero delay for the first event. -- USB is for mice, FireWire is for men! ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel