[lkml]   [2003]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectPCI driver module unload race?

What prevents the following scenario from happening? It's purely
theoretical - I haven't seen this occuring.

- Load PCI driver.

- PCI driver registers using pci_module_init(), and adds itself to sysfs.

- Hot-plugin a PCI device which uses this driver. sysfs matches the PCI
driver, and calls the PCI drivers probe function.

- The probe function calls kmalloc or some other function which sleeps
(or gets preempted, if CONFIG_PREEMPT is enabled.)

- We switch to another thread, which happens to be rmmod for this PCI
driver. We remove the driver since it has a use count of zero.

- We switch back to the PCI driver. Oops.

I've probably missed something, but I don't think so. I suspect we need
struct device_driver to include a struct module pointer which sysfs can
take before calling any driver functions.


Russell King ( The developer of ARM Linux

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:33    [W:0.055 / U:7.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site