From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Alexander E. Patrakov" Date: Sat, 14 Jan 2006 16:28:04 +0000 Subject: Re: cold plugging Message-Id: <43C92694.6020705@gmail.com> List-Id: References: <200601131415.30207.treeve@scarlet.be> In-Reply-To: <200601131415.30207.treeve@scarlet.be> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org (reposting from a different address, since SpamCop blacklisted the SMTP=20 server and the message sent from patrakov@ums.usu.ru didn't reach the=20 list. Sorry if you get this twice.) Kay Sievers wrote: >On Sat, Jan 14, 2006 at 06:10:48PM +0500, Alexander E. Patrakov wrote: > =20 > >>Kay Sievers wrote: >> =20 >> >>>On Sat, Jan 14, 2006 at 10:00:29AM +0500, Alexander E. Patrakov wrote: >>> =20 >>> >>>>Greg KH wrote: >>>> >>>> =20 >>>> >>>>>Why does USB take longer for you? What is taking such a long time? >>>>> >>>>> =20 >>>>> >>>>The /dev/bus/usb/... node for my Mustek Plug-N-Scan 1200 UB Plus scanne= r. >>>> =20 >>>> >>>It's the simplest way to wait for all events. Depending how you handle >>>dependencies/checkoints on bootup, it may be sudfficient if all localfs >>>devices have appeared and you can let the other events finish=20 >>>asynchronously. >>> >>> >>> =20 >>> >>Thanks, but you probably missed the point. Your loop does NOT wait for=20 >>all events. I think that in my case the following happens: >> >>1) The script creates an empty /dev/.udev/queue directory >>2) The script causes the kernel to emit uevents >>3) udevd gets those uevents, and reacts upon them. This reaction=20 >>involves, among other things, making device nodes and calling=20 >>/sbin/modprobe to load new drivers. >>4) Those drivers are bound to devices by the kernel, this produces new=20 >>uevents, go to (3). >>5) When the internal queue of udevd becomes empty, it removes the=20 >>/dev/.udev/queue directory and the loop exits. >> >>The problem is that some modules take longer than 0.1s to detect their=20 >>hardware, so there is a period of time longer than 0.1s with the empty=20 >>udevd queue, after which new uevents arrive. >> =20 >> > >Which modprobe for which module is it, that returns before events for >the devices are generated? > > =20 > Sorry, after playing with udev versions and changing rules, I lost my ability to reproduce this with my scanner alone. But this does happen when I boot with both my scanner and my MP3 player plugged in. Leaked events (i.e.: those that happen within 2 seconds after the end of the loop) are pasted at the end of this mail, so I assume that it is related with usb_storage for this report. Note that if I boot with only one of those devices, nothing leaks. UDEV_LOG=3D0 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:07.2/usb1/1-2 SUBSYSTEM=3Dusb SEQNUM=1518 PHYSDEVBUS=3Dusb PHYSDEVDRIVER=3Dusb - ------------------------------------- UDEV_LOG=3D0 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2:1.0 SUBSYSTEM=3Dusb SEQNUM=1519 PHYSDEVBUS=3Dusb DEVICE=3D/proc/bus/usb/001/003 PRODUCTA9/a002/100 TYPE=3D0/0/0 INTERFACE=3D8/6/80 MODALIAS=3Dusb:v0419pA002d0100dc00dsc00dp00ic08isc06ip50 UDEVD_EVENT=3D1 - ------------------------------------- UDEV_LOG=3D0 ACTION=ADd DEVPATH=3D/class/usb_device/usbdev1.3 SUBSYSTEM=3Dusb_device SEQNUM=1520 PHYSDEVPATH=3D/devices/pci0000:00/0000:00:07.2/usb1/1-2 PHYSDEVBUS=3Dusb PHYSDEVDRIVER=3Dusb MAJOR=189 MINOR=3D2 UDEVD_EVENT=3D1 DEVNAME=3D/dev/bus/usb/001/003 - ------------------------------------- UDEV_LOG=3D0 ACTION=ADd DEVPATH=3D/class/scsi_host/host0 SUBSYSTEM=3Dscsi_host SEQNUM=1526 PHYSDEVPATH=3D/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2:1.0/host0 UDEVD_EVENT=3D1 --=20 Alexander E. Patrakov ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dclick _______________________________________________ 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