27 Jun, 2016

2 commits


02 Jun, 2016

1 commit

  • On some platforms, the clocks might be registered by a platform
    driver. When this is the case, the clock platform driver may very well
    be probed after xhci-plat, in which case the first probe() invocation
    of xhci-plat will receive -EPROBE_DEFER as the return value of
    devm_clk_get().

    The current code handles that as a normal error, and simply assumes
    that this means that the system doesn't have a clock for the XHCI
    controller, and continues probing without calling
    clk_prepare_enable(). Unfortunately, this doesn't work on systems
    where the XHCI controller does have a clock, but that clock is
    provided by another platform driver. In order to fix this situation,
    we handle the -EPROBE_DEFER error condition specially, and abort the
    XHCI controller probe(). It will be retried later automatically, the
    clock will be available, devm_clk_get() will succeed, and the probe()
    will continue with the clock prepared and enabled as expected.

    In practice, such issue is seen on the ARM64 Marvell 7K/8K platform,
    where the clocks are registered by a platform driver.

    Cc:
    Signed-off-by: Thomas Petazzoni
    Signed-off-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Thomas Petazzoni
     

27 Apr, 2016

4 commits


14 Apr, 2016

1 commit


04 Mar, 2016

2 commits


04 Feb, 2016

1 commit

  • During probe, in the device tree case, the data pointer associated to a
    compatible is dereferenced. However, not all the compatibles are
    associated to a private data pointer.

    The generic-xhci and the xhci-platform don't need them, this patch adds a
    test on the data pointer before accessing it, avoiding a kernel crash.

    Fixes: 4efb2f694114 ("usb: host: xhci-plat: add struct xhci_plat_priv")
    Cc: stable@vger.kernel.org
    Signed-off-by: Gregory CLEMENT
    Signed-off-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Gregory CLEMENT
     

02 Dec, 2015

5 commits


17 Oct, 2015

2 commits

  • Provide the methods to let ACPI identify the need to use
    xhci-platform. Change the Kconfig files so the
    xhci-plat.o file is selectable during kernel config.

    This has been tested on an ARM64 machine with platform XHCI, an
    x86_64 machine with XHCI, and an x86_64 machine without XHCI.
    There were no regressions or error messages on the machines
    without platform XHCI.

    [dhdang: regenerate the patch over v4.3-rc1 and address new comments]
    Signed-off-by: Mark Langsdorf
    Signed-off-by: Duc Dang
    Signed-off-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Duc Dang
     
  • The xhci platform driver needs to work on systems that
    either only support 64-bit DMA or only support 32-bit DMA.
    Attempt to set a coherent dma mask for 64-bit DMA, and
    attempt again with 32-bit DMA if that fails.

    [dhdang: regenerate the patch over v4.3-rc1 and address new comments]
    Signed-off-by: Mark Langsdorf
    Tested-by: Mark Salter
    Signed-off-by: Duc Dang
    Acked-by: Arnd Bergmann
    Signed-off-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Duc Dang
     

31 May, 2015

3 commits

  • In the OTG case, the controller might not yet have been
    added or is removed before the system suspends.

    Assign xhci->main_hcd during probe to prevent NULL
    pointer de-reference in xhci_suspend/resume().

    Use the hcd->state flag to check if HCD is halted
    and if that is so do nothing for xhci_suspend/resume().

    [Only for xhci-plat devices, pci devices need it in gen_setup -Mathias]
    Signed-off-by: Roger Quadros
    Signed-off-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Roger Quadros
     
  • As xhci_hcd is now allocated by usb_create_hcd(), we don't
    need to add the primary HCD before creating the shared HCD.

    Creating the shared HCD before adding the primary HCD is particularly
    useful for the OTG use case so that we know at the OTG core if
    the HCD is in single configuration or dual (primary + shared)
    configuration.

    Signed-off-by: Roger Quadros
    [Mathias: rearranged to fit on top of the Marvell Armada 385 phy changes]
    Signed-off-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Roger Quadros
     
  • HCD core allocates memory for HCD private data in
    usb_create_[shared_]hcd() so make use of that
    mechanism to allocate the struct xhci_hcd.

    Introduce struct xhci_driver_overrides to provide
    the size of HCD private data and hc_driver operation
    overrides. As of now we only need to override the
    reset and start methods.

    Signed-off-by: Roger Quadros
    Signed-off-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Roger Quadros
     

18 Mar, 2015

1 commit

  • The Marvell Armada 385 AP needs a dumb phy in order to enable the USB3 VBUS.

    Add a call to retrieve a USB PHY to XHCI plat in order to support this.

    Signed-off-by: Maxime Ripard
    Signed-off-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Maxime Ripard
     

25 Feb, 2015

1 commit

  • The commit 973747928514 ("usb: host: xhci-plat: add support for the Armada
    375/38x XHCI controllers") extended the xhci-plat driver to support the Armada
    375/38x SoCs, mostly by adding a quirk configuring the MBUS window.

    However, that quirk was run before the clock the controllers needs has been
    enabled. This usually worked because the clock was first enabled by the
    bootloader, and left as such until the driver is probe, where it tries to
    access the MBUS configuration registers before enabling the clock.

    Things get messy when EPROBE_DEFER is involved during the probe, since as part
    of its error path, the driver will rightfully disable the clock. When the
    driver will be reprobed, it will retry to access the MBUS registers, but this
    time with the clock disabled, which hangs forever.

    Fix this by running the quirks after the clock has been enabled by the driver.

    Signed-off-by: Maxime Ripard
    Cc: # v3.16+
    Signed-off-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Maxime Ripard
     

01 Dec, 2014

1 commit


22 Nov, 2014

1 commit

  • When system is being suspended, if host device is not allowed to do wakeup,
    xhci_suspend() needs to clear all root port wake on bits. Otherwise, some
    platforms may generate spurious wakeup, even if PCI PME# is disabled.

    The initial commit ff8cbf250b44 ("xhci: clear root port wake on bits"),
    which also got into stable, turned out to not work correctly and had to
    be reverted, and is now rewritten.

    Cc: stable # v3.2+
    Signed-off-by: Lu Baolu
    Suggested-by: Alan Stern
    Acked-by: Alan Stern
    [Mathias Nyman: reword commit message]
    Signed-off-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Lu Baolu
     

08 Nov, 2014

1 commit


04 Oct, 2014

2 commits

  • Instead of building all of the xHCI code into a single module, separate
    it out into the core (xhci-hcd), PCI (xhci-pci, now selected by the new
    config option CONFIG_USB_XHCI_PCI), and platform (xhci-plat) drivers.
    Also update the PCI/platform drivers with module descriptions/licenses
    and have them register their respective drivers in their initcalls.

    Signed-off-by: Andrew Bresticker
    Signed-off-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Andrew Bresticker
     
  • Since the struct hc_driver is mostly the same across the xhci-pci,
    xhci-plat, and the upcoming xhci-tegra driver, introduce the function
    xhci_init_driver() which will populate the hc_driver with the default
    xHCI operations. The caller must supply a setup function which will
    be used as the hc_driver's reset callback.

    Note that xhci-plat also overrides the default ->start() callback so
    that it can do rcar-specific initialization.

    Signed-off-by: Andrew Bresticker
    Signed-off-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Andrew Bresticker
     

10 Jul, 2014

4 commits


29 May, 2014

1 commit

  • Some platforms (such as the Renesas R-Car) need to initialize some specific
    registers after xhci driver calls usb_add_hcd() and before the driver calls
    xhci_run(). So, this patch adds the xhci_plat_start() function.

    Acked-by: Geert Uytterhoeven
    Signed-off-by: Yoshihiro Shimoda
    Signed-off-by: Greg Kroah-Hartman

    Yoshihiro Shimoda
     

28 May, 2014

4 commits

  • If we build a kernel with PM_SUSPEND set and no PM_SLEEP,
    we get a build warning in the xhci-plat driver about unused
    functions.

    To fix this, use "#ifdef CONFIG_PM_SLEEP", like we do in most
    other drivers nowadays.

    Signed-off-by: Arnd Bergmann
    Cc: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • The Armada 375 and 38x SoCs come with an XHCI controller that requires
    some specific initialization related to the MBus windows
    configuration. This patch adds the support for this special
    configuration as an XHCI quirk executed during probe.

    Two new compatible strings are added to identify the Armada 375 and
    Armada 38x XHCI controllers, and therefore enable the relevant quirk.

    Signed-off-by: Gregory CLEMENT
    Signed-off-by: Thomas Petazzoni
    Acked-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Gregory CLEMENT
     
  • Some platforms (such as the Armada 38x ones) can gate the clock of
    their USB controller. This patch adds the support for one clock in
    xhci-plat, by enabling it during probe and disabling it on remove.

    To achieve this, it adds a 'struct clk *' member in xhci_hcd. While
    only used for now in xhci-plat, it might be used by other drivers in
    the future. Moreover, the xhci_hcd structure already holds other
    members such as msix_count and msix_entries, which are MSI-X specific,
    and therefore only used by xhci-pci.

    Signed-off-by: Gregory CLEMENT
    Signed-off-by: Thomas Petazzoni
    Acked-by: Felipe Balbi
    Acked-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Gregory CLEMENT
     
  • Sorting the headers in alphabetic order will help to reduce the conflict
    when adding new headers later.

    Signed-off-by: Gregory CLEMENT
    Acked-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Gregory CLEMENT
     

05 Mar, 2014

1 commit

  • On some older XHCIs streams are not supported and the UAS driver
    will fail at probe time. For those devices storage should try
    to bind to UAS devices.
    This patch adds a flag for stream support to HCDs and evaluates
    it.

    [Note: Sarah fixed a bug where the USB 2.0 root hub, not USB 3.0 root
    hub would get marked as being able to support streams.]

    Signed-off-by: Oliver Neukum
    Signed-off-by: Sarah Sharp
    Acked-by: Hans de Goede

    Oliver Neukum
     

16 Feb, 2014

1 commit

  • This brings the xhci-platform bindings in sync with what we've done for
    the ohci- and ehci-platform drivers. As discussed there using platform as a
    postfix is a bit weird as the platform bus is a Linux specific thing and
    the bindings are supposed to be OS agnostic.

    Note that the old xhci-platform compatible string is kept around for, well,
    compatibility reasons.

    Signed-off-by: Hans de Goede
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     

11 Dec, 2013

1 commit

  • Change the default enumeration scheme for xhci attached non-SuperSpeed
    devices from:

    Reset
    SetAddress [xhci address-device BSR = 0]
    GetDescriptor(8)
    GetDescriptor(18)

    ...to:

    Reset
    [xhci address-device BSR = 1]
    GetDescriptor(64)
    Reset
    SetAddress [xhci address-device BSR = 0]
    GetDescriptor(18)

    ...as some devices misbehave when encountering a SetAddress command
    prior to GetDescriptor. There are known legacy devices that require
    this scheme, but testing has found at least one USB3 device that fails
    enumeration when presented with this ordering. For now, follow the ehci
    case and enable 'new scheme' by default for non-SuperSpeed devices.

    To support this enumeration scheme on xhci the AddressDevice operation
    needs to be performed twice. The first instance of the command enables
    the HC's device and slot context info for the device, but omits sending
    the device a SetAddress command (BSR == block set address request).
    Then, after GetDescriptor completes, follow up with the full
    AddressDevice+SetAddress operation.

    As mentioned before, this ordering of events with USB3 devices causes an
    extra state transition to be exposed to xhci. Previously USB3 devices
    would transition directly from 'enabled' to 'addressed' and never need
    to underrun responses to 'get descriptor'. We do see the 64-byte
    descriptor fetch the correct data, but the following 18-byte descriptor
    read after the reset gets:

    bLength = 0
    bDescriptorType = 0
    bcdUSB = 0
    bDeviceClass = 0
    bDeviceSubClass = 0
    bDeviceProtocol = 0
    bMaxPacketSize0 = 9

    instead of:

    bLength = 12
    bDescriptorType = 1
    bcdUSB = 300
    bDeviceClass = 0
    bDeviceSubClass = 0
    bDeviceProtocol = 0
    bMaxPacketSize0 = 9

    which results in the discovery process looping until falling back to
    'old scheme' enumeration.

    Acked-by: Alan Stern
    Reported-by: David Moore
    Suggested-by: Sarah Sharp
    Reported-by: Dan Carpenter
    Signed-off-by: Dan Williams
    Signed-off-by: Sarah Sharp

    Dan Williams