On Thu, Jul 16, 2020 at 11:16:00PM -0700, Prashant Malani wrote: > Hi Mika, > > Sorry for the late comment.. Sorry for the late reply, was on vacation ;-) > On Mon, Jun 15, 2020 at 05:26:37PM +0300, Mika Westerberg wrote: > > USB3 tunneling is possible only over USB4 link so don't create USB3 > > tunnels if that's not the case. > > > > Signed-off-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx> > > --- > > drivers/thunderbolt/tb.c | 3 +++ > > drivers/thunderbolt/tb.h | 2 ++ > > drivers/thunderbolt/tb_regs.h | 1 + > > drivers/thunderbolt/usb4.c | 24 +++++++++++++++++++++--- > > 4 files changed, 27 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c > > index 55daa7f1a87d..2da82259e77c 100644 > > --- a/drivers/thunderbolt/tb.c > > +++ b/drivers/thunderbolt/tb.c > > @@ -235,6 +235,9 @@ static int tb_tunnel_usb3(struct tb *tb, struct tb_switch *sw) > > if (!up) > > return 0; > > > > + if (!sw->link_usb4) > > + return 0; > On both here and the previous "up" check; should we be returning 0? > Wouldn't it be better to return an appropriate error code? It sounds > like 0 is considered a success.... The idea here is that you can call this function for every type of router (can be one without USB3 adapters so TBT 3,1,2) and it creates the tunnel if conditions for USB3 tunneling are met. It is not considered an error. However, if the operations fail for some reason we return appropriate error code.