]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
d5c4ccc0355b34c3b5fca1f6a46cabec7693d1ea
[thirdparty/kernel/stable-queue.git] /
1 From 8e3341257e3b5774ec8cd3ef1ba0c0d3fada322b Mon Sep 17 00:00:00 2001
2 From: Mika Westerberg <mika.westerberg@linux.intel.com>
3 Date: Tue, 27 Jul 2021 17:25:01 +0300
4 Subject: Revert "thunderbolt: Hide authorized attribute if router does not support PCIe tunnels"
5
6 From: Mika Westerberg <mika.westerberg@linux.intel.com>
7
8 commit 8e3341257e3b5774ec8cd3ef1ba0c0d3fada322b upstream.
9
10 This reverts commit 6f3badead6a078cf3c71f381f9d84ac922984a00.
11
12 It turns out bolt depends on having authorized attribute visible under
13 each device. Hiding it makes bolt crash as several people have reported
14 on various bug trackers. For this reason revert the commit.
15
16 Link: https://gitlab.freedesktop.org/bolt/bolt/-/issues/174
17 Link: https://bugzilla.redhat.com/show_bug.cgi?id=1979765
18 Link: https://bugs.archlinux.org/task/71569
19 Cc: stable@vger.kernel.org
20 Cc: Christian Kellner <ckellner@redhat.com>
21 Fixes: 6f3badead6a0 ("thunderbolt: Hide authorized attribute if router does not support PCIe tunnels")
22 Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
23 Link: https://lore.kernel.org/r/20210727142501.27476-1-mika.westerberg@linux.intel.com
24 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25 ---
26 drivers/thunderbolt/switch.c | 15 +--------------
27 1 file changed, 1 insertion(+), 14 deletions(-)
28
29 --- a/drivers/thunderbolt/switch.c
30 +++ b/drivers/thunderbolt/switch.c
31 @@ -1740,18 +1740,6 @@ static struct attribute *switch_attrs[]
32 NULL,
33 };
34
35 -static bool has_port(const struct tb_switch *sw, enum tb_port_type type)
36 -{
37 - const struct tb_port *port;
38 -
39 - tb_switch_for_each_port(sw, port) {
40 - if (!port->disabled && port->config.type == type)
41 - return true;
42 - }
43 -
44 - return false;
45 -}
46 -
47 static umode_t switch_attr_is_visible(struct kobject *kobj,
48 struct attribute *attr, int n)
49 {
50 @@ -1760,8 +1748,7 @@ static umode_t switch_attr_is_visible(st
51
52 if (attr == &dev_attr_authorized.attr) {
53 if (sw->tb->security_level == TB_SECURITY_NOPCIE ||
54 - sw->tb->security_level == TB_SECURITY_DPONLY ||
55 - !has_port(sw, TB_TYPE_PCIE_UP))
56 + sw->tb->security_level == TB_SECURITY_DPONLY)
57 return 0;
58 } else if (attr == &dev_attr_device.attr) {
59 if (!sw->device)