Merge tag 'tty-5.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial fixes from Greg KH:
"Here are two small tty/serial fixes for 5.16-rc6. They include:

- n_hdlc fix for syzbot reported problem that you were previously
copied on.

- 8250_fintek driver fix that resolved a console problem by removing
a previous change.

Both have been in linux-next with no reported issues"

* tag 'tty-5.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
serial: 8250_fintek: Fix garbled text for console
tty: n_hdlc: make n_hdlc_tty_wakeup() asynchronous

+22 -21
+22 -1
drivers/tty/n_hdlc.c
··· 140 140 struct n_hdlc_buf_list rx_buf_list; 141 141 struct n_hdlc_buf_list tx_free_buf_list; 142 142 struct n_hdlc_buf_list rx_free_buf_list; 143 + struct work_struct write_work; 144 + struct tty_struct *tty_for_write_work; 143 145 }; 144 146 145 147 /* ··· 156 154 /* Local functions */ 157 155 158 156 static struct n_hdlc *n_hdlc_alloc(void); 157 + static void n_hdlc_tty_write_work(struct work_struct *work); 159 158 160 159 /* max frame size for memory allocations */ 161 160 static int maxframe = 4096; ··· 213 210 wake_up_interruptible(&tty->read_wait); 214 211 wake_up_interruptible(&tty->write_wait); 215 212 213 + cancel_work_sync(&n_hdlc->write_work); 214 + 216 215 n_hdlc_free_buf_list(&n_hdlc->rx_free_buf_list); 217 216 n_hdlc_free_buf_list(&n_hdlc->tx_free_buf_list); 218 217 n_hdlc_free_buf_list(&n_hdlc->rx_buf_list); ··· 246 241 return -ENFILE; 247 242 } 248 243 244 + INIT_WORK(&n_hdlc->write_work, n_hdlc_tty_write_work); 245 + n_hdlc->tty_for_write_work = tty; 249 246 tty->disc_data = n_hdlc; 250 247 tty->receive_room = 65536; 251 248 ··· 342 335 } /* end of n_hdlc_send_frames() */ 343 336 344 337 /** 338 + * n_hdlc_tty_write_work - Asynchronous callback for transmit wakeup 339 + * @work: pointer to work_struct 340 + * 341 + * Called when low level device driver can accept more send data. 342 + */ 343 + static void n_hdlc_tty_write_work(struct work_struct *work) 344 + { 345 + struct n_hdlc *n_hdlc = container_of(work, struct n_hdlc, write_work); 346 + struct tty_struct *tty = n_hdlc->tty_for_write_work; 347 + 348 + n_hdlc_send_frames(n_hdlc, tty); 349 + } /* end of n_hdlc_tty_write_work() */ 350 + 351 + /** 345 352 * n_hdlc_tty_wakeup - Callback for transmit wakeup 346 353 * @tty: pointer to associated tty instance data 347 354 * ··· 365 344 { 366 345 struct n_hdlc *n_hdlc = tty->disc_data; 367 346 368 - n_hdlc_send_frames(n_hdlc, tty); 347 + schedule_work(&n_hdlc->write_work); 369 348 } /* end of n_hdlc_tty_wakeup() */ 370 349 371 350 /**
-20
drivers/tty/serial/8250/8250_fintek.c
··· 290 290 } 291 291 } 292 292 293 - static void fintek_8250_goto_highspeed(struct uart_8250_port *uart, 294 - struct fintek_8250 *pdata) 295 - { 296 - sio_write_reg(pdata, LDN, pdata->index); 297 - 298 - switch (pdata->pid) { 299 - case CHIP_ID_F81966: 300 - case CHIP_ID_F81866: /* set uart clock for high speed serial mode */ 301 - sio_write_mask_reg(pdata, F81866_UART_CLK, 302 - F81866_UART_CLK_MASK, 303 - F81866_UART_CLK_14_769MHZ); 304 - 305 - uart->port.uartclk = 921600 * 16; 306 - break; 307 - default: /* leave clock speed untouched */ 308 - break; 309 - } 310 - } 311 - 312 293 static void fintek_8250_set_termios(struct uart_port *port, 313 294 struct ktermios *termios, 314 295 struct ktermios *old) ··· 411 430 412 431 fintek_8250_set_irq_mode(pdata, level_mode); 413 432 fintek_8250_set_max_fifo(pdata); 414 - fintek_8250_goto_highspeed(uart, pdata); 415 433 416 434 fintek_8250_exit_key(addr[i]); 417 435