1. 25 1月, 2008 12 次提交
  2. 01 11月, 2007 1 次提交
  3. 31 10月, 2007 1 次提交
  4. 13 10月, 2007 2 次提交
  5. 27 7月, 2007 1 次提交
  6. 19 7月, 2007 1 次提交
    • D
      dev_vdbg(), available with -DVERBOSE_DEBUG · aebdc3b4
      David Brownell 提交于
      This defines a dev_vdbg() call, which is enabled with -DVERBOSE_DEBUG.
      When enabled, dev_vdbg() acts just like dev_dbg().  When disabled, it is a
      NOP ...  just like dev_dbg() without -DDEBUG.  The specific code was moved
      out of a USB patch, but lots of drivers have similar support.
      
      That is, code can now be written to use an additional level of debug
      output, selected at compile time.  Many driver authors have found this
      idiom to be very useful.  A typical usage model is for "normal" debug
      messages to focus on fault paths and not be very "chatty", so that those
      messages can be left on during normal operation without much of a
      performance or syslog load.  On the other hand "verbose" messages would be
      noisy enough that they wouldn't normally be enabled; they might even affect
      timings enough to change system or driver behavior.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      aebdc3b4
  7. 12 7月, 2007 1 次提交
    • T
      driver-core: make devt_attr and uevent_attr static · ad6a1e1c
      Tejun Heo 提交于
      devt_attr and uevent_attr are either allocated dynamically with or
      embedded in device and class_device as they needed their owner field
      set to the module implementing the driver.  Now that sysfs implements
      immediate disconnect and owner field removed from struct attribute,
      there is no reason to do this.  Remove these attributes from
      [class_]device and use static attribute structures instead.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ad6a1e1c
  8. 09 5月, 2007 1 次提交
    • D
      fix hotplug for legacy platform drivers · 49a4ec18
      David Brownell 提交于
      We've had various reports of some legacy "probe the hardware" style
      platform drivers having nasty problems with hotplug support.
      
      The core issue is that those legacy drivers don't fully conform to the
      driver model.  They assume a role that should be the responsibility of
      infrastructure code: creating device nodes.
      
      The "modprobe" step in hotplugging relies on drivers to have split those
      roles into different modules.  The lack of this split causes the problems.
      When a driver creates nodes for devices that don't exist (sending a hotplug
      event), then exits (aborting one modprobe) before the "modprobe $MODALIAS"
      step completes (by failing, since it's in the middle of a modprobe), the
      result can be an endless loop of modprobe invocations ...  badness.
      
      This fix uses the newish per-device flag controlling issuance of "add"
      events.  (A previous version of this patch used a per-device "driver can
      hotplug" flag, which only scrubbed $MODALIAS from the environment rather
      than suppressing the entire hotplug event.) It also shrinks that flag to
      one bit, saving a word in "struct device".
      
      So the net of this patch is removing some nasty failures with legacy
      drivers, while retaining hotplug capability for the majority of platform
      drivers.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Greg KH <gregkh@suse.de>
      Cc: Andres Salomon <dilinger@debian.org>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      49a4ec18
  9. 03 5月, 2007 2 次提交
  10. 28 4月, 2007 9 次提交
    • D
      dev_dbg: check dev_dbg() arguments · 404d5b18
      Dan Williams 提交于
      Duplicate what Zach Brown did for pr_debug in commit
      8b2a1fd1
      
      [akpm@linux-foundation.org: fix a couple of things which broke]
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      404d5b18
    • A
      device_schedule_callback() needs a module reference · 523ded71
      Alan Stern 提交于
      This patch (as896b) fixes an oversight in the design of
      device_schedule_callback().  It is necessary to acquire a reference to the
      module owning the callback routine, to prevent the module from being
      unloaded before the callback can run.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Satyam Sharma <satyam.sharma@gmail.com>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      523ded71
    • D
      Driver core: add suspend() and resume() to struct device_type · f89cbc39
      Dmitry Torokhov 提交于
      Driver core: add suspend() and resume() to struct device_type
      
      In cases when there are devices of different types in the same class
      we can't use class's implementation of suspend and resume methods and
      we need to add them to struct device_type instead.
      
      Also fix error handling in resume code (we should not try to call
      class's resume method iof bus's resume method for the device failed.
      Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f89cbc39
    • G
      Driver core: remove unneeded completion from driver release path · 74e9f5fa
      Greg Kroah-Hartman 提交于
      The completion in the driver release path is due to ancient history in
      the _very_ early 2.5 days when we were not tracking the module reference
      count of attributes.  It is not needed at all and can be removed.
      
      Note, we now have an empty release function for the driver structure.
      This is due to the fact that drivers are statically allocated in the
      system at this point in time, something which I want to change in the
      future.  But remember, drivers are really code, which is reference
      counted by the module, unlike devices, which are data and _must_ be
      reference counted properly in order to work correctly.
      
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      74e9f5fa
    • C
      driver core: per-subsystem multithreaded probing · 21c7f30b
      Cornelia Huck 提交于
      Make multithreaded probing work per subsystem instead of per driver.
      
      It doesn't make much sense to probe the same device for multiple drivers in
      parallel (after all, only one driver can bind to the device).  Instead, create
      a probing thread for each device that probes the drivers one after another. 
      Also make the decision to use multi-threaded probe per bus instead of per
      device and adapt the pci code.
      Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      21c7f30b
    • K
      Driver core: add name to device_type · 414264f9
      Kay Sievers 提交于
      If "name" of a device_type is specified, the uevent will
      contain the device_type name in the DEVTYPE variable.
      This helps userspace to distingiush between different types
      of devices, belonging to the same subsystem.
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      414264f9
    • D
      driver core: Use attribute groups in struct device_type · 621a1672
      Dmitry Torokhov 提交于
      Driver core: use attribute groups in struct device_type
      
      Attribute groups are more flexible than attribute lists
      (an attribute list can be represented by anonymous group)
      so switch struct device_type to use them.
      
      Also rework attribute creation for devices so that they all
      cleaned up properly in case of errors.
      Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
      Cc: Kay Sievers <kay.sievers@novell.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      621a1672
    • K
      Driver core: udev triggered device-<>driver binding · b8c5cec2
      Kay Sievers 提交于
      We get two per-bus sysfs files:
        ls-l /sys/subsystem/usb
        drwxr-xr-x 2 root root    0 2007-02-16 16:42 devices
        drwxr-xr-x 7 root root    0 2007-02-16 14:55 drivers
        -rw-r--r-- 1 root root 4096 2007-02-16 16:42 drivers_autoprobe
        --w------- 1 root root 4096 2007-02-16 16:42 drivers_probe
      
      The flag "drivers_autoprobe" controls the behavior of the bus to bind
      devices by default, or just initialize the device and leave it alone.
      
      The command "drivers_probe" accepts a bus_id and the bus tries to bind a
      driver to this device.
      
      Systems who want to control the driver binding with udev, switch off the
      bus initiated probing:
        echo 0 > /sys/subsystem/usb/drivers_autoprobe
        echo 0 > /sys/subsystem/pcmcia/drivers_autoprobe
        ...
      
      and initiate the probing with udev rules like:
        ACTION=="add", SUBSYSTEM=="usb", ATTR{subsystem/drivers_probe}="$kernel"
        ACTION=="add", SUBSYSTEM=="pcmcia", ATTR{subsystem/drivers_probe}="$kernel"
        ...
      
      Custom driver binding can happen in earlier rules by something like:
        ACTION=="add", SUBSYSTEM=="usb", \
        ATTRS{idVendor}=="1234", ATTRS{idProduct}=="5678" \
        ATTR{subsystem/drivers/<custom-driver>/bind}="$kernel"
      
      This is intended to solve the modprobe.conf mess with "install-rules", custom
      bind/unbind-scripts and all the weird things people invented over the years.
      It should also provide the functionality "libusual" was supposed to do.
      
      With udev, one can just write a udev rule to drive all USB-disks at the
      third port of USB-hub by the "ub" driver, and everything else by
      usb-storage. One can also instruct udev to bind different wireless
      drivers to identical cards - just selected by the pcmcia slot-number, and
      whatever ...
      
      To use the mentioned rules, it needs udev version 106, to be able to
      write ATTR{}="$kernel" to sysfs files.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b8c5cec2
    • K
      driver core: fix namespace issue with devices assigned to classes · 86406245
      Kay Sievers 提交于
        - uses a kset in "struct class" to keep track of all directories
          belonging to this class
        - merges with the /sys/devices/virtual logic.
        - removes the namespace-dir if the last member of that class
          leaves the directory.
      
      There may be locking or refcounting fixes left, I stopped when it seemed
      to work with network and sound modules. :)
      
      From: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      86406245
  11. 03 4月, 2007 1 次提交
  12. 16 3月, 2007 1 次提交
    • A
      [PATCH] sysfs and driver core: add callback helper, used by SCSI and S390 · d9a9cdfb
      Alan Stern 提交于
      This patch (as868) adds a helper routine for device drivers that need
      to set up a callback to perform some action in a different process's
      context.  This is intended for use by attribute methods that want to
      unregister themselves or their parent device.  Attribute method calls
      are mutually exclusive with unregistration, so such actions cannot be
      taken directly.
      
      Two attribute methods are converted to use the new helper routine: one
      for SCSI device deletion and one for System/390 ccwgroup devices.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Hugh Dickins <hugh@veritas.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Oliver Neukum <oneukum@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d9a9cdfb
  13. 24 2月, 2007 1 次提交
  14. 18 2月, 2007 1 次提交
  15. 17 2月, 2007 1 次提交
  16. 10 2月, 2007 1 次提交
    • T
      devres: device resource management · 9ac7849e
      Tejun Heo 提交于
      Implement device resource management, in short, devres.  A device
      driver can allocate arbirary size of devres data which is associated
      with a release function.  On driver detach, release function is
      invoked on the devres data, then, devres data is freed.
      
      devreses are typed by associated release functions.  Some devreses are
      better represented by single instance of the type while others need
      multiple instances sharing the same release function.  Both usages are
      supported.
      
      devreses can be grouped using devres group such that a device driver
      can easily release acquired resources halfway through initialization
      or selectively release resources (e.g. resources for port 1 out of 4
      ports).
      
      This patch adds devres core including documentation and the following
      managed interfaces.
      
      * alloc/free	: devm_kzalloc(), devm_kzfree()
      * IO region	: devm_request_region(), devm_release_region()
      * IRQ		: devm_request_irq(), devm_free_irq()
      * DMA		: dmam_alloc_coherent(), dmam_free_coherent(),
      		  dmam_declare_coherent_memory(), dmam_pool_create(),
      		  dmam_pool_destroy()
      * PCI		: pcim_enable_device(), pcim_pin_device(), pci_is_managed()
      * iomap		: devm_ioport_map(), devm_ioport_unmap(), devm_ioremap(),
      		  devm_ioremap_nocache(), devm_iounmap(), pcim_iomap_table(),
      		  pcim_iomap(), pcim_iounmap()
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      9ac7849e
  17. 08 2月, 2007 3 次提交