1. 14 3月, 2011 6 次提交
    • S
      xhci: Rename variables and reduce register reads. · 518e848e
      Sarah Sharp 提交于
      The xhci_bus_suspend() and xhci_bus_resume() functions are a bit hard to
      read, because they have an ambiguously named variable "port".  Rename it
      to "port_index".  Introduce a new temporary variable, "max_ports" that
      holds the maximum number of roothub ports the host controller supports.
      This will reduce the number of register reads, and make it easy to change
      the maximum number of ports when there are two roothubs.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      518e848e
    • S
      xhci: Rework port suspend structures for limited ports. · 1d5810b6
      Sarah Sharp 提交于
      The USB core only allows up to 31 (USB_MAXCHILDREN) ports under a roothub.
      The xHCI driver keeps track of which ports are suspended, which ports have
      a suspend change bit set, and what time the port will be done resuming.
      It keeps track of the first two by setting a bit in a u32 variable,
      suspended_ports or port_c_suspend.  The xHCI driver currently assumes we
      can have up to 256 ports under a roothub, so it allocates an array of 8
      u32 variables for both suspended_ports and port_c_suspend.  It also
      allocates a 256-element array to keep track of when the ports will be done
      resuming.
      
      Since we can only have 31 roothub ports, we only need to use one u32 for
      each of the suspend state and change variables.  We simplify the bit math
      that's trying to index into those arrays and set the correct bit, if we
      assume wIndex never exceeds 30.  (wIndex is zero-based after it's
      decremented from the value passed in from the USB core.)  Finally, we
      change the resume_done array to only hold 31 elements.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Andiry Xu <andiry.xu@amd.com>
      1d5810b6
    • S
      USB: Fix usb_add_hcd() checkpatch errors. · abc4f9b0
      Sarah Sharp 提交于
      The irq enabling code is going to be refactored into a new function, so
      clean up some checkpatch errors before moving it.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      abc4f9b0
    • S
      USB: Remove bitmap #define from hcd.h · da13051c
      Sarah Sharp 提交于
      Using a #define to redefine a common variable name is a bad thing,
      especially when the #define is in a header.  include/linux/usb/hcd.h
      redefined bitmap to DeviceRemovable to avoid typing a long field in the
      hub descriptor.  This has unintended side effects for files like
      drivers/usb/core/devio.c that include that file, since another header
      included after hcd.h has different variables named bitmap.
      
      Remove the bitmap #define and replace instances of it in the host
      controller code.  Cleanup the spaces around function calls and square
      brackets while we're at it.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
      Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
      Cc: Tony Olech <tony.olech@elandigitalsystems.com>
      Cc: "Robert P. J. Day" <rpjday@crashcourse.ca>
      Cc: Max Vozeler <mvz@vozeler.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Cc: Rodolfo Giometti <giometti@linux.it>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: Anton Vorontsov <avorontsov@mvista.com>
      Cc: Sebastian Siewior <bigeasy@linutronix.de>
      Cc: Lothar Wassmann <LW@KARO-electronics.de>
      Cc: Olav Kongas <ok@artecdesign.ee>
      Cc: Martin Fuzzey <mfuzzey@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      da13051c
    • S
      xhci: Remove old no-op test. · 0b8ca72a
      Sarah Sharp 提交于
      The test of placing a number of command no-ops on the command ring and
      counting the number of no-op events that were generated was only used
      during the initial xHCI driver bring up.  This test is no longer used, so
      delete it.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      0b8ca72a
    • S
      usb: Always return 0 or -EBUSY to the runtime PM core. · db7c7c0a
      Sarah Sharp 提交于
      The PM core reacts badly when the return code from usb_runtime_suspend()
      is not 0, -EAGAIN, or -EBUSY.  The PM core regards this as a fatal error,
      and refuses to run anymore PM helper functions.  In particular,
      usbfs_open() and other usbfs functions will fail because the PM core will
      return an error code when usb_autoresume_device() is called.  This causes
      libusb and/or lsusb to either hang or segfault.
      
      If a USB device cannot suspend for some reason (e.g. a hub doesn't report
      it has remote wakeup capabilities), we still want lsusb and other
      userspace programs to work.  So return -EBUSY, which will fill people's
      log files with failed tries, but will ensure userspace still works.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      db7c7c0a
  2. 12 3月, 2011 6 次提交
  3. 10 3月, 2011 3 次提交
  4. 08 3月, 2011 5 次提交
    • L
      USB: s3c2410_udc: Add common implementation for GPIO controlled pullups · a74022a5
      Lars-Peter Clausen 提交于
      Currently all boards using the s3c2410_udc driver use a GPIO to control the
      state of the pullup, as a result the same code is reimplemented in each board
      file.
      This patch adds support for using a GPIO to control the pullup state to the udc
      driver, so the boards can use a common implementation.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a74022a5
    • S
      USB: OHCI: use pci_dev->revision · fa417c36
      Sergei Shtylyov 提交于
      Commit ab1666c1 (USB: quirk PLL power down mode)
      added code that reads the revision ID from the PCI configuration register while
      it's stored by PCI subsystem in the 'revision' field of 'struct pci_dev'...
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      fa417c36
    • P
      USB: Rename "msm72k_otg.c" to "msm_otg.c" · dfb2130c
      Pavankumar Kondeti 提交于
      This driver is used across all MSM SoCs.  Hence give a generic name.
      All Functions and strutures are also using "msm_otg" as prefix.
      Signed-off-by: NPavankumar Kondeti <pkondeti@codeaurora.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      dfb2130c
    • A
      usb/isp1760: Fix crash when unplugging bug · d3cf2a8d
      Arvid Brodin 提交于
      This fixes a problem with my previous patch series where there's a great
      risk that the kernel will crash when unplugging interrupt devices from
      the USB port. These lines must have got missing when I rebased the
      patches from the older kernel I was working with to 2.6.37 and 2.6-next:
      
      This fixes a bug where the kernel may crash if you unplug a USB device
      that has active interrupt transfers.
      Signed-off-by: NArvid Brodin <arvid.brodin@enea.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d3cf2a8d
    • A
      USB: move usbcore away from hcd->state · 9b37596a
      Alan Stern 提交于
      The hcd->state variable is a disaster.  It's not clearly owned by
      either usbcore or the host controller drivers, and they both change it
      from time to time, potentially stepping on each other's toes.  It's
      not protected by any locks.  And there's no mechanism to prevent it
      from going through an invalid transition.
      
      This patch (as1451) takes a first step toward fixing these problems.
      As it turns out, usbcore uses hcd->state for essentially only two
      things: checking whether the controller's root hub is running and
      checking whether the controller has died.  Therefore the patch adds
      two new atomic bitflags to the hcd structure, to store these pieces of
      information.  The new flags are used only by usbcore, and a private
      spinlock prevents invalid combinations (a dead controller's root hub
      cannot be running).
      
      The patch does not change the places where usbcore sets hcd->state,
      since HCDs may depend on them.  Furthermore, there is one place in
      usb_hcd_irq() where usbcore still must use hcd->state: An HCD's
      interrupt handler can implicitly indicate that the controller died by
      setting hcd->state to HC_STATE_HALT.  Nevertheless, the new code is a
      big improvement over the current code.
      
      The patch makes one other change.  The hcd_bus_suspend() and
      hcd_bus_resume() routines now check first whether the host controller
      has died; if it has then they return immediately without calling the
      HCD's bus_suspend or bus_resume methods.
      
      This fixes the major problem reported in Bugzilla #29902: The system
      fails to suspend after a host controller dies during system resume.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NAlex Terekhov <a.terekhov@gmail.com>
      CC: <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9b37596a
  5. 03 3月, 2011 5 次提交
  6. 02 3月, 2011 2 次提交
    • Y
      usb: EHCI, OHCI: Add configuration for the SH USB controller · 60b0bf0f
      Yoshihiro Shimoda 提交于
      The SH EHCI/OHCI driver hardcoded the CPU type in {ehci,ohci}-hcd.c.
      So if we will add the new CPU, we had to add to the hcd driver each time.
      The patch adds the CONFIG_USB_{EHCI,OHCI}_SH configuration. So if we
      want to use the SH EHCI/OHCI, we only enable the configuration.
      Signed-off-by: NYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      60b0bf0f
    • A
      USB host: Move AMD PLL quirk to pci-quirks.c · ad93562b
      Andiry Xu 提交于
      This patch moves the AMD PLL quirk code in OHCI/EHCI driver to pci-quirks.c,
      and exports the functions to be used by xHCI driver later.
      
      AMD PLL quirk disable the optional PM feature inside specific
      SB700/SB800/Hudson-2/3 platforms under the following conditions:
      
      1. If an isochronous device is connected to OHCI/EHCI/xHCI port and is active;
      2. Optional PM feature that powers down the internal Bus PLL when the link is
         in low power state is enabled.
      
      Without AMD PLL quirk, USB isochronous stream may stutter or have breaks
      occasionally, which greatly impair the performance of audio/video streams.
      
      Currently AMD PLL quirk is implemented in OHCI and EHCI driver, and will be
      added to xHCI driver too. They are doing similar things actually, so move
      the quirk code to pci-quirks.c, which has several advantages:
      
      1. Remove duplicate defines and functions in OHCI/EHCI (and xHCI) driver and
         make them cleaner;
      2. AMD chipset information will be probed only once and then stored.
         Currently they're probed during every OHCI/EHCI initialization, move
         the detect code to pci-quirks.c saves the repeat detect cost;
      3. Build up synchronization among OHCI/EHCI/xHCI driver. In current
         code, every host controller enable/disable PLL only according to
         its own status, and may enable PLL while there is still isoc transfer on
         other HCs. Move the quirk to pci-quirks.c prevents this issue.
      Signed-off-by: NAndiry Xu <andiry.xu@amd.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Alex He <alex.he@amd.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ad93562b
  7. 01 3月, 2011 13 次提交
    • K
      usb: host: omap: ehci and ohci simplification · 19403165
      Keshava Munegowda 提交于
      The ehci and ohci drivers are simplified; Since
      UHH and TLL initialization, clock handling are
      done by common usbhs core driver, these functionalities
      are removed from ehci and ohci drivers.
      Signed-off-by: NKeshava Munegowda <keshava_mgowda@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      19403165
    • K
      usb: host: omap: common usb host core driver · 17cdd29d
      Keshava Munegowda 提交于
      enabling and disabling the common clocks for ehci
      and ohci is implemented. usbhs is a common parent
      platform driver for EHCI and OHCI driver. This driver
      receives the clock enable and disable requests
      from ehci and ohci drivers.The UHH and TLL
      initialization is also performed.
      Signed-off-by: NKeshava Munegowda <keshava_mgowda@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      17cdd29d
    • K
      arm: omap: usb: create common enums and structures for ehci and ohci · 181b250c
      Keshava Munegowda 提交于
      Create the ehci and ohci specific platform data structures.
      The port enum values are made common for both ehci and ohci.
      Signed-off-by: NKeshava Munegowda <keshava_mgowda@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      181b250c
    • F
      usb: host: omap: switch to platform_get_resource_byname · 09f0607d
      Felipe Balbi 提交于
      now that we have names on all memory bases, we can
      switch to use platform_get_resource_byname() which
      will make it simpler when we move to a setup where
      OHCI and EHCI on OMAP play well together.
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      09f0607d
    • A
      usb: ehci: omap: add support for TLL mode on OMAP4 · 87ecc73b
      Anand Gadiyar 提交于
      The EHCI controller in OMAP4 supports a transceiver-less link
      mode (TLL mode), similar to the one in OMAP3. On the OMAP4
      however, there are an additional set of clocks that need
      to be turned on to get this working.
      
      Request and configure these for each port if that port
      is connected in TLL mode.
      Signed-off-by: NAnand Gadiyar <gadiyar@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      87ecc73b
    • H
      usb: musb: tusb: Fix possible null pointer dereference in tusb6010_omap.c · c88ba39c
      Huzaifa Sidhpurwala 提交于
      tusb_dma was being dereferenced when it was nul
      Signed-off-by: NHuzaifa Sidhpurwala <huzaifas@redhat.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      c88ba39c
    • H
      usb: musb: OMAP3xxx: Fix device detection in otg & host mode · 70045c57
      Hema HK 提交于
      In OMAP3xxx with OTG mode or host only mode, When the device
      is inserted after the gadget driver loading the enumeration was not
      through. This is because the mentor controller will start sensing the
      ID PIN only after setting the session bit.
      So after ID-GND, need to set the session bit for mentor to get it
      configured as A device.
      
      This is a fix to set the session bit again in ID_GND notification handler.
      Tested with OMAP3630Zoom3 platform.
      Signed-off-by: NHema HK <hemahk@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      70045c57
    • H
      usb: otg: TWL4030: Update the last_event variable. · 37db3af1
      Hema HK 提交于
      Update the last_event variable of otg_transceiver. This will be used in
      the musb platform glue driver for runtime idling the device.
      Signed-off-by: NHema HK <hemahk@ti.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      37db3af1
    • H
      usb: musb: Idle path retention and offmode support for OMAP3 · 7acc6197
      Hema HK 提交于
      This patch supports the retention and offmode support in the idle path for
      musb driver using runtime pm APIs.
      
      This is restricted to support offmode and retention only when device not
      connected.When device/cable connected with gadget driver loaded,configured
      to no idle/standby which will not allow the core transition to retention
      or off.
      
      There is no context save/restore done by hardware for musb in OMAP3
      and OMAP4,driver has to take care of saving and restoring the context
      during offmode.
      
      Musb has a requirement of configuring sysconfig register to force
      idle/standby mode and set the ENFORCE bit in module STANDBY register
      for retention and offmode support.
      
      Runtime pm and hwmod frameworks will take care of configuring to force
      idle/standby when pm_runtime_put_sync is called and back to no
      idle/standby when pm_runeime_get_sync is called.
      
      Compile, boot tested and also tested the retention in the idle path on
      OMAP3630Zoom3. And tested the global suspend/resume with offmode enabled.
      Usb basic functionality tested on OMAP4430SDP.
      
      There is some problem with idle path offmode in mainline, I could not test
      with offmode. But I have tested this patch with resetting the controller
      in the idle path when wakeup from retention just to make sure that the
      context is lost, and restore path is working fine.
      
      Removed .suspend/.resume fnction pointers and functions because there
      is no need of having these functions as all required work is done
      at runtime in the driver.
      
      There is no need to call the runtime pm api with glue driver device
      as glue layer device is the parent of musb core device, when runtime apis
      are called for the child, parent device runtime functionality
      will be invoked.
      
      Design overview:
      
      pm_runtime_get_sync: When called with musb core device takes care of
      enabling the clock, calling runtime callback function of omap2430 glue
      layer, runtime call back of musb driver and configure the musb sysconfig
      to no idle/standby
      
      pm_runtime_put: Takes care of calling runtime callback function of omap2430
      glue layer, runtime call back of musb driver, Configure the musb sysconfig
      to force idle/standby and disable the clock.
      
      During musb driver load: Call pm_runtime_get_sync.
      
      End of musb driver load: Call pm_runtime_put
      
      During gadget driver load: Call pm_runtime_get_sync,
      End of gadget driver load: Call pm_runtime_put if there is no device
      or cable is connected.
      
      During unload of the gadget driver:Call pm_runtime_get_sync if cable/device
      is not connected.
      End of the gadget driver unload : pm_runtime_put
      
      During unload of musb driver : Call pm_runtime_get_sync
      End of unload: Call pm_runtime_put
      
      On connect of usb cable/device -> transceiver notification(VBUS and ID-GND):
      pm_runtime_get_sync only if the gadget driver loaded.
      
      On disconnect of the cable/device -> Disconnect Notification:
      pm_runtime_put if the gadget driver is loaded.
      Signed-off-by: NHema HK <hemahk@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      7acc6197
    • H
      usb: musb: Remove platform context save/restore API · da68ccec
      Hema HK 提交于
      For OMAP3 and OMAP4 for offmode and retention support, musb
      sysconfig is configured to force idle and standby with ENABLE_FORCE bit
      of OTG_FORCESTNDBY set.
      And on wakeup configure to no ilde/standby with resetting the ENABLE_FORCE
      bit. There is not need to save and restore of this register anymore
      so removed omap2430_save_context/omap2430_restore_context functions.
      and also removed otg_forcestandby member of musb_context_registers
      structure
      Signed-off-by: NHema HK <hemahk@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      da68ccec
    • F
      usb: musb: gadget: fix list_head usage · 4cbbf084
      Felipe Balbi 提交于
      commit ad1adb89
      (usb: musb: gadget: do not poke with gadget's list_head)
      fixed a bug in musb where it was corrupting the list_head
      which is supposed to be used by gadget drivers. While
      doing that, I forgot to fix the usage in musb_gadget_dequeue()
      method. Fix that.
      Reported-by: NPavol Kurina <pavol.kurina@emsys.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      4cbbf084
    • J
      USB: serial/kobil_sct, fix potential tty NULL dereference · 6960f40a
      Jiri Slaby 提交于
      Make sure that we check the return value of tty_port_tty_get.
      Sometimes it may return NULL and we later dereference that.
      
      The only place here is in kobil_read_int_callback, so fix it.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Alan Cox <alan@linux.intel.com>
      Cc: stable@kernel.org
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6960f40a
    • J
      USB: serial/keyspan_pda, fix potential tty NULL dereferences · f7d7aedf
      Jiri Slaby 提交于
      Make sure that we check the return value of tty_port_tty_get.
      Sometimes it may return NULL and we later dereference that.
      
      There are several places to check. For easier handling,
      tty_port_tty_get is moved directly to the palce where needed in
      keyspan_pda_rx_interrupt.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Alan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f7d7aedf