1. 17 Oct, 2002 4 commits
    • Patrick Mochel's avatar
      driver model: introduce device_sem to protect global device list instead of device_lock. · 1e510b8f
      Patrick Mochel authored
      - device_sem is added to make the global list walks easier (for power mgmt and shutdown), so
        they don't have to take and drop device_lock a lot. 
      
      - Change list modifications to take device_sem instead of device_lock.
      
      - Ditto for device refcount modifications.
      
      - Kill get_device_locked(), as all the users are now gone. 
      1e510b8f
    • Patrick Mochel's avatar
      driver model: clean up bus_for_each_{dev,drv} · ec0a28d2
      Patrick Mochel authored
      - make sure we check what we get back from get_bus()
      - do down_read() instead of down_write(), so multiple people can do iterations
        concurrently.
      - Note that devices and drivers are removed from these while doing a down_write(), 
        so all removals will be stalled until the iterators are done.
       
      ec0a28d2
    • Patrick Mochel's avatar
      driver model: protect drivers' device list accesses with bus's rwsem. · 557aebd2
      Patrick Mochel authored
      Drivers must belong to bus, and each bus has an rwsem. Instead of mucking with
      the device_lock spinlock, and dropping it on each iteration of the loop, we take 
      the bus's lock (read, so multiple drivers can access their list at the same time)
      around the entire walk of the list.
      
      557aebd2
    • Patrick Mochel's avatar
      driver model: add struct device_driver::shutdown() method and device_present() helper. · de9d4fa4
      Patrick Mochel authored
      ->shutdown() is added to be explicitly called during reboot transitions by 
      device_shutdown(). Drivers implementing this method should use it solely to quiesce
      the device. Drivers do not have to free memory allocated by the driver, as it is 
      implied that the system is rebooting; and, they must not fuss with the reference
      counts. Devices are guaranteed not to disappear during the call, though their 
      validity may be checked using device_present().
      de9d4fa4
  2. 16 Oct, 2002 36 commits