thunderbolt: Disable CL states on older Titan Ridge firmware
Subsystems (2)
PATCH 2/2 thunderbolt: Disable CLx on Titan Ridge-based devices with old firmware
In reply to Mika WesterbergFrom: Rene Sapiens <[email protected]>
Thunderbolt 3 devices based on Titan Ridge routers with NVM firmware version < 0x65 have been observed to become unstable when CL states are enabled. This can lead to link disconnect events and the device failing to enumerate.
Enable CLx on Titan Ridge only when the running NVM firmware version is >= 0x65.
--- drivers/thunderbolt/quirks.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/thunderbolt/quirks.c +7 -0
@@ -23,6 +23,9 @@ static void quirk_dp_credit_allocation(struct tb_switch *sw)static void quirk_clx_disable (struct tb_switch *sw) { +if (tb_switch_is_titan_ridge (sw) && sw->nvm && sw->nvm->major >=0x65 ) +return ; + sw->quirks |=QUIRK_NO_CLX ;tb_sw_dbg (sw,"disabling CL states\n" ); }
@@ -61,6 +64,10 @@ static const struct tb_quirk tb_quirks[] = {/* Dell WD19TB supports self-authentication on unplug */ { 0x0000, 0x0000, 0x00d4, 0xb070, quirk_force_power_link }, { 0x0000, 0x0000, 0x00d4, 0xb071, quirk_force_power_link }, + +/* Intel Titan Ridge CLx is unstable on early firmware versions */ + { 0x8086, PCI_DEVICE_ID_INTEL_TITAN_RIDGE_DD_BRIDGE, 0x0000, 0x0000, + quirk_clx_disable },/* * Intel Goshen Ridge NVM 27 and before report wrong number of * DP buffers.
Signature · 1 line
2.50.1
PATCH 1/2 thunderbolt: Read router NVM version before applying quirks
In reply to Mika WesterbergFrom: Rene Sapiens <[email protected]>
The router NVM version is currently only available after the NVMem devices have been registered. This is too late for firmware-dependent quirks that are evaluated during tb_switch_add() before device registration.
Split router NVM handling into two phases:
- tb_switch_nvm_init() allocates the NVM object and reads the version
- tb_switch_nvm_add() registers the NVMem devices using the pre-read NVM
This makes the NVM major/minor version available before tb_check_quirks() without changing when the NVMem devices are registered.
--- drivers/thunderbolt/switch.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-)
drivers/thunderbolt/switch.c +26 -4
@@ -347,7 +347,7 @@ static int nvm_write(void *priv, unsigned int offset, void *val, size_t bytes)return ret; } -static int tb_switch_nvm_add (struct tb_switch *sw) +static int tb_switch_nvm_init (struct tb_switch *sw) {struct tb_nvm *nvm;int ret;
@@ -365,6 +365,26 @@ static int tb_switch_nvm_add(struct tb_switch *sw)if (ret) goto err_nvm; + sw->nvm = nvm; +return 0 ; + +err_nvm: +tb_sw_dbg (sw,"NVM upgrade disabled\n" ); + sw->no_nvm_upgrade = true; +if (!IS_ERR (nvm)) +tb_nvm_free (nvm); + +return ret; +} + +static int tb_switch_nvm_add (struct tb_switch *sw) +{ +struct tb_nvm *nvm = sw->nvm; +int ret; + +if (!nvm) +return 0 ; +/* * If the switch is in safe-mode the only accessible portion of * the NVM is the non-active one where userspace is expected to
@@ -383,14 +403,12 @@ static int tb_switch_nvm_add(struct tb_switch *sw) goto err_nvm; } - sw->nvm = nvm;return 0 ; err_nvm:tb_sw_dbg (sw,"NVM upgrade disabled\n" ); sw->no_nvm_upgrade = true; -if (!IS_ERR (nvm)) -tb_nvm_free (nvm); +tb_nvm_free (nvm);return ret; }
@@ -3311,6 +3329,10 @@ int tb_switch_add(struct tb_switch *sw)return ret; } + ret =tb_switch_nvm_init (sw); +if (ret) +return ret; +if (!sw->safe_mode) {tb_switch_credits_init (sw);
Signature · 1 line
2.50.1
cover thunderbolt: Disable CL states on older Titan Ridge firmware
Hi,
There is known issue on Titan Ridge with older firmware that makes the link unstable if CL states are enabled. This series adds a quirk that disables them for older NVM firmware.
Rene Sapiens (2):
thunderbolt: Read router NVM version before applying quirks
thunderbolt: Disable CLx on Titan Ridge-based devices with old firmware
drivers/thunderbolt/quirks.c | 7 +++++++ drivers/thunderbolt/switch.c | 30 ++++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-)
Signature · 1 line
2.50.1
Mika Westerberg
AppliedQuoted 9 lines · Mika Westerberg
Hi,
There is known issue on Titan Ridge with older firmware that makes the link unstable if CL states are enabled. This series adds a quirk that disables them for older NVM firmware.
Rene Sapiens (2):
thunderbolt: Read router NVM version before applying quirks
thunderbolt: Disable CLx on Titan Ridge-based devices with old firmware
Applied to thunderbolt.git/next.