Skip to content

Commit 62dcd5e

Browse files
committed
Merge tag 'tty-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial driver fixes from Greg KH: "Here are some small tty and serial driver fixes for 5.19-rc3 to resolve some reported problems: - 8250 lsr read bugfix - n_gsm line discipline allocation fix - qcom serial driver fix for reported lockups that happened in -rc1 - goldfish tty driver fix All have been in linux-next for a while now with no reported issues" * tag 'tty-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: 8250: Store to lsr_save_flags after lsr read tty: goldfish: Fix free_irq() on remove tty: serial: qcom-geni-serial: Implement start_rx callback serial: core: Introduce callback for start_rx and do stop_rx in suspend only if this callback implementation is present. tty: n_gsm: Debug output allocation must use GFP_ATOMIC
2 parents 9057a64 + be03b06 commit 62dcd5e

6 files changed

Lines changed: 12 additions & 5 deletions

File tree

drivers/tty/goldfish.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ static int goldfish_tty_remove(struct platform_device *pdev)
426426
tty_unregister_device(goldfish_tty_driver, qtty->console.index);
427427
iounmap(qtty->base);
428428
qtty->base = NULL;
429-
free_irq(qtty->irq, pdev);
429+
free_irq(qtty->irq, qtty);
430430
tty_port_destroy(&qtty->port);
431431
goldfish_tty_current_line_count--;
432432
if (goldfish_tty_current_line_count == 0)

drivers/tty/n_gsm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ static void gsm_hex_dump_bytes(const char *fname, const u8 *data,
455455
return;
456456
}
457457

458-
prefix = kasprintf(GFP_KERNEL, "%s: ", fname);
458+
prefix = kasprintf(GFP_ATOMIC, "%s: ", fname);
459459
if (!prefix)
460460
return;
461461
print_hex_dump(KERN_INFO, prefix, DUMP_PREFIX_OFFSET, 16, 1, data, len,

drivers/tty/serial/8250/8250_port.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,6 +1517,8 @@ static inline void __stop_tx(struct uart_8250_port *p)
15171517
unsigned char lsr = serial_in(p, UART_LSR);
15181518
u64 stop_delay = 0;
15191519

1520+
p->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
1521+
15201522
if (!(lsr & UART_LSR_THRE))
15211523
return;
15221524
/*

drivers/tty/serial/qcom_geni_serial.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,7 @@ static const struct uart_ops qcom_geni_console_pops = {
13061306
.stop_tx = qcom_geni_serial_stop_tx,
13071307
.start_tx = qcom_geni_serial_start_tx,
13081308
.stop_rx = qcom_geni_serial_stop_rx,
1309+
.start_rx = qcom_geni_serial_start_rx,
13091310
.set_termios = qcom_geni_serial_set_termios,
13101311
.startup = qcom_geni_serial_startup,
13111312
.request_port = qcom_geni_serial_request_port,

drivers/tty/serial/serial_core.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2214,11 +2214,12 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
22142214
/*
22152215
* Nothing to do if the console is not suspending
22162216
* except stop_rx to prevent any asynchronous data
2217-
* over RX line. Re-start_rx, when required, is
2218-
* done by set_termios in resume sequence
2217+
* over RX line. However ensure that we will be
2218+
* able to Re-start_rx later.
22192219
*/
22202220
if (!console_suspend_enabled && uart_console(uport)) {
2221-
uport->ops->stop_rx(uport);
2221+
if (uport->ops->start_rx)
2222+
uport->ops->stop_rx(uport);
22222223
goto unlock;
22232224
}
22242225

@@ -2310,6 +2311,8 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
23102311
if (console_suspend_enabled)
23112312
uart_change_pm(state, UART_PM_STATE_ON);
23122313
uport->ops->set_termios(uport, &termios, NULL);
2314+
if (!console_suspend_enabled && uport->ops->start_rx)
2315+
uport->ops->start_rx(uport);
23132316
if (console_suspend_enabled)
23142317
console_start(uport->cons);
23152318
}

include/linux/serial_core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ struct uart_ops {
4545
void (*unthrottle)(struct uart_port *);
4646
void (*send_xchar)(struct uart_port *, char ch);
4747
void (*stop_rx)(struct uart_port *);
48+
void (*start_rx)(struct uart_port *);
4849
void (*enable_ms)(struct uart_port *);
4950
void (*break_ctl)(struct uart_port *, int ctl);
5051
int (*startup)(struct uart_port *);

0 commit comments

Comments
 (0)