1. 27 Oct, 2023 4 commits
    • Luca Weiss's avatar
      usb: typec: fsa4480: Add support to swap SBU orientation · cf07c55f
      Luca Weiss authored
      On some hardware designs the AUX+/- lanes are connected reversed to
      SBU1/2 compared to the expected design by FSA4480.
      
      Made more complicated, the otherwise compatible Orient-Chip OCP96011
      expects the lanes to be connected reversed compared to FSA4480.
      
      * FSA4480 block diagram shows AUX+ connected to SBU2 and AUX- to SBU1.
      * OCP96011 block diagram shows AUX+ connected to SBU1 and AUX- to SBU2.
      
      So if OCP96011 is used as drop-in for FSA4480 then the orientation
      handling in the driver needs to be reversed to match the expectation of
      the OCP96011 hardware.
      
      Support parsing the data-lanes parameter in the endpoint node to swap
      this in the driver.
      
      The parse_data_lanes_mapping function is mostly taken from nb7vpq904m.c.
      Reviewed-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
      Signed-off-by: default avatarLuca Weiss <luca.weiss@fairphone.com>
      Link: https://lore.kernel.org/r/20231020-fsa4480-swap-v2-2-9a7f9bb59873@fairphone.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cf07c55f
    • Luca Weiss's avatar
      dt-bindings: usb: fsa4480: Add data-lanes property to endpoint · fad89aa1
      Luca Weiss authored
      Allow specifying data-lanes to reverse the muxing orientation between
      AUX+/- and SBU1/2 where necessary by the hardware design.
      
      In the mux there's a switch that needs to be controlled from the OS, and
      it either connects AUX+ -> SBU1 and AUX- -> SBU2, or the reverse: AUX+
      -> SBU2 and AUX- -> SBU1, depending on the orientation of how the USB-C
      connector is plugged in.
      
      With this data-lanes property we can now specify that AUX+ and AUX-
      connections are swapped between the SoC and the mux, therefore the OS
      needs to consider this and reverse the direction of this switch in the
      mux.
      
      _______          _______
            |          |     |
            |-- HP   --|     |
            |-- MIC  --|     |or
      SoC   |          | MUX |-- SBU1 --->  To the USB-C
      Codec |-- AUX+ --|     |-- SBU2 --->  connected
            |-- AUX- --|     |
      ______|          |_____|
      
      (thanks to Neil Armstrong for this ASCII art)
      Signed-off-by: default avatarLuca Weiss <luca.weiss@fairphone.com>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Link: https://lore.kernel.org/r/20231020-fsa4480-swap-v2-1-9a7f9bb59873@fairphone.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fad89aa1
    • Jimmy Hu's avatar
      usb: typec: tcpm: Fix NULL pointer dereference in tcpm_pd_svdm() · 4987daf8
      Jimmy Hu authored
      It is possible that typec_register_partner() returns ERR_PTR on failure.
      When port->partner is an error, a NULL pointer dereference may occur as
      shown below.
      
      [91222.095236][  T319] typec port0: failed to register partner (-17)
      ...
      [91225.061491][  T319] Unable to handle kernel NULL pointer dereference
      at virtual address 000000000000039f
      [91225.274642][  T319] pc : tcpm_pd_data_request+0x310/0x13fc
      [91225.274646][  T319] lr : tcpm_pd_data_request+0x298/0x13fc
      [91225.308067][  T319] Call trace:
      [91225.308070][  T319]  tcpm_pd_data_request+0x310/0x13fc
      [91225.308073][  T319]  tcpm_pd_rx_handler+0x100/0x9e8
      [91225.355900][  T319]  kthread_worker_fn+0x178/0x58c
      [91225.355902][  T319]  kthread+0x150/0x200
      [91225.355905][  T319]  ret_from_fork+0x10/0x30
      
      Add a check for port->partner to avoid dereferencing a NULL pointer.
      
      Fixes: 5e1d4c49 ("usb: typec: tcpm: Determine common SVDM Version")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJimmy Hu <hhhuuu@google.com>
      Link: https://lore.kernel.org/r/20231020012132.100960-1-hhhuuu@google.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4987daf8
    • Greg Kroah-Hartman's avatar
      Merge tag 'thunderbolt-for-v6.7-rc1' of... · 9b6db9a3
      Greg Kroah-Hartman authored
      Merge tag 'thunderbolt-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next
      
      Mika writes:
      
      thunderbolt: Changes for v6.7 merge window
      
      This includes following USB4/Thunderbolt changes for the v6.7 merge
      window:
      
        - Configure asymmetric link if the DisplayPort bandwidth requires so
        - Enable path power management packet support for USB4 v2 routers
        - Make the bandwidth reservations to follow the USB4 v2 connection
          manager guide suggestions
        - DisplayPort tunneling improvements
        - Small cleanups and improvements around the driver.
      
      All these have been in linux-next with no reported issues.
      
      * tag 'thunderbolt-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: (25 commits)
        thunderbolt: Fix one kernel-doc comment
        thunderbolt: Configure asymmetric link if needed and bandwidth allows
        thunderbolt: Add support for asymmetric link
        thunderbolt: Introduce tb_switch_depth()
        thunderbolt: Introduce tb_for_each_upstream_port_on_path()
        thunderbolt: Introduce tb_port_path_direction_downstream()
        thunderbolt: Set path power management packet support bit for USB4 v2 routers
        thunderbolt: Change bandwidth reservations to comply USB4 v2
        thunderbolt: Make is_gen4_link() available to the rest of the driver
        thunderbolt: Use weight constants in tb_usb3_consumed_bandwidth()
        thunderbolt: Use constants for path weight and priority
        thunderbolt: Add DP IN added last in the head of the list of DP resources
        thunderbolt: Create multiple DisplayPort tunnels if there are more DP IN/OUT pairs
        thunderbolt: Log NVM version of routers and retimers
        thunderbolt: Use tb_tunnel_xxx() log macros in tb.c
        thunderbolt: Expose tb_tunnel_xxx() log macros to the rest of the driver
        thunderbolt: Use tb_tunnel_dbg() where possible to make logging more consistent
        thunderbolt: Fix typo of HPD bit for Hot Plug Detect
        thunderbolt: Fix typo in enum tb_link_width kernel-doc
        thunderbolt: Fix debug log when DisplayPort adapter not available for pairing
        ...
      9b6db9a3
  2. 24 Oct, 2023 3 commits
  3. 21 Oct, 2023 33 commits