lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Ve7XuqvmCK0EpKqFptLNTVH5x0=inwkO6BNVx9hsaHYYw@mail.gmail.com>
Date: Mon, 1 Dec 2025 03:40:02 +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 14/31] serial: 8250_mxpcie: add custom handle_irq()

On Sun, Nov 30, 2025 at 12:44 PM Crescent Hsieh
<crescentcy.hsieh@...a.com> wrote:
>
> Add a custom handle_irq() for 8250_mxpcie based on serial8250_handle_irq(),
> removing PM wakeup and DMA handling that are not needed.
>
> This prepares for future adjustments to RX and TX behavior specific to
> Moxa MUEx50 UART.

...

> +static int mxpcie8250_handle_irq(struct uart_port *port)
> +{
> +       struct uart_8250_port *up = up_to_u8250p(port);
> +       bool skip_rx = false;
> +       unsigned long flags;
> +       u16 lsr;
> +       u8 iir;
> +
> +       iir = serial_in(up, UART_IIR);

> +

Unneeded blank line.

> +       if (iir & UART_IIR_NO_INT)
> +               return 0;
> +
> +       uart_port_lock_irqsave(port, &flags);
> +
> +       lsr = serial_lsr_in(up);

> +

Ditto.

> +       if (!(lsr & (UART_LSR_FIFOE | UART_LSR_BRK_ERROR_BITS)) &&
> +           (port->status & (UPSTAT_AUTOCTS | UPSTAT_AUTORTS)) &&
> +           !(port->read_status_mask & UART_LSR_DR))
> +               skip_rx = true;
> +
> +       if (lsr & (UART_LSR_DR | UART_LSR_BI) && !skip_rx)
> +               lsr = serial8250_rx_chars(up, lsr);

Again, perhaps it's better to split the above to a few if-return
conditionals in a local helper.

> +       serial8250_modem_status(up);
> +
> +       if ((lsr & UART_LSR_THRE) && (up->ier & UART_IER_THRI))
> +               serial8250_tx_chars(up);
> +
> +       uart_unlock_and_check_sysrq_irqrestore(port, flags);
> +
> +       return 1;
> +}


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ