Skip to content

Commit 8e33412

Browse files
westerigregkh
authored andcommitted
Revert "thunderbolt: Hide authorized attribute if router does not support PCIe tunnels"
This reverts commit 6f3bade. It turns out bolt depends on having authorized attribute visible under each device. Hiding it makes bolt crash as several people have reported on various bug trackers. For this reason revert the commit. Link: https://gitlab.freedesktop.org/bolt/bolt/-/issues/174 Link: https://bugzilla.redhat.com/show_bug.cgi?id=1979765 Link: https://bugs.archlinux.org/task/71569 Cc: [email protected] Cc: Christian Kellner <[email protected]> Fixes: 6f3bade ("thunderbolt: Hide authorized attribute if router does not support PCIe tunnels") Signed-off-by: Mika Westerberg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent bf88fef commit 8e33412

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

drivers/thunderbolt/switch.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,18 +1875,6 @@ static struct attribute *switch_attrs[] = {
18751875
NULL,
18761876
};
18771877

1878-
static bool has_port(const struct tb_switch *sw, enum tb_port_type type)
1879-
{
1880-
const struct tb_port *port;
1881-
1882-
tb_switch_for_each_port(sw, port) {
1883-
if (!port->disabled && port->config.type == type)
1884-
return true;
1885-
}
1886-
1887-
return false;
1888-
}
1889-
18901878
static umode_t switch_attr_is_visible(struct kobject *kobj,
18911879
struct attribute *attr, int n)
18921880
{
@@ -1895,8 +1883,7 @@ static umode_t switch_attr_is_visible(struct kobject *kobj,
18951883

18961884
if (attr == &dev_attr_authorized.attr) {
18971885
if (sw->tb->security_level == TB_SECURITY_NOPCIE ||
1898-
sw->tb->security_level == TB_SECURITY_DPONLY ||
1899-
!has_port(sw, TB_TYPE_PCIE_UP))
1886+
sw->tb->security_level == TB_SECURITY_DPONLY)
19001887
return 0;
19011888
} else if (attr == &dev_attr_device.attr) {
19021889
if (!sw->device)

0 commit comments

Comments
 (0)