1. 27 Apr, 2019 3 commits
  2. 25 Apr, 2019 12 commits
    • Raul E Rangel's avatar
      usb/hcd: Send a uevent signaling that the host controller had died · a4d6a298
      Raul E Rangel authored
      This change will send an OFFLINE event to udev with the ERROR=DEAD
      environment variable set when the HC dies.
      
      By notifying user space the appropriate policies can be applied.
      i.e.,
       * Collect error logs.
       * Notify the user that USB is no longer functional.
       * Perform a graceful reboot.
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Signed-off-by: default avatarRaul E Rangel <rrangel@chromium.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a4d6a298
    • Ajay Gupta's avatar
      usb: typec: Add driver for NVIDIA Alt Modes · cf28369c
      Ajay Gupta authored
      Latest NVIDIA GPUs support VirtualLink device. Since USBIF
      has not assigned a Standard ID (SID) for VirtualLink
      so using NVIDA VID 0x955 as SVID.
      Signed-off-by: default avatarAjay Gupta <ajayg@nvidia.com>
      Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cf28369c
    • Ajay Gupta's avatar
      usb: typec: displayport: Export probe and remove functions · d266e968
      Ajay Gupta authored
      VirtualLink standard extends the DisplayPort Alt Mode by
      utilizing also the USB 2 pins on the USB Type-C connector.
      It uses the same messages as DisplayPort, but not the DP
      SVID. At the time of writing, USB IF has not assigned a
      Standard ID (SID) for VirtualLink, so the manufacturers of
      VirtualLink adapters use their Vendor IDs as the SVID.
      
      Since the SVID specific communication is exactly the same as
      with DisplayPort alternate mode, there is no need to
      implement separate driver for VirtualLink. We'll handle the
      current VirtualLink adapters with probe drivers, and once
      there is SVID assigned for it, we add it to the displayport
      alt mode driver.
      
      To support probing drivers, exporting the probe and remove
      functions, and also changing the DP_HEADER helper macro to
      use the SVID of the alternate mode device instead of the
      DisplayPort alt mode SVID.
      Suggested-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: default avatarAjay Gupta <ajayg@nvidia.com>
      Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d266e968
    • Heikki Krogerus's avatar
      usb: typec: ucsi: Support for DisplayPort alt mode · af8622f6
      Heikki Krogerus authored
      This makes it possible to bind a driver to a DisplayPort
      alt mode adapter devices.
      
      The driver attempts to cope with the limitations of UCSI by
      "emulating" behaviour and attempting to guess things when
      ever possible in order to satisfy the requirements the
      standard DisplayPort alt mode driver has.
      Tested-by: default avatarAjay Gupta <ajayg@nvidia.com>
      Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      af8622f6
    • Heikki Krogerus's avatar
      usb: typec: ucsi: Preliminary support for alternate modes · ad74b864
      Heikki Krogerus authored
      With UCSI the alternate modes, just like everything else
      related to USB Type-C connectors, are handled in firmware.
      The operating system can see the status and is allowed to
      request certain things, for example entering and exiting the
      modes, but the support for alternate modes is very limited
      in UCSI. The feature is also optional, which means that even
      when the platform supports alternate modes, the operating
      system may not be even made aware of them.
      
      UCSI does not support direct VDM reading or writing.
      Instead, alternate modes can be entered and exited using a
      single custom command which takes also an optional SVID
      specific configuration value as parameter. That means every
      supported alternate mode has to be handled separately in
      UCSI driver.
      
      This commit does not include support for any specific
      alternate mode. The discovered alternate modes are now
      registered, but binding a driver to an alternate mode will
      not be possible until support for that alternate mode is
      added to the UCSI driver.
      Tested-by: default avatarAjay Gupta <ajayg@nvidia.com>
      Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ad74b864
    • Ajay Gupta's avatar
      usb: typec: ucsi: ccg: add firmware flashing support · 5c9ae5a8
      Ajay Gupta authored
      CCGx has two copies of the firmware in addition to the bootloader.
      If the device is running FW1, FW2 can be updated with the new version.
      Dual firmware mode allows the CCG device to stay in a PD contract and
      support USB PD and Type-C functionality while a firmware update is in
      progress.
      
      First we read the currently flashed firmware version of both
      primary and secondary firmware and then compare it with
      version of firmware file to determine if flashing is required.
      
      Command framework is added to support sending commands to CCGx
      controller. We wait for response after sending the command and then
      read the response from RAB_RESPONSE register.
      
      Below commands are supported,
      	- ENTER_FLASHING
      	- RESET
      	- PDPORT_ENABLE
      	- JUMP_TO_BOOT
      	- FLASH_ROW_RW
      	- VALIDATE_FW
      
      Command specific mutex lock is also added to sync between driver
      and user threads.
      
      PD port number information is added which is required while sending
      PD_PORT_ENABLE command
      Signed-off-by: default avatarAjay Gupta <ajayg@nvidia.com>
      [ heikki: Added ABI documentation. ]
      Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5c9ae5a8
    • Ajay Gupta's avatar
      i2c: nvidia-gpu: Supply CCGx driver the fw build info · 5fd958a4
      Ajay Gupta authored
      Adding device property "ccgx,firmware-build" for the CCGx
      device, so the CCGx driver knows which firmware binary to
      use for a specific vendor.
      Suggested-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: default avatarAjay Gupta <ajayg@nvidia.com>
      Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5fd958a4
    • Ajay Gupta's avatar
      usb: typec: ucsi: ccg: add get_fw_info function · 5d438e20
      Ajay Gupta authored
      Function is to get the details of ccg firmware and device version.
      It will be useful in debugging and also during firmware update.
      Signed-off-by: default avatarAjay Gupta <ajayg@nvidia.com>
      Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5d438e20
    • Serge Semin's avatar
      usb: usb251xb: Lock i2c-bus segment the hub resides · 6e3c8beb
      Serge Semin authored
      SMBus slave configuration is activated by CFG_SEL[1:0]=0x1 pins
      state. This is the mode the hub is supposed to be to let this driver
      work correctly. But a race condition might happen right after reset
      is cleared due to CFG_SEL[0] pin being multiplexed with SMBus SCL
      function. In case if the reset pin is handled by a i2c GPIO expander,
      which is also placed at the same i2c-bus segment as the usb251x
      SMB-interface connected to, then the hub reset clearance might
      cause the CFG_SEL[0] being latched in unpredictable state. So
      sometimes the hub configuration mode might be 0x1 (as expected),
      but sometimes being 0x0, which doesn't imply to have the hub SMBus-slave
      interface activated and consequently causes this driver failure.
      
      In order to fix the problem we must make sure the GPIO-reset chip doesn't
      reside the same i2c-bus segment as the SMBus-interface of the hub. If
      it doesn't, we can safely block the segment for the time the reset is
      cleared to prevent anyone generating a traffic at the i2c-bus SCL lane
      connected to the CFG_SEL[0] pin. But if it does, nothing we can do, so
      just return an error. If we locked the i2c-bus segment and tried to
      communicate with the GPIO-expander, it would cause a deadlock. If we didn't
      lock the i2c-bus segment, it would randomly cause the CFG_SEL[0] bit flip.
      Signed-off-by: default avatarSerge Semin <fancer.lancer@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6e3c8beb
    • Marc Gonzalez's avatar
      usb: dwc3: Allow building USB_DWC3_QCOM without EXTCON · 77a49465
      Marc Gonzalez authored
      Keep EXTCON support optional, as some platforms do not need it.
      
      Do the same for USB_DWC3_OMAP while we're at it.
      
      Fixes: 3def4031 ("usb: dwc3: add EXTCON dependency for qcom")
      Signed-off-by: default avatarMarc Gonzalez <marc.w.gonzalez@free.fr>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      77a49465
    • Dan Carpenter's avatar
      usbip: stub_rx: tidy the indenting in is_clear_halt_cmd() · 409fba22
      Dan Carpenter authored
      There is an extra space character before the return statement.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      409fba22
    • Greg Kroah-Hartman's avatar
      Merge tag 'phy-for-5.2' of... · d30e413f
      Greg Kroah-Hartman authored
      Merge tag 'phy-for-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-next
      
      Kishon writes:
      
      phy: for 5.2
      
        *) Add a new *release* phy_ops invoked when the consumer relinquishes PHY
           that can be used to undo the operation performed in xlate
        *) Add new driver to support USB2 PHY and shared USB3 + PCIE PHY in Amlogic
           G12A SoC Family.
        *) Add new driver to support for Broadcom's Stingray USB PHY (Type 1 has
           one super speed PHY and one high speed PHY, Type 2 has one high speed PHY)
        *) Add new driver to support USB PHY in hi3660 SoC of Hisilicon
        *) Add new driver to support UFS M-PHY in MediaTek SoC
        *) Add new driver to support XUSB pad controller in Tegra186 SoCs
        *) Add new driver to support SERDES in TI's AM654 platform
        *) Add support for generation 2 USB2 PHY and gneration 3 USB2 PHY in r8a77470
           to phy-rcar-gen2.c and phy-rcar-gen3-usb2.c respectively
        *) Add support for PCIe QMP PHY support in msm8998 to phy-qcom-qmp.c
        *) Add support for SERDES6G in phy-ocelot-serdes.c
        *) Add support to set drive impedance from device tree in phy-rockchip-emmc.c
        *) Add support to power up/down the VBUS voltage rail in phy-fsl-imx8mq-usb.c
        *) Add support to shut off regulators that power UFS during system suspend
        *) Re-design phy-rcar-gen3-usb2.c to create separate PHY instances for each
           channel which helps to enable/disable interrupts for each instance
           independently
        *) Fix PCIe power up sequence to follow the TRM in order to ensure the DPLL &
           PHY operates correctly over the entire temperature range.
        *) Use devm_clk_get_optional to get optional clocks instead of adding
           custom error checks
      Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      
      * tag 'phy-for-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy: (51 commits)
        dt-bindings: phy-qcom-qmp: Tweak qcom,msm8998-qmp-ufs-phy
        dt-bindings: phy-qcom-qmp: Add qcom,msm8998-qmp-pcie-phy
        phy: Add usb phy support for hi3660 Soc of Hisilicon
        dt-bindings: phy: Add support for HiSilicon's hi3660 USB PHY
        scsi: phy: mediatek: fix typo in author's email address
        phy: ocelot-serdes: Add support for SERDES6G muxing
        phy: fsl-imx8mq-usb: add support for VBUS power control
        dt-bindings: phy-imx8mq-usb: add optional vbus supply regulator
        phy: qcom-qmp: Add msm8998 PCIe QMP PHY support
        phy: ti: am654-serdes: Support all clksel values
        phy: ti: Add a new SERDES driver for TI's AM654x SoC
        dt-bindings: phy: ti: Add dt binding documentation for SERDES in AM654x SoC
        phy: core: Invoke pm_runtime_get_*/pm_runtime_put_* before invoking reset callback
        phy: core: Add *release* phy_ops invoked when the consumer relinquishes PHY
        phy: phy-meson-gxl-usb2: get optional clock by devm_clk_get_optional()
        phy: socionext: get optional clock by devm_clk_get_optional()
        phy: qcom-qusb2: get optional clock by devm_clk_get_optional()
        phy: phy-mtk-tphy: get optional clock by devm_clk_get_optional()
        phy: renesas: rcar-gen3-usb2: enable/disable independent irqs
        phy: renesas: rcar-gen3-usb2: Use pdev's device pointer on dev_vdbg()
        ...
      d30e413f
  3. 22 Apr, 2019 1 commit
  4. 19 Apr, 2019 10 commits
  5. 18 Apr, 2019 7 commits
  6. 17 Apr, 2019 7 commits
    • Alan Stern's avatar
      USB: core: Don't unbind interfaces following device reset failure · 381419fa
      Alan Stern authored
      The SCSI core does not like to have devices or hosts unregistered
      while error recovery is in progress.  Trying to do so can lead to
      self-deadlock: Part of the removal code tries to obtain a lock already
      held by the error handler.
      
      This can cause problems for the usb-storage and uas drivers, because
      their error handler routines perform a USB reset, and if the reset
      fails then the USB core automatically goes on to unbind all drivers
      from the device's interfaces -- all while still in the context of the
      SCSI error handler.
      
      As it turns out, practically all the scenarios leading to a USB reset
      failure end up causing a device disconnect (the main error pathway in
      usb_reset_and_verify_device(), at the end of the routine, calls
      hub_port_logical_disconnect() before returning).  As a result, the
      hub_wq thread will soon become aware of the problem and will unbind
      all the device's drivers in its own context, not in the
      error-handler's context.
      
      This means that usb_reset_device() does not need to call
      usb_unbind_and_rebind_marked_interfaces() in cases where
      usb_reset_and_verify_device() has returned an error, because hub_wq
      will take care of everything anyway.
      
      This particular problem was observed in somewhat artificial
      circumstances, by using usbfs to tell a hub to power-down a port
      connected to a USB-3 mass storage device using the UAS protocol.  With
      the port turned off, the currently executing command timed out and the
      error handler started running.  The USB reset naturally failed,
      because the hub port was off, and the error handler deadlocked as
      described above.  Not carrying out the call to
      usb_unbind_and_rebind_marked_interfaces() fixes this issue.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-by: default avatarKento Kobayashi <Kento.A.Kobayashi@sony.com>
      Tested-by: default avatarKento Kobayashi <Kento.A.Kobayashi@sony.com>
      CC: Bart Van Assche <bvanassche@acm.org>
      CC: Martin K. Petersen <martin.petersen@oracle.com>
      CC: Jacky Cao <Jacky.Cao@sony.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      381419fa
    • Marc Gonzalez's avatar
      phy: qcom-qmp: Add msm8998 PCIe QMP PHY support · 73d7ec89
      Marc Gonzalez authored
      Documentation for this PHY, and the proper configuration settings,
      is *not* publicly available. Therefore the initialization sequence
      is copied wholesale from downstream:
      
      https://source.codeaurora.org/quic/la/kernel/msm-4.4/tree/arch/arm/boot/dts/qcom/msm8998-v2.dtsi?h=LE.UM.1.3.r3.25#n372Reviewed-by: default avatarVivek Gautam <vivek.gautam@codeaurora.org>
      Signed-off-by: default avatarMarc Gonzalez <marc.w.gonzalez@free.fr>
      Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      73d7ec89
    • Roger Quadros's avatar
      phy: ti: am654-serdes: Support all clksel values · 7e7b8ca6
      Roger Quadros authored
      Add support to select all 16 CLKSEL combinations that are shown in
      "SerDes Reference Clock Distribution" in AM65 TRM.
      Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
      Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      7e7b8ca6
    • Kishon Vijay Abraham I's avatar
      phy: ti: Add a new SERDES driver for TI's AM654x SoC · 71e2f5c5
      Kishon Vijay Abraham I authored
      Add a new SERDES driver for TI's AM654x SoC which configures
      the SERDES only for PCIe. Support fo USB3 will be added later.
      
      SERDES in am654x has three input clocks (left input, externel reference
      clock and right input) and two output clocks (left output and right
      output) in addition to a PLL mux clock which the SERDES uses for Clock
      Multiplier Unit (CMU refclock).
      
      The PLL mux clock can select from one of the three input clocks.
      The right output can select between left input and external reference
      clock while the left output can select between the right input and
      external reference clock.
      
      The driver has support to select PLL mux and left/right output mux as
      specified in device tree.
      
      [rogerq@ti.com: Fix boot lockup caused by accessing a structure member
      (hw->init) allocated in stack of probe() and accessed in get_parent]
      [rogerq@ti.com: Fix "Failed to find the parent" warnings]
      Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
      Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      71e2f5c5
    • Kishon Vijay Abraham I's avatar
      dt-bindings: phy: ti: Add dt binding documentation for SERDES in AM654x SoC · 4e0ae876
      Kishon Vijay Abraham I authored
      AM654x has two SERDES instances. Each instance has three input clocks
      (left input, externel reference clock and right input) and two output
      clocks (left output and right output) in addition to a PLL mux clock
      which the SERDES uses for Clock Multiplier Unit (CMU refclock).
      The PLL mux clock can select from one of the three input clocks.
      The right output can select between left input and external reference
      clock while the left output can select between the right input and
      external reference clock.
      
      The left and right input reference clock of SERDES0 and SERDES1
      respectively are connected to the SoC clock. In the case of two lane
      SERDES personality card, the left input of SERDES1 is connected to
      the right output of SERDES0 in a chained fashion.
      
      See section "Reference Clock Distribution" of AM65x Sitara Processors
      TRM (SPRUID7 – April 2018) for more details.
      
      Add dt-binding documentation in order to represent all these different
      configurations in device tree.
      Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      4e0ae876
    • Kishon Vijay Abraham I's avatar
      phy: core: Invoke pm_runtime_get_*/pm_runtime_put_* before invoking reset callback · 4df614c4
      Kishon Vijay Abraham I authored
      PHY drivers may try to access PHY registers in the ->reset() callback.
      Invoke phy_pm_runtime_get_sync() before invoking the ->reset() callback
      so that the PHY drivers don't have to enable clocks by themselves before
      accessing PHY registers.
      Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      4df614c4
    • Kishon Vijay Abraham I's avatar
      phy: core: Add *release* phy_ops invoked when the consumer relinquishes PHY · fec06b2b
      Kishon Vijay Abraham I authored
      Add a new phy_ops *release* invoked when the consumer relinquishes the
      PHY using phy_put/devm_phy_put. The initializations done by the PHY
      driver in of_xlate call back can be can be cleaned up here.
      Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      fec06b2b