Re: [PATCH 16/33] serial: 8250: extract serial8250_initialize()

Jiri Slaby
2025-06-23T06:59:52Z

On 11. 06. 25, 14:19, Ilpo Järvinen wrote:
>> + * variable. So, let's just don't test if we receive TX irq. This way, we'll never enable
>> + * UART_BUG_TXEN.
>> + */
>> + if (!(port->quirks & UPQ_NO_TXEN_TEST)) {
>> + /* Do a quick test to see if we receive an interrupt when we enable the TX irq. */
>> + serial_port_out(port, UART_IER, UART_IER_THRI);
>> + lsr_TEMT = serial_port_in(port, UART_LSR) & UART_LSR_TEMT;
>> + iir_NOINT = serial_port_in(port, UART_IIR) & UART_IIR_NO_INT;
>> + serial_port_out(port, UART_IER, 0);
>> +
>> + if (lsr_TEMT && iir_NOINT) {
>> + if (!(up->bugs & UART_BUG_TXEN)) {
>> + up->bugs |= UART_BUG_TXEN;
>> + dev_dbg(port->dev, "enabling bad tx status workarounds\n");
>> + }
>> + } else {
>> + up->bugs &= ~UART_BUG_TXEN;
>
> Is this necessary at all as the line above is the only place setting this
> flag (AFAICT)?

TBH, I don't know. I guess it is unnecessary but it is there since this
UART_BUG_TXEN was added. /me shrugs.

thanks,
--
js
suse labs