1. 20 Nov, 2002 11 commits
    • Patrick Mochel's avatar
      driver model: update and clean bus and driver support. · 3c8d66aa
      Patrick Mochel authored
      This a multi-pronged attack aimed at exploiting the kobject infrastructure mor. 
      
      - Remove bus_driver_list, in favor of list in bus_subys.
      
      - Remove bus_for_each_* and driver_for_each_dev(). They're not being used by
      anyone, have questionable locking semantics, and really don't provide that
      much use, as the function returns once the callback fails, with no indication
      of where it failed. Forget them, at least for now. 
      
      - Make sure that we return success from bus_match() if device matches, but
      doesn't have a probe method.
      
      - Remove extraneous get_{device,driver}s from bus routines that are serialized
      by the bus's rwsem. bus_{add,remove}_{device,driver} all take the rwsem, so there 
      is no way we can get a non-existant object when in those functions.
      
      - Use the rwsem in the struct subsystem the bus has embedded in it, and kill the
      separate one in struct bus_type.
      
      - Move bulk of driver_register() into bus_add_driver(), which holds the bus's
      rwsem during the entirety. this will prevent the driver from being unloaded while
      it's being registered, and two drivers with the same name getting registered
      at the same time. 
      
      - Ditto for driver_unregister() and bus_remove_driver().
      
      - Add driver_release() method for the driver bus driver subsystems. (Explained later)
      
      - Use only the refcounts in the buses' kobjects, and kill the one in struct bus_type.
      
      - Kill struct bus_type::present and struct device_driver::present. These didn't 
      work out the way we intended them to. The idea was to not let a user obtain a 
      rerference count to the object if it was in the process of being unregistered. 
      All the code paths should be fixed now such that their registration is protected with
      a semaphore, so no partially initialized objects can be removed, and enough 
      infrastructure is moved to the kobject model so that once the object is publically
      visible, it should be usable by other sources.
      
      - Add a bus_sem to serialize bus registration and unregistration. 
      
      - Add struct device_driver::unload_sem to prevent unloading of drivers 
      with a positive reference count.
      
      The driver model has always had a bug that would allow a driver with a 
      positive reference count to be unloaded. It would decrement the reference 
      count and return, letting the module be unloaded, without accounting for 
      the other users of the object. This has been discussed many times, though 
      never resolved cleanly. This should fix the problem in the simplest manner.
      
      struct device_driver gets unload_sem, which is initialized to _locked_. When
      the reference count for the driver reaches 0, the semaphore is unlocked.
      driver_unregister() blocks on acquiring this lock before it exits. In the 
      normal case that driver_unregister() drops the last reference to the driver,
      the lock will be acquired immediately, and the module will unload. 
      
      In the case that someone else is using the driver object, driver_unregister()
      will not be able to acquire the lock, since the refcount has not reached 0,
      and the lock has not been released. 
      
      This means that rmmod(8) will block while drivers' sysfs files are open. 
      There are no sysfs files for drivers yet, but note this when they do have 
      some.
      3c8d66aa
    • Patrick Mochel's avatar
      sysfs: various updates. · 1b867c36
      Patrick Mochel authored
      - Don't do extra dget() when creating symlink. 
      This is a long-standing bug with a simple and obvious fix. We were doing 
      an extra dget() on the dentry after d_instantiate(). It only gets decremented
      once on removal, so the dentry was never really going away, and the directory
      wasn't, either. 
      
      - Use simple_unlink() instead of sysfs_unlink().
      
      - Use simple_rmdir() instead of our own, unrolled, version. 
      
      - Remove MODULE_LICENSE(), since it's always in the kernel. 
      1b867c36
    • Patrick Mochel's avatar
    • Patrick Mochel's avatar
      Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin · 95ca3c33
      Patrick Mochel authored
      into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-kobject
      95ca3c33
    • Patrick Mochel's avatar
      Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin · 3c31f49e
      Patrick Mochel authored
      into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-kobject
      3c31f49e
    • Ivan Kokshaysky's avatar
      [PATCH] PCI setup: misc cleanups and fixes · 37256d28
      Ivan Kokshaysky authored
      - Use PCI_BUS_NUM_RESOURCES instead of hardcoded `4' in
        pci_find_parent_resource;
      - clean up pci_claim_resource() and make it a bit more informative
        on errors;
      - pdev_sort_resources() must be __devinit, as it's called from
        pbus_assign_resources_sorted(), which is __devinit now;
      - fix one remaining dev->name in debugging printk.
      37256d28
    • Ivan Kokshaysky's avatar
      [PATCH] PCI: transparent bridge detection fix · d613ff0a
      Ivan Kokshaysky authored
      The detection of subtractive decoding bridges is broken: `class' variable
      doesn't contain ProgIf byte at this point, I should check `dev->class'
      instead.
      
      This fixes resource allocation problems on certain docking stations.
      d613ff0a
    • Andries E. Brouwer's avatar
      [PATCH] *_mknod prototype · 72c85a12
      Andries E. Brouwer authored
      The dev_t argument of sys_mknod is passed to vfs_mknod, and is then cast
      to int when foo_mknod is called, and is subsequently very often cast
      back to dev_t.  (For example, minix_mknod() calls minix_set_inode() that
      takes a dev_t.)
      
      This is a cleanup that avoids this back-and-forth casting by giving
      foo_mknod a prototype with dev_t.  In most cases now the dev_t is
      transmitted untouched until init_special_inode.
      
      It also makes the two routines hugetlbfs_get_inode() and
      shmem_get_inode() static.
      72c85a12
    • Rusty Russell's avatar
      [PATCH] Module length calculation fix and module with no init fix · 41872921
      Rusty Russell authored
      Fixes miscalculation of required module size due to alignment issues of
      first section after common, and also doesn't think that no init section
      is an allocation failure.
      41872921
    • Rusty Russell's avatar
      [PATCH] module device table restoration · 5c0f111c
      Rusty Russell authored
      Patch from Adam Richter.  I have a nicer solution based on aliases, but
      it requires coordination with USB, PCI and PCMCIA maintainers, which is
      taking time.
      
      This restores the old code in the meantime: one week without this is too
      long for people who need it.
      5c0f111c
    • Linus Torvalds's avatar
      Merge bk://ppc.bkbits.net/for-linus-ppc · 8f79cdb7
      Linus Torvalds authored
      into home.transmeta.com:/home/torvalds/v2.5/linux
      8f79cdb7
  2. 21 Nov, 2002 4 commits
  3. 20 Nov, 2002 3 commits
  4. 19 Nov, 2002 22 commits