History

serial: 8250: Store to lsr_save_flags after lsr read

Not all LSR register flags are preserved across reads. Therefore, LSR readers must store the non-preserved bits into lsr_save_flags. This fix was initially mixed into feature commit f6f586102add ("serial: 8250: Handle UART without interrupt on TEMT using em485"). However, that feature change had a flaw and it was reverted to make room for simpler approach providing the same feature. The embedded fix got reverted with the feature change. Re-add the lsr_save_flags fix and properly mark it's a fix.

Ilpo Järvinen committed 4 years ago

Commit be03b061 parent 499e13a1 file · +2 −0Browse files

Unified · Split

drivers/tty/serial/8250/8250_port.c+2−0
@@ -1517,6 +1517,8 @@ static inline void __stop_tx(struct uart_8250_port *p) · 1516 unmodified lines
1517 unsigned char lsr = serial_in(p, UART_LSR);1517 unsigned char lsr = serial_in(p, UART_LSR);
1518 u64 stop_delay = 0;1518 u64 stop_delay = 0;
1519 1519
1520 p->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
1521
1520 if (!(lsr & UART_LSR_THRE))1522 if (!(lsr & UART_LSR_THRE))
1521 return;1523 return;
1522 /*1524 /*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t