Linux USB
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Crescent Hsieh <crescentcy.hsieh@moxa.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 4/4] usb: serial: mxuport: add sysfs control for UART FIFO
Date: Wed, 13 May 2026 10:20:21 +0200	[thread overview]
Message-ID: <agQ0RRpE27ComUnV@hovoldconsulting.com> (raw)
In-Reply-To: <agMO03V9xppAtWjf@moxa-ThinkCentre-M90t>

On Tue, May 12, 2026 at 07:28:19PM +0800, Crescent Hsieh wrote:
> On Thu, May 07, 2026 at 05:59:05PM +0200, Johan Hovold wrote:
> > On Tue, Mar 24, 2026 at 11:50:41AM +0800, Crescent Hsieh wrote:
> > > Add a per-port sysfs attribute, uart_fifo, to allow userspace to enable
> > > or disable the UART FIFO at runtime.
> > 
> > Why would you want to do that?
> > 
> > We should try to avoid driver specific sysfs knobs.
> 
> The motivation is to allow userspace to choose between lower latency and
> higher throughput at runtime. Some latency-sensitive request/response
> deployments become unreliable if the UART FIFO is enabled due to the
> added buffering delay.

Please mention this in the commit message.

> I understand the concern about driver-specific sysfs knobs. UART FIFO
> enable/disable seems more like a common UART capability than a
> device-unique behaviour.
> 
> If a driver-specific sysfs attribute is not the right approach here, do
> you have a suggestion for a better interface?

We have one USB serial driver and one serial driver using the legacy
ASYNC_LOW_LATENCY flag (which can be set using setserial) to set the
lowest rx fifo trigger level.

I'm not sure we want to promote further use of it though.

We also have a couple of non-documented driver-specific sysfs attributes
(and a module parameter) and one documented interface for 8250, which may
be considered the standard way to set the rx fifo trigger level:

	/sys/class/tty/ttyS<x>/rx_trig_bytes

I guess something like that could be generalised to mxuport as disabling
the FIFOs is effectively setting a trigger level of one character.

What exactly does RQ_VENDOR_SET_FIFO_DISABLE do? Does it really disable
the TX fifo? That doesn't seem to make much sense, especially since you
already have the endpoint buffers.

What happens if you flip this switch while the port is in use?

Johan

  reply	other threads:[~2026-05-13  8:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24  3:50 [PATCH v1 0/4] usb: serial: mxuport: extend MXU50U support and runtime controls Crescent Hsieh
2026-03-24  3:50 ` [PATCH v1 1/4] usb: serial: mxuport: add support for more MXU50U UART devices Crescent Hsieh
2026-05-07 14:13   ` Johan Hovold
2026-03-24  3:50 ` [PATCH v1 2/4] usb: serial: mxuport: handle SEND_NEXT tx flow control Crescent Hsieh
2026-05-07 14:40   ` Johan Hovold
2026-03-24  3:50 ` [PATCH v1 3/4] usb: serial: mxuport: support serial interface mode configuration Crescent Hsieh
2026-05-07 15:56   ` Johan Hovold
2026-03-24  3:50 ` [PATCH v1 4/4] usb: serial: mxuport: add sysfs control for UART FIFO Crescent Hsieh
2026-05-07 15:59   ` Johan Hovold
2026-05-12 11:28     ` Crescent Hsieh
2026-05-13  8:20       ` Johan Hovold [this message]
2026-05-13  8:48         ` Greg Kroah-Hartman
2026-03-30  7:24 ` [PATCH v1 0/4] usb: serial: mxuport: extend MXU50U support and runtime controls Crescent Hsieh
2026-03-30  7:54   ` Johan Hovold
2026-04-27  3:37     ` Crescent Hsieh
2026-04-27 10:43       ` Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=agQ0RRpE27ComUnV@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=crescentcy.hsieh@moxa.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox