All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "thunderbolt: Hide authorized attribute if router does not support PCIe tunnels"
@ 2021-07-27 14:25 Mika Westerberg
  2021-07-27 15:47 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Mika Westerberg @ 2021-07-27 14:25 UTC (permalink / raw)
  To: linux-usb
  Cc: Michael Jamet, Yehezkel Bernat, Christian Kellner, Lukas Wunner,
	Andreas Noever, Kai-Heng Feng, Mika Westerberg

This reverts commit 6f3badead6a078cf3c71f381f9d84ac922984a00.

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: stable@vger.kernel.org
Cc: Christian Kellner <ckellner@redhat.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/thunderbolt/switch.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 83b1ef3d5d03..10d6b228cc94 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -1875,18 +1875,6 @@ static struct attribute *switch_attrs[] = {
 	NULL,
 };
 
-static bool has_port(const struct tb_switch *sw, enum tb_port_type type)
-{
-	const struct tb_port *port;
-
-	tb_switch_for_each_port(sw, port) {
-		if (!port->disabled && port->config.type == type)
-			return true;
-	}
-
-	return false;
-}
-
 static umode_t switch_attr_is_visible(struct kobject *kobj,
 				      struct attribute *attr, int n)
 {
@@ -1895,8 +1883,7 @@ static umode_t switch_attr_is_visible(struct kobject *kobj,
 
 	if (attr == &dev_attr_authorized.attr) {
 		if (sw->tb->security_level == TB_SECURITY_NOPCIE ||
-		    sw->tb->security_level == TB_SECURITY_DPONLY ||
-		    !has_port(sw, TB_TYPE_PCIE_UP))
+		    sw->tb->security_level == TB_SECURITY_DPONLY)
 			return 0;
 	} else if (attr == &dev_attr_device.attr) {
 		if (!sw->device)
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "thunderbolt: Hide authorized attribute if router does not support PCIe tunnels"
  2021-07-27 14:25 [PATCH] Revert "thunderbolt: Hide authorized attribute if router does not support PCIe tunnels" Mika Westerberg
@ 2021-07-27 15:47 ` Greg KH
  2021-07-27 15:57   ` Mika Westerberg
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2021-07-27 15:47 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: linux-usb, Michael Jamet, Yehezkel Bernat, Christian Kellner,
	Lukas Wunner, Andreas Noever, Kai-Heng Feng

On Tue, Jul 27, 2021 at 05:25:01PM +0300, Mika Westerberg wrote:
> This reverts commit 6f3badead6a078cf3c71f381f9d84ac922984a00.
> 
> 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: stable@vger.kernel.org
> Cc: Christian Kellner <ckellner@redhat.com>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---
>  drivers/thunderbolt/switch.c | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)

Want me to take this in my "usb-linus" tree now to get it into the tree
sooner?  Or will you have other thunderbolt fixes for me soon?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "thunderbolt: Hide authorized attribute if router does not support PCIe tunnels"
  2021-07-27 15:47 ` Greg KH
@ 2021-07-27 15:57   ` Mika Westerberg
  2021-07-27 16:14     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Mika Westerberg @ 2021-07-27 15:57 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-usb, Michael Jamet, Yehezkel Bernat, Christian Kellner,
	Lukas Wunner, Andreas Noever, Kai-Heng Feng

On Tue, Jul 27, 2021 at 05:47:40PM +0200, Greg KH wrote:
> On Tue, Jul 27, 2021 at 05:25:01PM +0300, Mika Westerberg wrote:
> > This reverts commit 6f3badead6a078cf3c71f381f9d84ac922984a00.
> > 
> > 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: stable@vger.kernel.org
> > Cc: Christian Kellner <ckellner@redhat.com>
> > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> > ---
> >  drivers/thunderbolt/switch.c | 15 +--------------
> >  1 file changed, 1 insertion(+), 14 deletions(-)
> 
> Want me to take this in my "usb-linus" tree now to get it into the tree
> sooner?  Or will you have other thunderbolt fixes for me soon?

I don't have any other fixes ATM so it would be great if you can pick
this one directly :) Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "thunderbolt: Hide authorized attribute if router does not support PCIe tunnels"
  2021-07-27 15:57   ` Mika Westerberg
@ 2021-07-27 16:14     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2021-07-27 16:14 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: linux-usb, Michael Jamet, Yehezkel Bernat, Christian Kellner,
	Lukas Wunner, Andreas Noever, Kai-Heng Feng

On Tue, Jul 27, 2021 at 06:57:25PM +0300, Mika Westerberg wrote:
> On Tue, Jul 27, 2021 at 05:47:40PM +0200, Greg KH wrote:
> > On Tue, Jul 27, 2021 at 05:25:01PM +0300, Mika Westerberg wrote:
> > > This reverts commit 6f3badead6a078cf3c71f381f9d84ac922984a00.
> > > 
> > > 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: stable@vger.kernel.org
> > > Cc: Christian Kellner <ckellner@redhat.com>
> > > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> > > ---
> > >  drivers/thunderbolt/switch.c | 15 +--------------
> > >  1 file changed, 1 insertion(+), 14 deletions(-)
> > 
> > Want me to take this in my "usb-linus" tree now to get it into the tree
> > sooner?  Or will you have other thunderbolt fixes for me soon?
> 
> I don't have any other fixes ATM so it would be great if you can pick
> this one directly :) Thanks!

Done!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-27 16:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-27 14:25 [PATCH] Revert "thunderbolt: Hide authorized attribute if router does not support PCIe tunnels" Mika Westerberg
2021-07-27 15:47 ` Greg KH
2021-07-27 15:57   ` Mika Westerberg
2021-07-27 16:14     ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.