1. 22 8月, 2008 1 次提交
    • A
      USB: automatically enable RHSC interrupts · b5fb454f
      Alan Stern 提交于
      This patch (as1069c) changes the way OHCI root-hub status-change
      interrupts are enabled.  Currently a special HCD method,
      hub_irq_enable(), is called when the hub driver is finished using a
      root hub.  This approach turns out to be subject to races, resulting
      in unnecessary polling.
      
      The patch does away with the method entirely.  Instead, the driver
      automatically enables the RHSC interrupt when no more status changes
      are present.  This scheme is safe with controllers using
      level-triggered semantics for their interrupt flags.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b5fb454f
  2. 22 7月, 2008 1 次提交
  3. 07 7月, 2008 1 次提交
  4. 25 4月, 2008 5 次提交
    • A
      USB: don't explicitly reenable root-hub status interrupts · e8721549
      Alan Stern 提交于
      This patch (as1069b) changes the way OHCI root-hub status-change
      interrupts are enabled.  Currently a special HCD method,
      hub_irq_enable(), is called when the hub driver is finished using a
      root hub.  This approach turns out to be subject to races, resulting
      in unnecessary polling.
      
      The patch does away with the method entirely.  Instead, the driver
      automatically enables the RHSC interrupt when no more status changes
      are present.  This scheme is safe with controllers using
      level-triggered semantics for their interrupt flags.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e8721549
    • A
      USB: clarify usage of hcd->suspend/resume methods · 7be7d741
      Alan Stern 提交于
      The .suspend and .resume method pointers in struct usb_hcd have not
      been fully understood by host-controller driver writers.  They are
      meant for use with PCI controllers; other platform-specific drivers
      generally should not refer to them.
      
      To try and clarify matters, this patch (as1065) renames those methods
      to .pci_suspend and .pci_resume.  It eliminates corresponding dead code
      and bogus references in the ohci-ssb and u132-hcd drivers.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7be7d741
    • D
      usb: u132-hcd driver: semaphore to mutex · 50d8ca9b
      Daniel Walker 提交于
      Signed-off-by: NDaniel Walker <dwalker@mvista.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      50d8ca9b
    • D
      usb: u132-hcd driver style clean up · b40f8d39
      Daniel Walker 提交于
      I was converting a semaphore in this file to a mutex when I noticed that
      this file has some fairly rampant style problems. Practically every line
      has spaces instead of tabs .. Once I cleared that up, checkpatch.pl showed
      a number of other problem.. I think this file might be a good one to review
      for new style checks that could be added..
      
      Below are the only two remaining which I didn't remove. 
      
      #5083: FILE: drivers/usb/host/u132-hcd.c:2907:
      +               error:
      
      WARNING: labels should not be indented
      #5087: FILE: drivers/usb/host/u132-hcd.c:2911:
      +               stall:
      
      These labels are actually inside a switch statement, and they are right
      under "default:". "default:" appears to be exempt and these other label
      should be too, or default shouldn't be exempt.
      
      I also deleted a few lines due to single statements inside { } , 
      
      if (is_error()) {
      	return;
      }
      
      becomes,
      
      if (is_error())
      	return;
      
      with one line deleted.
      Signed-off-by: NDaniel Walker <dwalker@mvista.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b40f8d39
    • A
      USB: remove dev->power.power_state · 70a1c9e0
      Alan Stern 提交于
      power.power_state is scheduled for removal.  This patch (as1053)
      removes all uses of that field from drivers/usb.  Almost all of them
      were write-only, the most significant exceptions being sl811-hcd.c and
      u132-hcd.c.
      
      Part of this patch was written by Pavel Machek.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: David Brownell <david-b@pacbell.net>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      70a1c9e0
  5. 11 4月, 2008 1 次提交
  6. 24 2月, 2008 2 次提交
  7. 13 10月, 2007 6 次提交
    • M
      USB: ELAN U132 Host Controller Driver: convert sw_lock to mutex · b5b80f2b
      Matthias Kaehlcke 提交于
      The ELAN U132 Host Controller Driver uses the semaphore sw_lock as
      mutex. Use the mutex API instead of the (binary) semaphore.
      Signed-off-by: NMatthias Kaehlcke <matthias.kaehlcke@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b5b80f2b
    • A
      USB: Eliminate urb->status usage! · 4a00027d
      Alan Stern 提交于
      This patch (as979) removes the last vestiges of urb->status from the
      host controller drivers and the root-hub emulator.  Now the field
      doesn't get set until just before the URB's completion routine is
      called.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: David Brownell <david-b@pacbell.net>
      CC: Olav Kongas <ok@artecdesign.ee>
      CC: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
      CC: Tony Olech <tony.olech@elandigitalsystems.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4a00027d
    • A
      USB: add urb->unlinked field · eb231054
      Alan Stern 提交于
      This patch (as970) adds a new urb->unlinked field, which is used to
      store the status of unlinked URBs since we can't use urb->status for
      that purpose any more.  To help simplify the HCDs, usbcore will check
      urb->unlinked before calling the completion handler; if the value is
      set it will automatically override the status reported by the HCD.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: David Brownell <david-b@pacbell.net>
      CC: Olav Kongas <ok@artecdesign.ee>
      CC: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
      CC: Tony Olech <tony.olech@elandigitalsystems.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      eb231054
    • A
      USB: centralize -EREMOTEIO handling · b0d9efba
      Alan Stern 提交于
      This patch (as969) continues the ongoing changes to the way HCDs
      report URB statuses.  The programming interface has been simplified by
      making usbcore responsible for clearing urb->hcpriv and for setting
      -EREMOTEIO status when an URB with the URB_SHORT_NOT_OK flag ends up
      as a short transfer.
      
      By moving the work out of the HCDs, this removes a fair amount of
      repeated code.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: David Brownell <david-b@pacbell.net>
      CC: Olav Kongas <ok@artecdesign.ee>
      CC: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
      CC: Tony Olech <tony.olech@elandigitalsystems.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b0d9efba
    • A
      USB: make HCDs responsible for managing endpoint queues · e9df41c5
      Alan Stern 提交于
      This patch (as954) implements a suggestion of David Brownell's.  Now
      the host controller drivers are responsible for linking and unlinking
      URBs to/from their endpoint queues.  This eliminates the possiblity of
      strange situations where usbcore thinks an URB is linked but the HCD
      thinks it isn't.  It also means HCDs no longer have to check for URBs
      being dequeued before they were fully enqueued.
      
      In addition to the core changes, this requires changing every host
      controller driver and the root-hub URB handler.  For the most part the
      required changes are fairly small; drivers have to call
      usb_hcd_link_urb_to_ep() in their urb_enqueue method,
      usb_hcd_check_unlink_urb() in their urb_dequeue method, and
      usb_hcd_unlink_urb_from_ep() before giving URBs back.  A few HCDs make
      matters more complicated by the way they split up the flow of control.
      
      In addition some method interfaces get changed.  The endpoint argument
      for urb_enqueue is now redundant so it is removed.  The unlink status
      is required by usb_hcd_check_unlink_urb(), so it has been added to
      urb_dequeue.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: David Brownell <david-b@pacbell.net>
      CC: Olav Kongas <ok@artecdesign.ee>
      CC: Tony Olech <tony.olech@elandigitalsystems.com>
      CC: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e9df41c5
    • J
      USB: Clean up duplicate includes in drivers/usb/ · ca337db6
      Jesper Juhl 提交于
      This patch cleans up duplicate includes in
      	drivers/usb/
      Signed-off-by: NJesper Juhl <jesper.juhl@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ca337db6
  8. 23 8月, 2007 1 次提交
  9. 20 7月, 2007 1 次提交
  10. 23 5月, 2007 1 次提交
  11. 09 5月, 2007 1 次提交
  12. 21 12月, 2006 1 次提交
    • T
      USB: u132-hcd/ftdi-elan: add support for Option GT 3G Quad card · 4b87361d
      Tony Olech 提交于
      ELAN's U132 is a USB to CardBus OHCI controller adapter,
          designed specifically for CardBus 3G data cards to
          function in machines without a CardBus slot.
      The "ftdi-elan" module is a USB client driver, that detects
          a supported CardBus OHCI controller plugged into the
          U132 adapter and thereafter provides the conduit for
          for access by the "u132-hcd" module.
      The "u132-hcd" module is a (cut-down OHCI) host controller
          that supports a single OHCI function of the CardBus 
          card inserted into the U132 adapter.
      
      The problem with the initial implementation is that when
      the CardBus card inserted into the U132 adapter has multiple
      functions (and a CardBus card can support up to 4 functions),
      it was the first function that was arbitrarily choosen.
      
      The first batch of 3G cards tested, like the Merlin Qualcomm
      V620, have two functions each supporting a seperate USB OHCI
      host controller, of which it was that first function that is
      wired up to the 3G modem.
      
      Then along comes the Vodafone Mobile Connect 3G/GPRS data card,
      aka "Option GT 3G Quad" as printed on it's rear or "Option N.V.
      GlobeTrotter Fusion Quad Lite" as read with "lspci -v". And it
      has the meaningful functionality in the second CardBus function.
      
      That presents a problem because it was the "ftdi-elan" module
      alone that knows how to communicate to the embedded CardBus slot
      and the "u132-hcd" module alone that knows how to access the
      pcmcia configuration and CardBus accessible memory space. And
      of course, the information about attached (internally hardwired)
      devices is contained within USB configuration embedded somewhere
      within the CardBus card.
      
      If only the "u132-hcd" module probe() interface could return a
      result code that propagated back to the instigating function
      platform_device_register() then the "ftdi-elan" module could
      try an alternative CardBus function.     However in spite of
      the recent changes to the drivers/base/ routines that moved 
      device_attach() from bus_add_device() to bus_attach_device()
      both of those routines lose the "failed to attach" 0 result
      code and thus the calling routine, namely device_add() is
      incapable of propaging the "failed to attach" condition back
      to platform_device_add() and consequently back to the caller
      of platform_device_register()
      
      Experiments show that patching bus_attach_device() to return
      ENODEV fails with the kernel locking up very early during
      boot. But, however, if the patch is restricted to calls from
      platform_device_add() then it does seem to work.
      
      Unfortunately, until the kernel's drivers/base is properly
      modified to propagate -ENODEV back to the caller of
      platform_device_register(), it is necessary to "fix" the
      "ftdi-elan" module by importing knowledge from the 
      "u132-hcd" module. This is the reason for the duplicated
      functionality introduced in this patch.
      Signed-off-by: NTony Olech <tony.olech@elandigitalsystems.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4b87361d
  13. 02 12月, 2006 2 次提交
  14. 30 11月, 2006 1 次提交
  15. 22 11月, 2006 1 次提交
  16. 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
  17. 04 10月, 2006 1 次提交
  18. 28 9月, 2006 1 次提交
    • T
      USB: u132-hcd: host controller driver for ELAN U132 adapter · d774efea
      Tony Olech 提交于
      This "u132-hcd" module is one half of the "driver" for
      ELAN's U132 which is a USB to CardBus OHCI controller
      adapter. This module needs the "ftdi-elan" module in
      order to communicate to CardBus OHCI controller inserted
      into the U132 adapter.
      
      When the "ftdi-elan" module detects a supported CardBus
      OHCI controller in the U132 adapter it loads this "u132-hcd"
      module.
      
      Upon a successful device probe() the single workqueue
      is started up which does all the processing of commands
      from the USB core that implement the host controller.
      
      The workqueue maintains the urb queues and issues commands
      via the functions exported by the "ftdi-elan" module. Each
      such command will result in a callback.
      
      Note that the "ftdi-elan" module is a USB client driver.
      
      Note that this "u132-hcd" module is a (cut-down OHCI)
      host controller.
      
      Thus we have a topology with the parent of a host controller
      being a USB client! This really stresses the USB subsystem
      semaphore/mutex handling in the module removal.
      Signed-off-by: NTony Olech <tony.olech@elandigitalsystems.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d774efea