Re: [PATCH v1 11/31] serial: 8250_mxpcie: enable enhanced mode and custom FIFO trigger levels

From: Andy Shevchenko

Date: Sun Nov 30 2025 - 14:26:01 EST


On Sun, Nov 30, 2025 at 12:44 PM Crescent Hsieh
<crescentcy.hsieh@xxxxxxxx> wrote:
>
> Add support for enabling enhanced mode and configuring custom FIFO
> trigger levels on Moxa PCIe serial boards.
>
> Enhanced mode is activated via EFR[4] and SFR[5], which is required to
> access special function registers used for advanced features. Once
> enhanced mode is enabled, custom TX/RX FIFO trigger levels and flow
> control thresholds are configured through specific registers.

...

> +static int mxpcie8250_startup(struct uart_port *port)
> +{
> + struct uart_8250_port *up = up_to_u8250p(port);
> + int i, ret;

Should "i" be signed?

> + ret = serial8250_do_startup(port);

Same Q here: Why do we continue if we know it failed already?

> + for (i = 0; i < 5; ++i)
> + serial_out(up, UART_FCR, UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT);
> +
> + serial_out(up, MOXA_PUART_EFR, MOXA_PUART_EFR_ENHANCED);
> + serial_out(up, MOXA_PUART_SFR, MOXA_PUART_SFR_950);
> +
> + serial_out(up, MOXA_PUART_TTL, 0);
> + serial_out(up, MOXA_PUART_RTL, 96);
> + serial_out(up, MOXA_PUART_FCL, 16);
> + serial_out(up, MOXA_PUART_FCH, 110);
> +
> + return ret;
> +}

--
With Best Regards,
Andy Shevchenko