• Patrick Mochel's avatar
    Attempt to better locking in device model core: · b1d0e423
    Patrick Mochel authored
    - remove device from driver's list on device_detach 
    - set device's driver to NULL
    - decrement reference count on driver on device_detach
    - remove devices from driver's list in driver_detach
    - use a write_lock instead of read_lock
    - don't lock around initialization of device fields
    
    - assume we have a bus in __remove_driver (we enforce this in driver_register)
    - do put_bus last in __remove_driver
    - lock bus around atomic_set in remove_driver and atomic_dec_and_test in put_driver
    - remove from bus's list while we have it locked
    b1d0e423
core.c 6.37 KB