Re: [PATCH v1 4/4] usb: serial: mxuport: add sysfs control for UART FIFO

From: Greg Kroah-Hartman

Date: Fri May 15 2026 - 05:24:14 EST


On Fri, May 15, 2026 at 05:08:09PM +0800, Crescent Hsieh wrote:
> Hi Greg and Johan,
>
> I agree that USB-to-serial cannot provide deterministic latency.
> However, the embedded UART used by Moxa UPort has a 512-byte FIFO, so
> its FIFO/trigger configuration still has a measurable effect on the
> typical latency on this hardware.

Sure, but again, you are fighting a loosing battle.

> RQ_VENDOR_SET_FIFO_DISABLE is a historical name. On the current
> firmware, it does not literally turn the UART FIFO on or off, but
> adjusts the UART RX/TX trigger levels instead. Its semantics are close
> to the trigger-level control I am currently working on for the PCI
> serial cards [1].
>
> In a 1-byte loopback latency test under the same wiring and host setup,
> with 10,000 samples for each configuration, I measured the following
> results (in us):
>
> | Enable | Disable |
> --------------------------|
> Min | 637 | 210 |
> Median | 764 | 235 |
> P95 | 811 | 238 |
> P99 | 820 | 260 |
> Max | 4,214 | 3,807 |
> Avg | 744 | 235 |
> --------------------------|
>
> So while this does not make USB deterministic, it does show that this
> setting has a significant effect on the typical latency on this hardware
> and also matters for compatibility with some legacy serial equipment.

Then the traditional api for controling this in the uart should be used,
not a special-purpose one-off for a sysfs file.

thanks,

greg k-h