[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Veqh2fbsMBeBEBJ_ook0jZz_y=WALrgjJ0skLR9SWC0pQ@mail.gmail.com>
Date: Mon, 1 Dec 2025 03:58:18 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Crescent Hsieh <crescentcy.hsieh@...a.com>
Cc: gregkh@...uxfoundation.org, jirislaby@...nel.org,
ilpo.jarvinen@...ux.intel.com, linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org
Subject: Re: [PATCH v1 20/31] serial: 8250: add optional callbacks for rx_trig_bytes
On Sun, Nov 30, 2025 at 12:45 PM Crescent Hsieh
<crescentcy.hsieh@...a.com> wrote:
>
> The rx_trig_bytes sysfs attribute adjusts the UART RX FIFO trigger
> level. Some modern 8250 variants require programming device-specific
> registers to change this threshold, which the generic (FCR-based) path
> does not cover.
>
> This patch adds two optional uart_port callbacks:
> - set_rxtrig(port, bytes): program a device-specific RX trigger threshold
> - get_rxtrig(port): read back the current RX trigger threshold
>
> When these callbacks are provided, the 8250 core will use them to
> set/read the hardware-specific threshold. If the callbacks are not
> implemented, the code falls back to the legacy generic path, so existing
> drivers keep their current behavior.
>
> No functional change for drivers that do not implement the new
> callbacks.
...
> - rxtrig_bytes = do_serial8250_get_rxtrig(port);
> + if (uport->get_rxtrig)
> + rxtrig_bytes = uport->get_rxtrig(uport);
> + else
> + rxtrig_bytes = do_serial8250_get_rxtrig(port);
> +
Unneeded blank line.
> if (rxtrig_bytes < 0)
> return rxtrig_bytes;
...
> - ret = do_serial8250_set_rxtrig(port, bytes);
> + if (uport->set_rxtrig)
> + ret = uport->set_rxtrig(uport, bytes);
> + else
> + ret = do_serial8250_set_rxtrig(port, bytes);
> +
Ditto.
> if (ret < 0)
> return ret;
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists