Re: [PATCH 3/3] thunderbolt: Expose more details about USB 3.x and DisplayPort tunnels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 10, 2021 at 09:54:44AM +0200, Mika Westerberg wrote:
> > > +static void tb_add_tunnel(struct tb *tb, struct tb_tunnel *tunnel)
> > > +{
> > > +	struct tb_switch *sw = tunnel->dst_port->sw;
> > > +	struct tb_cm *tcm = tb_priv(tb);
> > > +
> > > +	if (tb_tunnel_is_usb3(tunnel)) {
> > > +		sw->usb3++;
> > > +	} else if (tb_tunnel_is_dp(tunnel)) {
> > > +		sw->dp++;
> > > +		/* Inform userspace about DP tunneling change */
> > > +		kobject_uevent(&sw->dev.kobj, KOBJ_CHANGE);
> > 
> > What really "changed" here about this device that userspace now needs to
> > know about it?
> 
> DisplayPort tunnel came up, so the "dp" attribute value changed.
> 
> I'm not entirely sure we need to notify the userspace from changes like
> these, though. We do this when PCIe tunnel comes up already so this kind
> of follows that (and USB 3.x tunnel is always created at the same time
> the device itself is announced so does not require any change event).
> 
> > > +	}
> > > +
> > > +	list_add_tail(&tunnel->list, &tcm->tunnel_list);
> > > +}
> > > +
> > > +static void tb_remove_tunnel(struct tb_tunnel *tunnel)
> > > +{
> > > +	struct tb_switch *sw = tunnel->dst_port->sw;
> > > +
> > > +	if (tb_tunnel_is_usb3(tunnel) && sw->usb3) {
> > > +		sw->usb3--;
> > > +	} else if (tb_tunnel_is_dp(tunnel) && sw->dp) {
> > > +		sw->dp--;
> > > +		kobject_uevent(&sw->dev.kobj, KOBJ_CHANGE);
> > 
> > Same here, what causes tunnels to be added or removed?
> 
> Here the opposite, a DisplayPort tunnel was torn down so the "dp"
> attribute changed.

Did just the value in the attribute change, or did the visability of
attributes change?

And if it is just the value, who is going to care about this value?  Is
userspace going to want to know this type of change?  What causes this
to change in the first place (physical event?  Virtual event?  Something
else?)

thanks,

greg k-h



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux