1. 18 10月, 2008 2 次提交
  2. 17 10月, 2008 1 次提交
  3. 22 7月, 2008 10 次提交
    • G
      device create: usb: convert device_create to device_create_drvdata · bc00bc92
      Greg Kroah-Hartman 提交于
      device_create() is race-prone, so use the race-free
      device_create_drvdata() instead as device_create() is going away.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bc00bc92
    • D
      sysfs: add /sys/dev/{char,block} to lookup sysfs path by major:minor · e105b8bf
      Dan Williams 提交于
      Why?:
      There are occasions where userspace would like to access sysfs
      attributes for a device but it may not know how sysfs has named the
      device or the path.  For example what is the sysfs path for
      /dev/disk/by-id/ata-ST3160827AS_5MT004CK?  With this change a call to
      stat(2) returns the major:minor then userspace can see that
      /sys/dev/block/8:32 links to /sys/block/sdc.
      
      What are the alternatives?:
      1/ Add an ioctl to return the path: Doable, but sysfs is meant to reduce
         the need to proliferate ioctl interfaces into the kernel, so this
         seems counter productive.
      
      2/ Use udev to create these symlinks: Also doable, but it adds a
         udev dependency to utilities that might be running in a limited
         environment like an initramfs.
      
      3/ Do a full-tree search of sysfs.
      
      [kay.sievers@vrfy.org: fix duplicate registrations]
      [kay.sievers@vrfy.org: cleanup suggestions]
      
      Cc: Neil Brown <neilb@suse.de>
      Cc: Tejun Heo <htejun@gmail.com>
      Acked-by: NKay Sievers <kay.sievers@vrfy.org>
      Reviewed-by: NSL Baur <steve@xemacs.org>
      Acked-by: NKay Sievers <kay.sievers@vrfy.org>
      Acked-by: NMark Lord <lkml@rtr.ca>
      Acked-by: NH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e105b8bf
    • D
      USB: Fix pointer/int cast in USB devio code · a80d5ff0
      David Howells 提交于
      Fix pointer/int cast in USB devio code, and thus avoid a compiler warning.
      
      A void* data argument passed to bus_find_device() and thence to match_devt()
      is used to carry a 32-bit datum.  However, casting directly between a u32 and
      a pointer is not permitted - there must be an intermediate cast via (unsigned)
      long.
      
      This was introduced by the following patch:
      
      	commit 94b1c9fa060ece2c8f080583beb6cc6008e41413
      	Author: Alan Stern <stern@rowland.harvard.edu>
      	Date:   Tue Jun 24 14:47:12 2008 -0400
      
      	    usbfs: simplify the lookup-by-minor routines
      
      	    This patch (as1105) simplifies the lookup-by-minor-number code in
      	    usbfs.  Instead of passing the minor number to the callback, which
      	    must then reconstruct the entire dev_t value, the patch passes the
      	    dev_t value directly.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a80d5ff0
    • A
      usbfs: don't store bad pointers in registration · e04199b2
      Alan Stern 提交于
      This patch (as1107) fixes a small bug in the usbfs registration and
      unregistration code.  It avoids leaving an error value stored in the
      device's usb_classdev field and it avoids trying to unregister a NULL
      pointer.  (It also fixes a rather extreme overuse of whitespace.)
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e04199b2
    • A
      usbfs: fix race between open and unregister · d64aac36
      Alan Stern 提交于
      This patch (as1106) fixes a race between opening and unregistering
      device files in usbfs.  The current code drops its reference to the
      device and then reacquires it, ignoring the possibility that the
      device structure might have been removed in the meantime.  It also
      doesn't check whether the device is already in the NOTATTACHED state
      when the file is opened.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d64aac36
    • A
      usbfs: simplify the lookup-by-minor routines · 61ad04a8
      Alan Stern 提交于
      This patch (as1105) simplifies the lookup-by-minor-number code in
      usbfs.  Instead of passing the minor number to the callback, which
      must then reconstruct the entire dev_t value, the patch passes the
      dev_t value directly.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      61ad04a8
    • A
      usbfs: send disconnect signals when device is unregistered · cd9f0375
      Alan Stern 提交于
      USB device files are accessible in two ways: as files in usbfs and as
      character device nodes.  The two paths are supposed to behave
      identically, but they don't.  When the underlying USB device is
      unplugged, disconnect signals are sent to processes with open usbfs
      files (if they requested these signals) but not to processes with open
      device node files.
      
      This patch (as1104) fixes the bug by moving the disconnect-signalling
      code into a common subroutine which is called from both paths.
      Putting this subroutine in devio.c removes the only out-of-file
      reference to struct dev_state, and so the structure's declaration can
      be moved from usb.h into devio.c.
      
      Finally, the new subroutine performs one extra action: It kills all
      the outstanding async URBs.  (I'd kill the outstanding synchronous
      URBs too, if there was any way to do it.)  In the past this hasn't
      mattered much, because devices were unregistered from usbfs only
      when they were disconnected.  But now the unregistration can also
      occur whenever devices are unbound from the usb_generic driver.  At
      any rate, killing URBs when a device is unregistered from usbfs seems
      like a good thing to do.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      cd9f0375
    • M
      USB: fix usb_reset_device and usb_reset_composite_device(take 3) · 742120c6
      Ming Lei 提交于
      This patch renames the existing usb_reset_device in hub.c to
      usb_reset_and_verify_device and renames the existing
      usb_reset_composite_device to usb_reset_device. Also the new
      usb_reset_and_verify_device does't need to be EXPORTED .
      
      The idea of the patch is that external interface driver
      should warn the other interfaces' driver of the same
      device before and after reseting the usb device. One interface
      driver shoud call _old_ usb_reset_composite_device instead of
      _old_ usb_reset_device since it can't assume the device contains
      only one interface. The _old_ usb_reset_composite_device
      is safe for single interface device also. we rename the two
      functions to make the change easily.
      
      This patch is under guideline from Alan Stern.
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      742120c6
    • M
      USB: remove interface parameter of usb_reset_composite_device · 625f6949
      Ming Lei 提交于
      From the current implementation of usb_reset_composite_device
      function, the iface parameter is no longer useful. This function
      doesn't do something special for the iface usb_interface,compared
      with other interfaces in the usb_device. So remove the parameter
      and fix the related caller.
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      625f6949
    • A
      USB: remove CVS keywords · ea05af61
      Adrian Bunk 提交于
      This patch removes CVS keywords that weren't updated for a long time
      from comments.
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ea05af61
  4. 21 6月, 2008 1 次提交
  5. 25 4月, 2008 3 次提交
  6. 02 2月, 2008 4 次提交
  7. 20 10月, 2007 1 次提交
  8. 13 10月, 2007 3 次提交
  9. 28 4月, 2007 3 次提交
    • O
      usbfs micro optimitation · 527660a8
      Oliver Neukum 提交于
      the memory barrier is needed only with smp.
      Signed-off-by: NOliver Neukum <oneukum@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      527660a8
    • K
      USB: make usbdevices export their device nodes instead of using a separate class · 9f8b17e6
      Kay Sievers 提交于
      o The "real" usb-devices export now a device node which can
        populate /dev/bus/usb.
      
      o The usb_device class is optional now and can be disabled in the
        kernel config. Major/minor of the "real" devices and class devices
        are the same.
      
      o The environment of the usb-device event contains DEVNUM and BUSNUM to
        help udev and get rid of the ugly udev rule we need for the class
        devices.
      
      o The usb-devices and usb-interfaces share the same bus, so I used
        the new "struct device_type" to let these devices identify
        themselves. This also removes the current logic of using a magic
        platform-pointer.
        The name of the device_type is also added to the environment
        which makes it easier to distinguish the different kinds of devices
        on the same subsystem.
      
        It looks like this:
          add@/devices/pci0000:00/0000:00:1d.1/usb2/2-1
          ACTION=add
          DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb2/2-1
          SUBSYSTEM=usb
          SEQNUM=1533
          MAJOR=189
          MINOR=131
          DEVTYPE=usb_device
          PRODUCT=46d/c03e/2000
          TYPE=0/0/0
          BUSNUM=002
          DEVNUM=004
      
      This udev rule works as a replacement for usb_device class devices:
        SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
          NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"
      
      Updated patch, which needs the device_type patches in Greg's tree.
      
      I also got a bugzilla assigned for this. :)
        https://bugzilla.novell.com/show_bug.cgi?id=250659Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      9f8b17e6
    • G
      USB: remove use of the bus rwsem, as it doesn't really protect anything. · 341487a8
      Greg Kroah-Hartman 提交于
      The driver core stopped using the rwsem a long time ago, yet the USB
      core still grabbed the lock, thinking it protected something.  This
      patch removes that useless use.
      
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Oliver Neukum <oneukum@suse.de>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: linux-usb-devel <linux-usb-devel@lists.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      341487a8
  10. 10 3月, 2007 1 次提交
  11. 17 2月, 2007 1 次提交
    • A
      USB: unconfigure devices which have config 0 · 3f141e2a
      Alan Stern 提交于
      Some USB devices do have a configuration 0, in contravention of the
      USB spec.  Normally 0 is supposed to indicate that a device is
      unconfigured.
      
      While we can't change what the device is doing, we can change usbcore.
      This patch (as852) allows usb_set_configuration() to accept a config
      value of -1 as indicating that the device should be unconfigured.  The
      request actually sent to the device will still contain 0 as the value.
      But even if the device does have a configuration 0, dev->actconfig
      will be set to NULL and dev->state will be set to USB_STATE_ADDRESS.
      
      Without some sort of special-case handling like this, there is no way
      to unconfigure these non-compliant devices.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3f141e2a
  12. 08 2月, 2007 2 次提交
  13. 21 12月, 2006 1 次提交
    • C
      USB: fix to usbfs_snoop logging of user defined control urbs · df251b8b
      Chris Frey 提交于
      When sending CONTROL URB's using the usual CONTROL ioctl, logging works
      fine, but when sending them via SUBMITURB, like VMWare does, the
      control fields are not logged.  This patch fixes that.
      
      I didn't see any major changes to devio.c recently, so this patch should apply
      cleanly to even the latest kernel.  I can resubmit if it doesn't.
      
      From: Chris Frey <cdfrey@foursquare.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      df251b8b
  14. 02 12月, 2006 1 次提交
  15. 18 10月, 2006 1 次提交
  16. 11 10月, 2006 1 次提交
  17. 05 10月, 2006 1 次提交
    • D
      IRQ: Maintain regs pointer globally rather than passing to IRQ handlers · 7d12e780
      David Howells 提交于
      Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
      of passing regs around manually through all ~1800 interrupt handlers in the
      Linux kernel.
      
      The regs pointer is used in few places, but it potentially costs both stack
      space and code to pass it around.  On the FRV arch, removing the regs parameter
      from all the genirq function results in a 20% speed up of the IRQ exit path
      (ie: from leaving timer_interrupt() to leaving do_IRQ()).
      
      Where appropriate, an arch may override the generic storage facility and do
      something different with the variable.  On FRV, for instance, the address is
      maintained in GR28 at all times inside the kernel as part of general exception
      handling.
      
      Having looked over the code, it appears that the parameter may be handed down
      through up to twenty or so layers of functions.  Consider a USB character
      device attached to a USB hub, attached to a USB controller that posts its
      interrupts through a cascaded auxiliary interrupt controller.  A character
      device driver may want to pass regs to the sysrq handler through the input
      layer which adds another few layers of parameter passing.
      
      I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
      main part of the code on FRV and i386, though I can't test most of the drivers.
      I've also done partial conversion for powerpc and MIPS - these at least compile
      with minimal configurations.
      
      This will affect all archs.  Mostly the changes should be relatively easy.
      Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
      
      	struct pt_regs *old_regs = set_irq_regs(regs);
      
      And put the old one back at the end:
      
      	set_irq_regs(old_regs);
      
      Don't pass regs through to generic_handle_irq() or __do_IRQ().
      
      In timer_interrupt(), this sort of change will be necessary:
      
      	-	update_process_times(user_mode(regs));
      	-	profile_tick(CPU_PROFILING, regs);
      	+	update_process_times(user_mode(get_irq_regs()));
      	+	profile_tick(CPU_PROFILING);
      
      I'd like to move update_process_times()'s use of get_irq_regs() into itself,
      except that i386, alone of the archs, uses something other than user_mode().
      
      Some notes on the interrupt handling in the drivers:
      
       (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
           the input_dev struct.
      
       (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
           something different depending on whether it's been supplied with a regs
           pointer or not.
      
       (*) Various IRQ handler function pointers have been moved to type
           irq_handler_t.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
      7d12e780
  18. 02 10月, 2006 1 次提交
  19. 28 9月, 2006 2 次提交