1. 12 12月, 2009 21 次提交
    • S
      USB: xhci: Add tests for TRB address translation. · 6648f29d
      Sarah Sharp 提交于
      It's not surprising that the transfer request buffer (TRB) physical to
      virtual address translation function has bugs in it, since I wrote most of
      it at 4am last October.  Add a test suite to check the TRB math.  This
      runs at memory initialization time, and causes the driver to fail to load
      if the TRB math fails.
      
      Please excuse the excessively long lines in the test vectors; they can't
      really be made shorter and still be readable.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6648f29d
    • D
      USB: r8a66597: clean up. remove unneeded null checks · a33279df
      Dan Carpenter 提交于
      td and dev can not be null.
      
      Also they are dereferenced in list_for_each_entry_safe and list_for_each
      before the check happens so we would have an oops if it were possible
      for them to be null.
      
      Found using the smatch static checker.
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Acked-by: NYoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a33279df
    • R
      USB: FIX bitfield istl_flip:1, make it unsigned. · 22a627ba
      Roel Kluin 提交于
      istl_flip is a signed bitfield of one bit so it can be -1 or 0.
      However in drivers/usb/host/isp1362-hcd.c:1103:
      
      finish_iso_transfers(isp1362_hcd,
      	&isp1362_hcd->istl_queue[isp1362_hcd->istl_flip]);
      
      So if isp1362_hcd->istl_flip is set, the 2nd argument becomes
      &isp1362_hcd->istl_queue[-1], which is invalid.
      Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
      Acked-by: NMike Frysinger <vapier@gentoo.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      22a627ba
    • A
      USB: EHCI: add native scatter-gather support · 40f8db8f
      Alan Stern 提交于
      This patch (as1300) adds native scatter-gather support to ehci-hcd.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      40f8db8f
    • D
      USB: Add EHCI support for MX27 and MX31 based boards · 7e8d5cd9
      Daniel Mack 提交于
      The Freescale MX27 and MX31 SoCs have a EHCI controller onboard.
      The controller is capable of USB on the go. This patch adds
      a driver to support all three of them.
      
      Users have to pass details about serial interface configuration in the
      platform data.
      
      The USB OTG core used here is the ARC core, so the driver should
      be renamed and probably be merged with ehci-fsl.c eventually.
      Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: NDaniel Mack <daniel@caiaq.de>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7e8d5cd9
    • S
      USB: ehci: Respect IST when scheduling new split iTDs. · dccd574c
      Sarah Sharp 提交于
      The EHCI specification says that an EHCI host controller may cache part of
      the isochronous schedule.  The EHCI controller must advertise how much it
      caches in the schedule through the HCCPARAMS register isochronous
      scheduling threshold (IST) bits.
      
      In theory, adding new iTDs within the IST should be harmless.  The HW will
      follow the old cached linked list and miss the new iTD.  SW will notice HW
      missed the iTD and return 0 for the transfer length.
      
      However, Intel ICH9 chipsets (and some later chipsets) have issues when SW
      attempts to schedule a split transaction within the IST.  All transfers
      will cease being sent out that port, and the drivers will see isochronous
      packets complete with a length of zero.  Start of frames may or may not
      also disappear, causing the device to go into auto-suspend.  This "bus
      stall" will continue until a control or bulk transfer is queued to a
      device under that roothub.
      
      Most drivers will never cause this behavior, because they use multiple
      URBs with multiple packets to keep the bus busy.  If you limit the number
      of URBs to one, you may be able to hit this bug.
      
      Make sure the EHCI driver does not schedule full-speed transfers within
      the IST under an Intel chipset.  Make sure that when we fall behind the
      current microframe plus IST, we schedule the new transfer at the next
      periodic interval after the IST.
      
      Don't change the scheduling for new transfers, since the schedule slop will
      always be greater than the IST.  Allow high speed isochronous transfers to
      be scheduled within the IST, since this doesn't trigger the Intel chipset
      bug.
      
      Make sure that if the host caches the full frame, the EHCI driver's
      internal isochronous threshold (ehci->i_thresh) is set to
      8 microframes + 2 microframes wiggle room.  This is similar to what is done in
      the case where the host caches less than the full frame.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Clemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      dccd574c
    • S
      USB: ehci: Minor constant fix for SCHEDULE_SLOP. · d7e055f1
      Sarah Sharp 提交于
      Change the constant SCHEDULE_SLOP to be 80 microframes, instead of 10
      frames.  It was always multiplied by 8 to convert frames to microframes.
      SCHEDULE_SLOP is only used in ehci-sched.c.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d7e055f1
    • S
      USB: xhci: Remove unused HCD statistics code. · 3c67d899
      Sarah Sharp 提交于
      CONFIG_USB_HCD_STAT was used in an abandoned patch to track host
      controller throughput statistics.  Since CONFIG_USB_HCD_STAT will never be
      defined, remove code that can never run.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3c67d899
    • S
      USB: xhci: Add watchdog timer for URB cancellation. · 6f5165cf
      Sarah Sharp 提交于
      In order to giveback a canceled URB, we must ensure that the xHCI
      hardware will not access the buffer in an URB.  We can't modify the
      buffer pointers on endpoint rings without issuing and waiting for a stop
      endpoint command.  Since URBs can be canceled in interrupt context, we
      can't wait on that command.  The old code trusted that the host
      controller would respond to the command, and would giveback the URBs in
      the event handler.  If the hardware never responds to the stop endpoint
      command, the URBs will never be completed, and we might hang the USB
      subsystem.
      
      Implement a watchdog timer that is spawned whenever a stop endpoint
      command is queued.  If a stop endpoint command event is found on the
      event ring during an interrupt, we need to stop the watchdog timer with
      del_timer().  Since del_timer() can fail if the timer is running and
      waiting on the xHCI lock, we need a way to signal to the timer that
      everything is fine and it should exit.  If we simply clear
      EP_HALT_PENDING, a new stop endpoint command could sneak in and set it
      before the watchdog timer can grab the lock.
      
      Instead we use a combination of the EP_HALT_PENDING flag and a counter
      for the number of pending stop endpoint commands
      (xhci_virt_ep->stop_cmds_pending).  If we need to cancel the watchdog
      timer and del_timer() succeeds, we decrement the number of pending stop
      endpoint commands.  If del_timer() fails, we leave the number of pending
      stop endpoint commands alone.  In either case, we clear the
      EP_HALT_PENDING flag.
      
      The timer will decrement the number of pending stop endpoint commands
      once it obtains the lock.  If the timer is the tail end of the last stop
      endpoint command (xhci_virt_ep->stop_cmds_pending == 0), and the
      endpoint's command is still pending (EP_HALT_PENDING is set), we assume
      the host is dying.  The watchdog timer will set XHCI_STATE_DYING, try to
      halt the xHCI host, and give back all pending URBs.
      
      Various other places in the driver need to check whether the xHCI host
      is dying.  If the interrupt handler ever notices, it should immediately
      stop processing events.  The URB enqueue function should also return
      -ESHUTDOWN.  The URB dequeue function should simply return the value
      of usb_hcd_check_unlink_urb() and the watchdog timer will take care of
      giving the URB back.  When a device is disconnected, the xHCI hardware
      structures should be freed without issuing a disable slot command (since
      the hardware probably won't respond to it anyway).  The debugging
      polling loop should stop polling if the host is dying.
      
      When a device is disconnected, any pending watchdog timers are killed
      with del_timer_sync().  It must be synchronous so that the watchdog
      timer doesn't attempt to access the freed endpoint structures.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6f5165cf
    • S
      USB: xhci: Re-purpose xhci_quiesce(). · 4f0f0bae
      Sarah Sharp 提交于
      xhci_quiesce() is basically a no-op right now.  It's only called if
      HC_IS_RUNNING() is true, and the body of the function consists of a
      BUG_ON if HC_IS_RUNNING() is false.  For the new xHCI watchdog timer, we
      need a new function that clears the xHCI running bit in the command
      register, but doesn't wait for the halt status to show up in the status
      register.  Re-purpose xhci_quiesce() to do that.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4f0f0bae
    • S
      USB: xhci: Handle URB cancel, complete and resubmit race. · 678539cf
      Sarah Sharp 提交于
      In the old code, there was a race condition between the stop endpoint
      command and the URB submission process.  When the stop endpoint command is
      handled by the event handler, the endpoint ring is assumed to be stopped.
      When a stop endpoint command is queued, URB submissions are to not ring
      the doorbell.  The old code would check the number of pending URBs to be
      canceled, and would not ring the doorbell if it was non-zero.
      
      However, the following race condition could occur with the old code:
      
      1. Cancel an URB, add it to the list of URBs to be canceled, queue the stop
         endpoint command, and increment ep->cancels_pending to 1.
      2. The URB finishes on the HW, and an event is enqueued to the event ring
         (at the same time as 1).
      3. The stop endpoint command finishes, and the endpoint is halted.  An
         event is queued to the event ring.
      4. The event handler sees the finished URB, notices it was to be
         canceled, decrements ep->cancels_pending to 0, and removes it from the to
         be canceled list.
      5. The event handler drops the lock and gives back the URB.  The
         completion handler requeues the URB (or a different driver enqueues a new
         URB).  This causes the endpoint's doorbell to be rung, since
         ep->cancels_pending == 0.  The endpoint is now running.
      6. A second URB is canceled, and it's added to the canceled list.
         Since ep->cancels_pending == 0, a new stop endpoint command is queued, and
         ep->cancels_pending is incremented to 1.
      7. The event handler then sees the completed stop endpoint command.  The
         handler assumes the endpoint is stopped, but it isn't.  It attempts to
         move the dequeue pointer or change TDs to cancel the second URB, while the
         hardware is actively accessing the endpoint ring.
      
      To eliminate this race condition, a new endpoint state bit is introduced,
      EP_HALT_PENDING.  When this bit is set, a stop endpoint command has been
      queued, and the command handler has not begun to process the URB
      cancellation list yet.  The endpoint doorbell should not be rung when this
      is set.  Set this when a stop endpoint command is queued, clear it when
      the handler for that command runs, and check if it's set before ringing a
      doorbell.  ep->cancels_pending is eliminated, because it is no longer
      used.
      
      Make sure to ring the doorbell for an endpoint when the stop endpoint
      command handler runs, even if the canceled URB list is empty.  All
      canceled URBs could have completed and new URBs could have been enqueued
      without the doorbell being rung before the command was handled.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      678539cf
    • F
      USB: host: ehci: introduce omap ehci-hcd driver · 54ab2b02
      Felipe Balbi 提交于
      this driver has been sitting in linux-omap tree for quite
      some time. It adds support for omap's ehci controller.
      Signed-off-by: NFelipe Balbi <felipe.balbi@nokia.com>
      Signed-off-by: NVikram Pandita <vikram.pandita@ti.com>
      Signed-off-by: NAjay Kumar Gupta <ajay.gupta@ti.com>
      Signed-off-by: NAnand Gadiyar <gadiyar@ti.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      54ab2b02
    • D
      USB: wusb: add wusb_phy_rate sysfs file to host controllers · c3f22d92
      David Vrabel 提交于
      Add the wusb_phy_rate sysfs file to Wireless USB host controllers.  This
      sets the maximum PHY rate that will be used for all connected devices.
      Signed-off-by: NDavid Vrabel <david.vrabel@csr.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c3f22d92
    • D
      usb: whci-hcd: decode more QHead fields in the debug files · d19fc291
      David Vrabel 提交于
      Print ep number, direction and type; and current window in asl and pzl
      debugfs files.
      Signed-off-by: NDavid Vrabel <david.vrabel@csr.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d19fc291
    • H
      USB: modifications for at91sam9g10 · 23f6d914
      Hong Xu 提交于
      Modify both host and gadget USB drivers for at91sam9g10.
      This add a clock management equivalent to at91sam9261 on usb drivers.
      It also add the way of handling gadget pull-ups (like the at91sam9261).
      Signed-off-by: NHong Xu <hong.xu@atmel.com>
      Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      23f6d914
    • D
      USB: whci-hcd: fix type and format warnings in sg code · f0ad073f
      David Vrabel 提交于
      Fix type and format warning in the new sg code.  Remove the very chatty
      debug messages that were left in by mistake and use min_t() as required
      (no one seems to agree on a type for buffer sizes).
      Reported-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@csr.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f0ad073f
    • D
      USB: whci-hcd: support urbs with scatter-gather lists · 294a39e7
      David Vrabel 提交于
      Support urbs with scatter-gather lists by trying to fit sg list elements
      into page lists in one or more qTDs.  qTDs must end on a wMaxPacketSize
      boundary so if this isn't possible the urb's sg list must be copied into
      bounce buffers.
      Signed-off-by: NDavid Vrabel <david.vrabel@csr.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      294a39e7
    • D
      USB: make urb scatter-gather support more generic · 4c1bd3d7
      David Vrabel 提交于
      The WHCI HCD will also support urbs with scatter-gather lists.  Add a
      usb_bus field to indicated how many sg list elements are supported by
      the HCD.  Use this to decide whether to pass the scatter-list to the HCD
      or not.
      
      Make the usb-storage driver use this new field.
      Signed-off-by: NDavid Vrabel <david.vrabel@csr.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4c1bd3d7
    • J
      USB: Add missing static markers to ohci-pnx4008 · 09ce497e
      Jean Delvare 提交于
      I can't see any reason why these would not be static.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      09ce497e
    • J
      USB: Add support for Xilinx USB host controller · 08d3c18e
      Julie Zhu 提交于
      Add bus glue driver for Xilinx USB host controller. The controller can be
      configured as HS only or HS/FS hybrid. The driver uses the device tree file
      to configure the driver according to the setting in the hardware system.
      
      This driver has been tested with usbtest using the NET2280 PCI card.
      Signed-off-by: NJulie Zhu <julie.zhu@xilinx.com>
      Signed-off-by: NJohn Linn <john.linn@xilinx.com>
      Acked-by: NGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      08d3c18e
    • J
      USB: ehci-hub: Remove redundant ehci->debug check · 872d3599
      Jason Wessel 提交于
      No need to check ehci->debug twice.
      
      Found-by: Sergei Shtylyov sshtylyov@ru.mvista.com
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      872d3599
  2. 04 12月, 2009 2 次提交
  3. 01 12月, 2009 2 次提交
    • O
      USB: work around for EHCI with quirky periodic schedules · ee4ecb8a
      Oliver Neukum 提交于
      a quirky chipset needs periodic schedules to run for a minimum
      time before they can be disabled again. This enforces the requirement
      with a time stamp and a calculated delay
      Signed-off-by: NOliver Neukum <oliver@neukum.org>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      ee4ecb8a
    • A
      USB: EHCI: don't send Clear-TT-Buffer following a STALL · c2f6595f
      Alan Stern 提交于
      This patch (as1304) fixes a regression in ehci-hcd.  Evidently some
      hubs don't handle Clear-TT-Buffer requests correctly, so we should
      avoid sending them when they don't appear to be absolutely necessary.
      The reported symptom is that output on a downstream audio device cuts
      out because the hub stops relaying isochronous packets.
      
      The patch prevents Clear-TT-Buffer requests from being sent following
      a STALL handshake.  In theory a STALL indicates either that the
      downstream device sent a STALL or that no matching TT buffer could be
      found.  In either case, the transfer is completed and the TT buffer
      does not remain busy, so it doesn't need to be cleared.
      
      Also, the patch fixes a minor flaw in the code that actually sends the
      Clear-TT-Buffer requests.  Although the pipe direction isn't really
      used for control transfers, it should be a Send rather than a Receive.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NJavier Kohen <jkohen@users.sourceforge.net>
      CC: David Brownell <david-b@pacbell.net>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c2f6595f
  4. 29 11月, 2009 2 次提交
    • D
      pcmcia: rework the irq_req_t typedef · 5fa9167a
      Dominik Brodowski 提交于
      Most of the irq_req_t typedef'd struct can be re-worked quite
      easily:
      
      (1) IRQInfo2 was unused in any case, so drop it.
      
      (2) IRQInfo1 was used write-only, so drop it.
      
      (3) Instance (private data to be passed to the IRQ handler):
      	Most PCMCIA drivers using pcmcia_request_irq() to actually
      	register an IRQ handler set the "dev_id" to the same pointer
      	as the "priv" pointer in struct pcmcia_device. Modify the two
      	exceptions (ipwireless, ibmtr_cs) to also work this waym and
      	set the IRQ handler's "dev_id" to p_dev->priv unconditionally.
      
      (4) Handler is to be of type irq_handler_t.
      
      (5) Handler != NULL already tells whether an IRQ handler is present.
      	Therefore, we do not need the IRQ_HANDLER_PRESENT flag in
      	irq_req_t.Attributes.
      
      CC: netdev@vger.kernel.org
      CC: linux-bluetooth@vger.kernel.org
      CC: linux-ide@vger.kernel.org
      CC: linux-wireless@vger.kernel.org
      CC: linux-scsi@vger.kernel.org
      CC: alsa-devel@alsa-project.org
      CC: Jaroslav Kysela <perex@perex.cz>
      CC: Jiri Kosina <jkosina@suse.cz>
      CC: Karsten Keil <isdn@linux-pingi.de>
      for the Bluetooth parts: Acked-by: Marcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NDominik Brodowski <linux@dominikbrodowski.net>
      5fa9167a
    • D
      pcmcia: remove deprecated handle_to_dev() macro · dd2e5a15
      Dominik Brodowski 提交于
      Update remaining users and remove deprecated handle_to_dev() macro
      
      CC: Harald Welte <laforge@gnumonks.org>
      CC: netdev@vger.kernel.org
      CC: linux-wireless@vger.kernel.org
      CC: linux-serial@vger.kernel.org
      Signed-off-by: NDominik Brodowski <linux@dominikbrodowski.net>
      dd2e5a15
  5. 18 11月, 2009 4 次提交
  6. 09 11月, 2009 1 次提交
  7. 31 10月, 2009 1 次提交
  8. 21 10月, 2009 1 次提交
    • T
      omap: headers: Move remaining headers from include/mach to include/plat · ce491cf8
      Tony Lindgren 提交于
      Move the remaining headers under plat-omap/include/mach
      to plat-omap/include/plat. Also search and replace the
      files using these headers to include using the right path.
      
      This was done with:
      
      #!/bin/bash
      mach_dir_old="arch/arm/plat-omap/include/mach"
      plat_dir_new="arch/arm/plat-omap/include/plat"
      headers=$(cd $mach_dir_old && ls *.h)
      omap_dirs="arch/arm/*omap*/ \
      drivers/video/omap \
      sound/soc/omap"
      other_files="drivers/leds/leds-ams-delta.c \
      drivers/mfd/menelaus.c \
      drivers/mfd/twl4030-core.c \
      drivers/mtd/nand/ams-delta.c"
      
      for header in $headers; do
      	old="#include <mach\/$header"
      	new="#include <plat\/$header"
      	for dir in $omap_dirs; do
      		find $dir -type f -name \*.[chS] | \
      			xargs sed -i "s/$old/$new/"
      	done
      	find drivers/ -type f -name \*omap*.[chS] | \
      		xargs sed -i "s/$old/$new/"
      	for file in $other_files; do
      		sed -i "s/$old/$new/" $file
      	done
      done
      
      for header in $(ls $mach_dir_old/*.h); do
      	git mv $header $plat_dir_new/
      done
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      ce491cf8
  9. 15 10月, 2009 3 次提交
  10. 12 10月, 2009 1 次提交
  11. 10 10月, 2009 2 次提交