Re: [PATCH v2 1/3] usb: gadget: f_ncm: fix ncm_bitrate for SuperSpeed and above.

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

 



On Wed, Aug 19, 2020 at 6:39 AM Maciej Żenczykowski
<zenczykowski@xxxxxxxxx> wrote:
> > -       if (gadget_is_superspeed(g) && g->speed == USB_SPEED_SUPER)
> > -               return 13 * 1024 * 8 * 1000 * 8;
> > +       if (gadget_is_superspeed(g) && g->speed >= USB_SPEED_SUPER)
> > +               return 4000000000;

Will respin to change this to 4000000000U to address the warning
reported by the kernel test robot.

> Do you know what this actually affects besides the display?
> My cursory investigation shows it gets printed to kernel log and sent
> over some sort of ncm notification to the other side...

Yes, it's sent in the ConnectionSpeedChange notifications which are
intended to inform the host about how fast the link is. For a direct
connection over a USB cable this does not make much sense, but for,
say, a Gigabit Ethernet dongle that uses NCM, you'd probably want to
inform the host of whether the connection is 10, 100, or 1000M. This
is not what the code does now, obviously.

> Is it better to underestimate or overestimate?
> (ie. would it be better to report 3.5 gbps for super and max out at
> 4.2 gbps for super plus instead?)

I don't think it matters much. I'm happy to put 3860000000 for
SuperSpeed and 4200000000 for SuperSpeed Plus, or whatever else we
think makes sense. The speed is theoretical anyway. I suppose
reporting different speeds might be useful to debug whether the
connection is using 5G or >= 10G.

Felipe, any opinions?




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

  Powered by Linux