Skip to content

Commit 92fd9bf

Browse files
committed
Merge tag 'thunderbolt-fixes-for-v5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into char-misc-next
Mika writes: thunderbolt: Fixes for v5.4 This includes three fixes for various issues people have reported: - Fix DP tunneling on some Light Ridge controllers - Fix for lockdep circular locking dependency warning - Drop unnecessary read on ICL * tag 'thunderbolt-fixes-for-v5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Drop unnecessary read when writing LC command in Ice Lake thunderbolt: Fix lockdep circular locking depedency warning thunderbolt: Read DP IN adapter first two dwords in one go
2 parents 5e0eb05 + 747125d commit 92fd9bf

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

drivers/thunderbolt/nhi_ops.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ static void icl_nhi_lc_mailbox_cmd(struct tb_nhi *nhi, enum icl_lc_mailbox_cmd c
8080
{
8181
u32 data;
8282

83-
pci_read_config_dword(nhi->pdev, VS_CAP_19, &data);
8483
data = (cmd << VS_CAP_19_CMD_SHIFT) & VS_CAP_19_CMD_MASK;
8584
pci_write_config_dword(nhi->pdev, VS_CAP_19, data | VS_CAP_19_VALID);
8685
}

drivers/thunderbolt/switch.c

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -896,12 +896,13 @@ int tb_dp_port_set_hops(struct tb_port *port, unsigned int video,
896896
*/
897897
bool tb_dp_port_is_enabled(struct tb_port *port)
898898
{
899-
u32 data;
899+
u32 data[2];
900900

901-
if (tb_port_read(port, &data, TB_CFG_PORT, port->cap_adap, 1))
901+
if (tb_port_read(port, data, TB_CFG_PORT, port->cap_adap,
902+
ARRAY_SIZE(data)))
902903
return false;
903904

904-
return !!(data & (TB_DP_VIDEO_EN | TB_DP_AUX_EN));
905+
return !!(data[0] & (TB_DP_VIDEO_EN | TB_DP_AUX_EN));
905906
}
906907

907908
/**
@@ -914,19 +915,21 @@ bool tb_dp_port_is_enabled(struct tb_port *port)
914915
*/
915916
int tb_dp_port_enable(struct tb_port *port, bool enable)
916917
{
917-
u32 data;
918+
u32 data[2];
918919
int ret;
919920

920-
ret = tb_port_read(port, &data, TB_CFG_PORT, port->cap_adap, 1);
921+
ret = tb_port_read(port, data, TB_CFG_PORT, port->cap_adap,
922+
ARRAY_SIZE(data));
921923
if (ret)
922924
return ret;
923925

924926
if (enable)
925-
data |= TB_DP_VIDEO_EN | TB_DP_AUX_EN;
927+
data[0] |= TB_DP_VIDEO_EN | TB_DP_AUX_EN;
926928
else
927-
data &= ~(TB_DP_VIDEO_EN | TB_DP_AUX_EN);
929+
data[0] &= ~(TB_DP_VIDEO_EN | TB_DP_AUX_EN);
928930

929-
return tb_port_write(port, &data, TB_CFG_PORT, port->cap_adap, 1);
931+
return tb_port_write(port, data, TB_CFG_PORT, port->cap_adap,
932+
ARRAY_SIZE(data));
930933
}
931934

932935
/* switch utility functions */
@@ -1031,13 +1034,6 @@ static int tb_switch_set_authorized(struct tb_switch *sw, unsigned int val)
10311034
if (sw->authorized)
10321035
goto unlock;
10331036

1034-
/*
1035-
* Make sure there is no PCIe rescan ongoing when a new PCIe
1036-
* tunnel is created. Otherwise the PCIe rescan code might find
1037-
* the new tunnel too early.
1038-
*/
1039-
pci_lock_rescan_remove();
1040-
10411037
switch (val) {
10421038
/* Approve switch */
10431039
case 1:
@@ -1057,8 +1053,6 @@ static int tb_switch_set_authorized(struct tb_switch *sw, unsigned int val)
10571053
break;
10581054
}
10591055

1060-
pci_unlock_rescan_remove();
1061-
10621056
if (!ret) {
10631057
sw->authorized = val;
10641058
/* Notify status change to the userspace */

0 commit comments

Comments
 (0)