thunderbolt: Fixes for v6.0-rc3

This includes two fixes: one that corrects the buffer usage in
 tb_async_error() and another one that limits the xHCI connect operations
 to Thunderbolt 3 routers.
 
 Both have been in linux-next with no reported issues.
 -----BEGIN PGP SIGNATURE-----
 
 iQJUBAABCgA+FiEEVTdhRGBbNzLrSUBaAP2fSd+ZWKAFAmMDSIcgHG1pa2Eud2Vz
 dGVyYmVyZ0BsaW51eC5pbnRlbC5jb20ACgkQAP2fSd+ZWKDbgxAAgLR9yk92j4xQ
 vMUmnrJs3MQweei5Oq5r9ADiCVmgUMWFhkdXhpugvtDf5xy1xSD+BGHAI58JD38C
 3LIkc34BvQ6+Lh4J0q2WHIl82UfihSw9kHgziUhwgnM2Zmj1F3HS3PTz3SbdYhUP
 St3Gy4cRDvg+dC+pD4gc/fwpkdLrdDbRSF2a3gshYtMulGVckOj/Kw77oILi0Bnc
 Mcv0BleOP4qB3CYjR1qrq1B0iYKo9E+YAZQ66IciIHLjpaKty5XQkJT3TNDYdFLD
 TnMOebelGGWU12Iv+Bhi8LWQgtuqgUzDpp23LizleFC7v/i4/ehjmE7qyLGtG6If
 t2yUscjxp9XZvCEUIG9GXuwNHa1BOS41FIidXLdrG07f8mG4fRqLYqEIXMbAR8ci
 EZzi6HJGLA0GBMeog7Qj0+7eYvoDB6plxouTokI4O9hp9MA55q2Dn/d0uz+7phsI
 pVN47Jg4qZZWgSfJsnsLLFVuQKMc9eHQWv30q7klYnMbS9tYP5mam4KjRJOnb2gd
 u/SBgaDYX6qHYiKBRuXAiLW3BKIFe5AgbIi4qaB+z5urWPtSqLN+3laWmHeIDUva
 XpW7y14FR4J/BeO/vLgKFSJTGZJIk3kFFGvtdAjTWLiGzNZyzHN53nK1qTPPvuwZ
 ILI/cHvbz8qw8oSgnjfqfb7QWn4Oq58=
 =H+st
 -----END PGP SIGNATURE-----

Merge tag 'thunderbolt-for-v6.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-linus

Mika writes:
  "thunderbolt: Fixes for v6.0-rc3

  This includes two fixes: one that corrects the buffer usage in
  tb_async_error() and another one that limits the xHCI connect operations
  to Thunderbolt 3 routers.

  Both have been in linux-next with no reported issues."

* tag 'thunderbolt-for-v6.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt:
  thunderbolt: Check router generation before connecting xHCI
  thunderbolt: Use the actual buffer in tb_async_error()
This commit is contained in:
Greg Kroah-Hartman 2022-08-22 17:40:44 +02:00
commit 8d1e09cfbd
2 changed files with 6 additions and 2 deletions

View File

@ -407,7 +407,7 @@ static void tb_ctl_rx_submit(struct ctl_pkg *pkg)
static int tb_async_error(const struct ctl_pkg *pkg)
{
const struct cfg_error_pkg *error = (const struct cfg_error_pkg *)pkg;
const struct cfg_error_pkg *error = pkg->buffer;
if (pkg->frame.eof != TB_CFG_PKG_ERROR)
return false;

View File

@ -3786,14 +3786,18 @@ int tb_switch_pcie_l1_enable(struct tb_switch *sw)
*/
int tb_switch_xhci_connect(struct tb_switch *sw)
{
bool usb_port1, usb_port3, xhci_port1, xhci_port3;
struct tb_port *port1, *port3;
int ret;
if (sw->generation != 3)
return 0;
port1 = &sw->ports[1];
port3 = &sw->ports[3];
if (tb_switch_is_alpine_ridge(sw)) {
bool usb_port1, usb_port3, xhci_port1, xhci_port3;
usb_port1 = tb_lc_is_usb_plugged(port1);
usb_port3 = tb_lc_is_usb_plugged(port3);
xhci_port1 = tb_lc_is_xhci_connected(port1);