1. 19 May, 2022 4 commits
    • Dmitry Torokhov's avatar
      usb: Probe EHCI, OHCI controllers asynchronously · 69a1c9a9
      Dmitry Torokhov authored
      initcall_debug shows that OHCI controllers take ~60ms to probe on
      Rockchip RK3399 systems:
      
        probe of fe3a0000.usb returned 1 after 58941 usecs
      
      A few of these can add up to waste non-trivial amounts of time at boot.
      
      These host controllers don't provide resources to other drivers, so
      this shouldn't contribute to exposing race conditions.
      
      Chrome OS kernels have carried this patch on some systems for a while
      without issues. Similar patches have been merged for a variety of (e)MMC
      host controllers for similar reasons.
      
      [Brian: rewrote commit message, refreshed, but retained dtor's original
       authorship ]
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarDmitry Torokhov <dtor@chromium.org>
      Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
      Link: https://lore.kernel.org/r/20220518150150.1.Ie8ea0e945a9c15066237014be219eed60066d493@changeidSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      69a1c9a9
    • Linus Walleij's avatar
      usb: isp1760: Fix out-of-bounds array access · 26ae2c94
      Linus Walleij authored
      Running the driver through kasan gives an interesting splat:
      
        BUG: KASAN: global-out-of-bounds in isp1760_register+0x180/0x70c
        Read of size 20 at addr f1db2e64 by task swapper/0/1
        (...)
        isp1760_register from isp1760_plat_probe+0x1d8/0x220
        (...)
      
      This happens because the loop reading the regmap fields for the
      different ISP1760 variants look like this:
      
        for (i = 0; i < HC_FIELD_MAX; i++) { ... }
      
      Meaning it expects the arrays to be at least HC_FIELD_MAX - 1 long.
      
      However the arrays isp1760_hc_reg_fields[], isp1763_hc_reg_fields[],
      isp1763_hc_volatile_ranges[] and isp1763_dc_volatile_ranges[] are
      dynamically sized during compilation.
      
      Fix this by putting an empty assignment to the [HC_FIELD_MAX]
      and [DC_FIELD_MAX] array member at the end of each array.
      This will make the array one member longer than it needs to be,
      but avoids the risk of overwriting whatever is inside
      [HC_FIELD_MAX - 1] and is simple and intuitive to read. Also
      add comments explaining what is going on.
      
      Fixes: 1da9e1c0 ("usb: isp1760: move to regmap for register access")
      Cc: stable@vger.kernel.org
      Cc: Rui Miguel Silva <rui.silva@linaro.org>
      Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
      Reviewed-by: default avatarRui Miguel Silva <rui.silva@linaro.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Link: https://lore.kernel.org/r/20220516091424.391209-1-linus.walleij@linaro.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      26ae2c94
    • Mathias Nyman's avatar
      xhci: Don't defer primary roothub registration if there is only one roothub · 1bd8bb7d
      Mathias Nyman authored
      The support for xHCI controllers with only one roothub, and the code
      to defer primary roothub registation until second roothub got merged
      to usb-next for 5.19 at the same time.
      
      commit 873f3236 ("xhci: prepare for operation w/o shared hcd")
      commit b7a4f9b5 ("xhci: Set HCD flag to defer primary roothub
      registration")
      
      These got merged in such a way that the flag to defer primary roothub
      registration is set even for xHC controllers with just one roothub.
      
      Fix this by setting the defer flag in a codepath taken only if we have
      two roothubs
      
      Fixes: 873f3236 ("xhci: prepare for operation w/o shared hcd")
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Link: https://lore.kernel.org/r/20220516094850.19788-2-mathias.nyman@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1bd8bb7d
    • Greg Kroah-Hartman's avatar
      Merge tag 'thunderbolt-for-v5.19-rc1' of... · 376d6b02
      Greg Kroah-Hartman authored
      Merge tag 'thunderbolt-for-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next
      
      Mika writes:
      
      thunderbolt: Changes for v5.19 merge window
      
      This includes following Thunderbolt/USB4 changes for the v5.19 merge
      window:
      
        * Improvements for Thunderbolt 1 DisplayPort tunneling
        * Link USB4 ports to their USB Type-C connectors
        * Lane bonding support for host-to-host (XDomain) connections
        * Buffer allocation improvement for devices with no DisplayPort
          adapters
        * Few cleanups and minor fixes.
      
      All these have been in linux-next with no reported issues except that
      there is a minor merge conflict with the kunit-next tree because one of
      the commits touches the driver KUnit tests.
      
      * tag 'thunderbolt-for-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt:
        thunderbolt: Add KUnit test for devices with no DisplayPort adapters
        thunderbolt: Fix buffer allocation of devices with no DisplayPort adapters
        thunderbolt: Add support for XDomain lane bonding
        thunderbolt: Ignore port locked error in tb_port_wait_for_link_width()
        thunderbolt: Split setting link width and lane bonding into own functions
        thunderbolt: Move tb_port_state() prototype to correct place
        thunderbolt: Add debug logging when lane is enabled/disabled
        thunderbolt: Link USB4 ports to their USB Type-C connectors
        misc/mei: Add NULL check to component match callback functions
        thunderbolt: Use different lane for second DisplayPort tunnel
        thunderbolt: Dump path config space entries during discovery
        thunderbolt: Use decimal number with port numbers
        thunderbolt: Fix typo in comment
        thunderbolt: Replace usage of found with dedicated list iterator variable
      376d6b02
  2. 12 May, 2022 18 commits
  3. 11 May, 2022 1 commit
  4. 05 May, 2022 17 commits