* USB hotplug
@ 2007-11-06 5:20 Tom
2007-11-06 22:16 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Tom @ 2007-11-06 5:20 UTC (permalink / raw)
To: linux-hotplug
I'm trying to make sure that I fully understand how the uevents sent
to userspace from the kernel occur when a device is hotplugged.
When looking through the drivers/usb/usb-skeleton.c driver, the init
function calls usb_register(), which eventually leads to
kobject_uevent(.., KOBJ_ADD) being called. However, this is just
called when the driver is loaded, and not when a device is hotplugged,
correct?
There is also a call in drivers/usb/usb-skeleton.c probe() to
usb_register_dev(). My understanding is that probe() gets called when
the USB core thinks it has a device that the driver can handle. Is
this the point at which the uevent needs to be sent to notify
userspace that a device has been hotplugged? (e.g.,
video_register_device ends up triggering a kobject_uevent call when
probe is called. However, I don't see usb_register_dev() resulting in
kobject_uevent being called.)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: USB hotplug
2007-11-06 5:20 USB hotplug Tom
@ 2007-11-06 22:16 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2007-11-06 22:16 UTC (permalink / raw)
To: linux-hotplug
On Mon, Nov 05, 2007 at 09:20:04PM -0800, Tom wrote:
> I'm trying to make sure that I fully understand how the uevents sent
> to userspace from the kernel occur when a device is hotplugged.
>
> When looking through the drivers/usb/usb-skeleton.c driver, the init
> function calls usb_register(), which eventually leads to
> kobject_uevent(.., KOBJ_ADD) being called. However, this is just
> called when the driver is loaded, and not when a device is hotplugged,
> correct?
No, you also get a hotplug call when the device is added to the system.
Run udevmonitor and plug in a device and see all of the events that you
get, and which order they come in.
> There is also a call in drivers/usb/usb-skeleton.c probe() to
> usb_register_dev(). My understanding is that probe() gets called when
> the USB core thinks it has a device that the driver can handle.
Yes.
> Is this the point at which the uevent needs to be sent to notify
> userspace that a device has been hotplugged? (e.g.,
> video_register_device ends up triggering a kobject_uevent call when
> probe is called. However, I don't see usb_register_dev() resulting in
> kobject_uevent being called.)
It happens in device_create().
thanks,
greg k-h
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-11-06 22:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-06 5:20 USB hotplug Tom
2007-11-06 22:16 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).