Skip to content

Commit 7af9da8

Browse files
Sanjay R Mehtawesteri
authored andcommitted
thunderbolt: Add quirk to disable CLx
Add QUIRK_NO_CLX to disable the CLx state for hardware which doesn't supports it. AMD Yellow Carp and Pink Sardine don't support CLx state, hence disabling it using QUIRK_NO_CLX. Cc: [email protected] Signed-off-by: Sanjay R Mehta <[email protected]> Signed-off-by: Basavaraj Natikar <[email protected]> [mw: added debug log when the quirk is run] Signed-off-by: Mika Westerberg <[email protected]>
1 parent fe15c26 commit 7af9da8

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

drivers/thunderbolt/quirks.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ static void quirk_dp_credit_allocation(struct tb_switch *sw)
2020
}
2121
}
2222

23+
static void quirk_clx_disable(struct tb_switch *sw)
24+
{
25+
sw->quirks |= QUIRK_NO_CLX;
26+
tb_sw_dbg(sw, "disabling CL states\n");
27+
}
28+
2329
struct tb_quirk {
2430
u16 hw_vendor_id;
2531
u16 hw_device_id;
@@ -37,6 +43,13 @@ static const struct tb_quirk tb_quirks[] = {
3743
* DP buffers.
3844
*/
3945
{ 0x8087, 0x0b26, 0x0000, 0x0000, quirk_dp_credit_allocation },
46+
/*
47+
* CLx is not supported on AMD USB4 Yellow Carp and Pink Sardine platforms.
48+
*/
49+
{ 0x0438, 0x0208, 0x0000, 0x0000, quirk_clx_disable },
50+
{ 0x0438, 0x0209, 0x0000, 0x0000, quirk_clx_disable },
51+
{ 0x0438, 0x020a, 0x0000, 0x0000, quirk_clx_disable },
52+
{ 0x0438, 0x020b, 0x0000, 0x0000, quirk_clx_disable },
4053
};
4154

4255
/**

drivers/thunderbolt/tb.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
#define NVM_MAX_SIZE SZ_512K
2424
#define NVM_DATA_DWORDS 16
2525

26+
/* Keep link controller awake during update */
27+
#define QUIRK_FORCE_POWER_LINK_CONTROLLER BIT(0)
28+
/* Disable CLx if not supported */
29+
#define QUIRK_NO_CLX BIT(1)
30+
2631
/**
2732
* struct tb_nvm - Structure holding NVM information
2833
* @dev: Owner of the NVM
@@ -1019,6 +1024,9 @@ static inline bool tb_switch_is_clx_enabled(const struct tb_switch *sw,
10191024
*/
10201025
static inline bool tb_switch_is_clx_supported(const struct tb_switch *sw)
10211026
{
1027+
if (sw->quirks & QUIRK_NO_CLX)
1028+
return false;
1029+
10221030
return tb_switch_is_usb4(sw) || tb_switch_is_titan_ridge(sw);
10231031
}
10241032

@@ -1291,9 +1299,6 @@ struct usb4_port *usb4_port_device_add(struct tb_port *port);
12911299
void usb4_port_device_remove(struct usb4_port *usb4);
12921300
int usb4_port_device_resume(struct usb4_port *usb4);
12931301

1294-
/* Keep link controller awake during update */
1295-
#define QUIRK_FORCE_POWER_LINK_CONTROLLER BIT(0)
1296-
12971302
void tb_check_quirks(struct tb_switch *sw);
12981303

12991304
#ifdef CONFIG_ACPI

0 commit comments

Comments
 (0)