1. 23 5月, 2007 1 次提交
  2. 09 5月, 2007 1 次提交
  3. 28 4月, 2007 4 次提交
    • A
      USB: add "last_busy" field for use in autosuspend · 1941044a
      Alan Stern 提交于
      This patch (as877) adds a "last_busy" field to struct usb_device, for
      use by the autosuspend framework.  Now if an autosuspend call comes at
      a time when the device isn't busy but hasn't yet been idle for long
      enough, the timer can be set to exactly the desired value.  And we
      will be ready to handle things like HID drivers, which can't maintain
      a useful usage count and must rely on the time-of-last-use to decide
      when to autosuspend.
      
      The patch also makes some related minor improvements:
      
      	Move the calls to the autosuspend condition-checking routine
      	into usb_suspend_both(), which is the only place where it
      	really matters.
      
      	If the autosuspend timer is already running, don't stop
      	and restart it.
      
      	Replace immediate returns with gotos so that the optional
      	debugging ouput won't be bypassed.
      
      	If autoresume is disabled but the device is already awake,
      	don't return an error for an autoresume call.
      
      	Don't try to autoresume a device if it isn't suspended.
      	(Yes, this undercuts the previous change -- so sue me.)
      
      	Don't duplicate existing code in the autosuspend work routine.
      
      	Fix the kerneldoc in usb_autopm_put_interface(): If an
      	autoresume call fails, the usage counter is left unchanged.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      1941044a
    • 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
    • A
      USB: separate autosuspend from external suspend · 6b157c9b
      Alan Stern 提交于
      This patch (as866) adds new entry points for external USB device
      suspend and resume requests, as opposed to internally-generated
      autosuspend or autoresume.  It also changes the existing
      remote-wakeup code paths to use the new routines, since remote wakeup
      is not the same as autoresume.
      
      As part of the change, it turns out to be necessary to do remote
      wakeup of root hubs from a workqueue.  We had been using khubd, but it
      does autoresume rather than an external resume.  Using the
      ksuspend_usb_wq workqueue for this purpose seemed a logical choice.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6b157c9b
    • 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
  4. 10 3月, 2007 2 次提交
  5. 24 2月, 2007 1 次提交
  6. 17 2月, 2007 2 次提交
  7. 08 2月, 2007 1 次提交
  8. 23 1月, 2007 1 次提交
  9. 08 12月, 2006 3 次提交
  10. 06 12月, 2006 1 次提交
  11. 02 12月, 2006 7 次提交
    • A
      usbcore: remove unused argument in autosuspend · 94fcda1f
      Alan Stern 提交于
      Thanks to several earlier patches, usb_autosuspend_device() and
      usb_autoresume_device() are never called with a second argument other
      than 1.  This patch (as819) removes the now-redundant argument.
      
      It also consolidates some common code between those two routines,
      putting it into a new subroutine called usb_autopm_do_device().  And
      it includes a sizable kerneldoc update for the affected functions.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      94fcda1f
    • A
      USB: keep count of unsuspended children · ee49fb5d
      Alan Stern 提交于
      This patch (as818b) simplifies autosuspend processing by keeping track
      of the number of unsuspended children of each USB hub.  This will
      permit us to avoid a good deal of unnecessary work all the time; we
      will no longer have to create a bunch of workqueue entries to carry
      out autosuspend requests, only to have them fail because one of the
      hub's children isn't suspended.
      
      The basic idea is simple.  There already is a usage counter in the
      usb_device structure for preventing autosuspends.  The patch just
      increments that counter for every unsuspended child.  There's only one
      tricky part: When a device disconnects we need to remember whether it
      was suspended at the time (leave the counter alone) or not (decrement
      the counter).
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ee49fb5d
    • A
      USB hub: simplify remote-wakeup handling · d25450c6
      Alan Stern 提交于
      This patch (as817) simplifies the remote-wakeup processing in the hub
      driver.  Now instead of using a specialized code path, it relies on
      the standard USB resume routines.  The hub_port_resume() function does
      an initial get_port_status() to see whether the port has already
      resumed itself (as it does when a remote-wakeup request is sent).
      This will slow down handling of other resume events slightly, but not
      enough to matter.
      
      The patch also changes the hub_port_status() routine, making it return
      an error if a short reply is received.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d25450c6
    • A
      USB: Add autosuspend support to the hub driver · 40f122f3
      Alan Stern 提交于
      This patch (as742b) adds autosuspend/autoresume support to the USB hub
      driver.  The largest aspect of the change is that we no longer need a
      special flag for root hubs that want to be resumed.  Now every hub is
      autoresumed whenever khubd needs to access it.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      40f122f3
    • G
      USB: create a new thread for every USB device found during the probe sequence · c066475e
      Greg Kroah-Hartman 提交于
      Might speed up some systems.  If nothing else, a bad driver should not
      take the whole USB subsystem down with it.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c066475e
    • A
      USB: Move private hub declarations out of public header file · 1bb5f66b
      Alan Stern 提交于
      This patch (as809b) moves the declaration of the hub driver's private
      data structure from hub.h into the hub.c source file.  Lots of other
      files import hub.h; they have no need to know about the details of the
      hub driver's private data.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1bb5f66b
    • I
      usb hub: fix root hub code so it takes more than 15 devices per root hub · 88fafff9
      inaky@linux.intel.com 提交于
      Wireless USB Host Controllers accept a large number of devices per
      host, which shows up as a large number of ports in its root hub.
      
      When the number of ports in a hub device goes over 16, the activation
      of the hub fails with the cryptic message in klogd.
      
      hub 2-0:1.0: activate --> -22
      
      Following this further, it was seen that:
      
      hub_probe()
        hub_configure()
          generates pipe number
      
          pseudo allocates buffer 'maxp' bytes in size using usb_maxpacket()
      
            The endpoint descriptor for a root hub interrupt endpoint is
            declared in
            drivers/usb/core/hcd.c:hs_rh_config_descriptor and declares it
            to be size two (supporting 15 devices max).
      
          hub_activate()
            usb_hcd_submit_urb()
              rh_urb_enqueue()
                urb->pipe is neither int nor ctl, so it errors out
                  rh_queue_status()
                    Returns -EINVAL because the buffer length is smaller
                    than the minimum needed to report all the hub port
                    bits as in accordance with USB2.0[11.12.3]. There has
                    to be trunc((PORTS + 1 + 7) / 8) bytes of space at
                    least.
      
      Alan Stern confirmed that the reason for reading maxpktsize and not
      the right amount is because some hubs are known to return more data
      and thus cause overflow. 
      
      So this patch simply changes the code to make the interrupt endpoint's
      max packet size be at least the minimum required by USB_MAXCHILDREN
      (instead of a fixed magic number) and add documentation for that. This
      way we are always ahead of the limit.
      Signed-off-by: NInaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      88fafff9
  12. 22 11月, 2006 1 次提交
  13. 04 11月, 2006 1 次提交
  14. 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
  15. 29 9月, 2006 1 次提交
  16. 28 9月, 2006 12 次提交