Skip to content

Commit

Permalink
Merge tag 'tty-5.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/gregkh/tty

Pull tty/serial driver fixes from Greg KH:
 "Here are some small serial and TTY driver fixes for 5.2-rc3.

  Nothing major, just a number of fixes for reported issues. The fbcon
  core fix also resolves an issue, and was acked by the relevant
  maintainer to go through this tree.

  All of these have been in linux-next with no reported issues"

* tag 'tty-5.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  vt/fbcon: deinitialize resources in visual_init() after failed memory allocation
  tty: max310x: Fix external crystal register setup
  serial: sh-sci: disable DMA for uart_console
  serial: imx: remove log spamming error message
  tty: serial: msm_serial: Fix XON/XOFF
  • Loading branch information
Linus Torvalds committed May 31, 2019
2 parents e49c854 + a1ad1cc commit dbde71d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 6 deletions.
1 change: 0 additions & 1 deletion drivers/tty/serial/imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,6 @@ static void imx_uart_clear_rx_errors(struct imx_port *sport)
sport->port.icount.buf_overrun++;
tty_flip_buffer_push(port);
} else {
dev_err(sport->port.dev, "DMA transaction error.\n");
if (usr1 & USR1_FRAMERR) {
sport->port.icount.frame++;
imx_uart_writel(sport, USR1_FRAMERR, USR1);
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/serial/max310x.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ static int max310x_set_ref_clk(struct device *dev, struct max310x_port *s,
}

/* Configure clock source */
clksrc = xtal ? MAX310X_CLKSRC_CRYST_BIT : MAX310X_CLKSRC_EXTCLK_BIT;
clksrc = MAX310X_CLKSRC_EXTCLK_BIT | (xtal ? MAX310X_CLKSRC_CRYST_BIT : 0);

/* Configure PLL */
if (pllcfg) {
Expand Down
5 changes: 4 additions & 1 deletion drivers/tty/serial/msm_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@ static void msm_handle_tx(struct uart_port *port)
struct circ_buf *xmit = &msm_port->uart.state->xmit;
struct msm_dma *dma = &msm_port->tx_dma;
unsigned int pio_count, dma_count, dma_min;
char buf[4] = { 0 };
void __iomem *tf;
int err = 0;

Expand All @@ -869,10 +870,12 @@ static void msm_handle_tx(struct uart_port *port)
else
tf = port->membase + UART_TF;

buf[0] = port->x_char;

if (msm_port->is_uartdm)
msm_reset_dm_count(port, 1);

iowrite8_rep(tf, &port->x_char, 1);
iowrite32_rep(tf, buf, 1);
port->icount.tx++;
port->x_char = 0;
return;
Expand Down
7 changes: 7 additions & 0 deletions drivers/tty/serial/sh-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,13 @@ static void sci_request_dma(struct uart_port *port)

dev_dbg(port->dev, "%s: port %d\n", __func__, port->line);

/*
* DMA on console may interfere with Kernel log messages which use
* plain putchar(). So, simply don't use it with a console.
*/
if (uart_console(port))
return;

if (!port->dev->of_node)
return;

Expand Down
11 changes: 9 additions & 2 deletions drivers/tty/vt/vt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,13 @@ static void visual_init(struct vc_data *vc, int num, int init)
vc->vc_screenbuf_size = vc->vc_rows * vc->vc_size_row;
}


static void visual_deinit(struct vc_data *vc)
{
vc->vc_sw->con_deinit(vc);
module_put(vc->vc_sw->owner);
}

int vc_allocate(unsigned int currcons) /* return 0 on success */
{
struct vt_notifier_param param;
Expand Down Expand Up @@ -1103,6 +1110,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */

return 0;
err_free:
visual_deinit(vc);
kfree(vc);
vc_cons[currcons].d = NULL;
return -ENOMEM;
Expand Down Expand Up @@ -1331,9 +1339,8 @@ struct vc_data *vc_deallocate(unsigned int currcons)
param.vc = vc = vc_cons[currcons].d;
atomic_notifier_call_chain(&vt_notifier_list, VT_DEALLOCATE, &param);
vcs_remove_sysfs(currcons);
vc->vc_sw->con_deinit(vc);
visual_deinit(vc);
put_pid(vc->vt_pid);
module_put(vc->vc_sw->owner);
vc_uniscr_set(vc, NULL);
kfree(vc->vc_screenbuf);
vc_cons[currcons].d = NULL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/fbdev/core/fbcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ static void fbcon_deinit(struct vc_data *vc)
if (free_font)
vc->vc_font.data = NULL;

if (vc->vc_hi_font_mask)
if (vc->vc_hi_font_mask && vc->vc_screenbuf)
set_vc_hi_font(vc, false);

if (!con_is_bound(&fb_con))
Expand Down

0 comments on commit dbde71d

Please sign in to comment.