hotpluggable device detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Suppose a PCI device is plugged onto the PCI bus, after the system is up and running.
1. How does the system come to know that a new device has been plugged? (From the hardware side, any interrupt is sent to the CPU?).
2. How does the driver for this new device gets loaded?

For point no.2, I want to print some excerpts from Alessandro Rubuni's "linux device driver" book, Chapter 15. section "Handling Hot-Pluggable Devices".
----------------
The basic idea being exploited is that whenever a new device appears during the system's lifetime, all available device drivers must check whether the new device is theirs or not. Therefore, instead of using the classic init and cleanup entry points for the driver, the hot-plug-aware device driver must register an object with the kernel, and the probe function for the object will be asked to check any device in the system to take hold of it or leave it alone. 

This approach has no downside: the usual case of a static device list is handled by scanning the device list once for each device at system boot; modularized drivers will just unload as usual if no device is there, and an external process devoted to monitoring the bus will arrange for them to be loaded if the need arises. This is exactly how the PCMCIA subsystem has always worked, and having it integrated in the kernel proper allows for more coherent handling of similar issues with different hardware environments. 
------------
The "object" Rubini is talking about must be the pci_dev structure for this device, I think. (Correct me if I'm wrong). 
Also, which is that "external process" devoted to monitoring the bus? And how does it do that? How frequently it monitors the bus and whether this "frequency" is configurable?

Please note that I'm talking about hot-pluggable devices and not those that are detected at boot-time.

I expect answers to both point no.1 and questions based on point no.2.

Thanks
suresh
-----

-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux