thunderbolt: Fixes for v6.4-rc6

This includes following fixes for v6.4-rc6:
 
   - Fix DMA test driver to pass correct values when only RX or TX ring
     is used
   - Increase timeout when DisplayPort tunnel is established to cope with
     a VGA/DVI dongle connected to a dock
   - Do not enable CL states when BIOS connnection manager already
     created the tunnels
   - Correct the ring interrupt masking to work again in Intel hardware
     on resume from system sleep states.
 
 All these have been in linux-next with no reported issues.
 -----BEGIN PGP SIGNATURE-----
 
 iQJUBAABCgA+FiEEVTdhRGBbNzLrSUBaAP2fSd+ZWKAFAmR9g80gHG1pa2Eud2Vz
 dGVyYmVyZ0BsaW51eC5pbnRlbC5jb20ACgkQAP2fSd+ZWKClmw/+IEZ2sncJham7
 lng7GmkyGhw0zaJrTtsKZ7KZF0E0PnSUr5GhQZzTSJVUfhTtn3j+uQvamtlydZXS
 jsbo/muAto9+vTKfbL7naro2/cDV1anoeHJqOAjgfG02N9lZ6qv4UizDwBP9EawW
 oDdKe9TjYCzMlfSypLRCaUa2KY5ls46cXSzh90rKdG+mrKpmBPoY8kLzJKWKmZNS
 r4SnQKpBjWuqdN4LDetZFr9rfELw7ZbNDj70FA54pk8BT6wMFhFZuPyqckAhba8o
 +XJk8Njtd2r/S1Xi6ZIr750AHgxal+grUbLME93A0bXgX6ZgzzhxnBCWF/6VPgtr
 eN32we+DDbzpUnt2CzBQS5j2EyHsyVs3DdpmN3S4CLrWaalYvq/wv16QEA13zx/a
 cFlaK1lfGyeUq0GV/8l8QidNgr88CzdKsw6n37XEj4lObtwc7OYpTZG3DQIZ7gtc
 clS7RsiaOAZQ15lRuO9qCT+KG6AtmXBmWxCRQggHNzoFOLIIl/fS656HEdFZQg2U
 4xZI/YYVw78ydcAHW3DAh6V7j3uyLzzJF339oebYJ00+zuVixnewdELZEyvZFF66
 PixfFz8Ln42N7oeavlc1YW29cEY880sYZRXrEtCARzT34bi1Z8VVgQEjwZtliN4l
 Av29yeRy9v/fRBVum2npt7E7fDP96F0=
 =zA+u
 -----END PGP SIGNATURE-----

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

Mika writes:

thunderbolt: Fixes for v6.4-rc6

This includes following fixes for v6.4-rc6:

  - Fix DMA test driver to pass correct values when only RX or TX ring
    is used
  - Increase timeout when DisplayPort tunnel is established to cope with
    a VGA/DVI dongle connected to a dock
  - Do not enable CL states when BIOS connnection manager already
    created the tunnels
  - Correct the ring interrupt masking to work again in Intel hardware
    on resume from system sleep states.

All these have been in linux-next with no reported issues.

* tag 'thunderbolt-for-v6.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt:
  thunderbolt: Mask ring interrupt on Intel hardware as well
  thunderbolt: Do not touch CL state configuration during discovery
  thunderbolt: Increase DisplayPort Connection Manager handshake timeout
  thunderbolt: dma_test: Use correct value for absent rings when creating paths
This commit is contained in:
Greg Kroah-Hartman 2023-06-05 12:55:06 +02:00
commit 592295e61b
4 changed files with 25 additions and 13 deletions

View File

@ -192,9 +192,9 @@ static int dma_test_start_rings(struct dma_test *dt)
}
ret = tb_xdomain_enable_paths(dt->xd, dt->tx_hopid,
dt->tx_ring ? dt->tx_ring->hop : 0,
dt->tx_ring ? dt->tx_ring->hop : -1,
dt->rx_hopid,
dt->rx_ring ? dt->rx_ring->hop : 0);
dt->rx_ring ? dt->rx_ring->hop : -1);
if (ret) {
dma_test_free_rings(dt);
return ret;
@ -218,9 +218,9 @@ static void dma_test_stop_rings(struct dma_test *dt)
tb_ring_stop(dt->tx_ring);
ret = tb_xdomain_disable_paths(dt->xd, dt->tx_hopid,
dt->tx_ring ? dt->tx_ring->hop : 0,
dt->tx_ring ? dt->tx_ring->hop : -1,
dt->rx_hopid,
dt->rx_ring ? dt->rx_ring->hop : 0);
dt->rx_ring ? dt->rx_ring->hop : -1);
if (ret)
dev_warn(&dt->svc->dev, "failed to disable DMA paths\n");

View File

@ -56,9 +56,14 @@ static int ring_interrupt_index(const struct tb_ring *ring)
static void nhi_mask_interrupt(struct tb_nhi *nhi, int mask, int ring)
{
if (nhi->quirks & QUIRK_AUTO_CLEAR_INT)
return;
iowrite32(mask, nhi->iobase + REG_RING_INTERRUPT_MASK_CLEAR_BASE + ring);
if (nhi->quirks & QUIRK_AUTO_CLEAR_INT) {
u32 val;
val = ioread32(nhi->iobase + REG_RING_INTERRUPT_BASE + ring);
iowrite32(val & ~mask, nhi->iobase + REG_RING_INTERRUPT_BASE + ring);
} else {
iowrite32(mask, nhi->iobase + REG_RING_INTERRUPT_MASK_CLEAR_BASE + ring);
}
}
static void nhi_clear_interrupt(struct tb_nhi *nhi, int ring)

View File

@ -737,6 +737,7 @@ static void tb_scan_port(struct tb_port *port)
{
struct tb_cm *tcm = tb_priv(port->sw->tb);
struct tb_port *upstream_port;
bool discovery = false;
struct tb_switch *sw;
int ret;
@ -804,8 +805,10 @@ static void tb_scan_port(struct tb_port *port)
* tunnels and know which switches were authorized already by
* the boot firmware.
*/
if (!tcm->hotplug_active)
if (!tcm->hotplug_active) {
dev_set_uevent_suppress(&sw->dev, true);
discovery = true;
}
/*
* At the moment Thunderbolt 2 and beyond (devices with LC) we
@ -835,10 +838,14 @@ static void tb_scan_port(struct tb_port *port)
* CL0s and CL1 are enabled and supported together.
* Silently ignore CLx enabling in case CLx is not supported.
*/
ret = tb_switch_enable_clx(sw, TB_CL1);
if (ret && ret != -EOPNOTSUPP)
tb_sw_warn(sw, "failed to enable %s on upstream port\n",
tb_switch_clx_name(TB_CL1));
if (discovery) {
tb_sw_dbg(sw, "discovery, not touching CL states\n");
} else {
ret = tb_switch_enable_clx(sw, TB_CL1);
if (ret && ret != -EOPNOTSUPP)
tb_sw_warn(sw, "failed to enable %s on upstream port\n",
tb_switch_clx_name(TB_CL1));
}
if (tb_switch_is_clx_enabled(sw, TB_CL1))
/*

View File

@ -526,7 +526,7 @@ static int tb_dp_xchg_caps(struct tb_tunnel *tunnel)
* Perform connection manager handshake between IN and OUT ports
* before capabilities exchange can take place.
*/
ret = tb_dp_cm_handshake(in, out, 1500);
ret = tb_dp_cm_handshake(in, out, 3000);
if (ret)
return ret;