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
Unified · Split
| @@ -1165,7 +1165,6 @@ static void imx_uart_clear_rx_errors(struct imx_port *sport) · 1164 unmodified lines | ||
| 1165 | 1165 | sport->port.icount.buf_overrun++; |
| 1166 | 1166 | tty_flip_buffer_push(port); |
| 1167 | 1167 | } else { |
| 1168 | − dev_err(sport->port.dev, "DMA transaction error.\n"); | |
| 1169 | 1168 | if (usr1 & USR1_FRAMERR) { |
| 1170 | 1169 | sport->port.icount.frame++; |
| 1171 | 1170 | imx_uart_writel(sport, USR1_FRAMERR, USR1); |
| @@ -581,7 +581,7 @@ static int max310x_set_ref_clk(struct device *dev, struct max310x_port *s, · 580 unmodified lines | ||
| 581 | 581 | } |
| 582 | 582 | |
| 583 | 583 | /* Configure clock source */ |
| 584 | − clksrc = xtal ? MAX310X_CLKSRC_CRYST_BIT : MAX310X_CLKSRC_EXTCLK_BIT; | |
| 584 | + clksrc = MAX310X_CLKSRC_EXTCLK_BIT | (xtal ? MAX310X_CLKSRC_CRYST_BIT : 0); | |
| 585 | 585 | |
| 586 | 586 | /* Configure PLL */ |
| 587 | 587 | if (pllcfg) { |
| @@ -860,6 +860,7 @@ static void msm_handle_tx(struct uart_port *port) · 859 unmodified lines | ||
| 860 | 860 | struct circ_buf *xmit = &msm_port->uart.state->xmit; |
| 861 | 861 | struct msm_dma *dma = &msm_port->tx_dma; |
| 862 | 862 | unsigned int pio_count, dma_count, dma_min; |
| 863 | + char buf[4] = { 0 }; | |
| 863 | 864 | void __iomem *tf; |
| 864 | 865 | int err = 0; |
| 865 | 866 | |
| @@ -869,10 +870,12 @@ static void msm_handle_tx(struct uart_port *port) · 3 unmodified lines | ||
| 869 | 870 | else |
| 870 | 871 | tf = port->membase + UART_TF; |
| 871 | 872 | |
| 873 | + buf[0] = port->x_char; | |
| 874 | + | |
| 872 | 875 | if (msm_port->is_uartdm) |
| 873 | 876 | msm_reset_dm_count(port, 1); |
| 874 | 877 | |
| 875 | − iowrite8_rep(tf, &port->x_char, 1); | |
| 878 | + iowrite32_rep(tf, buf, 1); | |
| 876 | 879 | port->icount.tx++; |
| 877 | 880 | port->x_char = 0; |
| 878 | 881 | return; |
| @@ -1557,6 +1557,13 @@ static void sci_request_dma(struct uart_port *port) · 1556 unmodified lines | ||
| 1557 | 1557 | |
| 1558 | 1558 | dev_dbg(port->dev, "%s: port %d\n", __func__, port->line); |
| 1559 | 1559 | |
| 1560 | + /* | |
| 1561 | + * DMA on console may interfere with Kernel log messages which use | |
| 1562 | + * plain putchar(). So, simply don't use it with a console. | |
| 1563 | + */ | |
| 1564 | + if (uart_console(port)) | |
| 1565 | + return; | |
| 1566 | + | |
| 1560 | 1567 | if (!port->dev->of_node) |
| 1561 | 1568 | return; |
| 1562 | 1569 | |
| @@ -1056,6 +1056,13 @@ static void visual_init(struct vc_data *vc, int num, int init) · 1055 unmodified lines | ||
| 1056 | 1056 | vc->vc_screenbuf_size = vc->vc_rows * vc->vc_size_row; |
| 1057 | 1057 | } |
| 1058 | 1058 | |
| 1059 | + | |
| 1060 | +static void visual_deinit(struct vc_data *vc) | |
| 1061 | +{ | |
| 1062 | + vc->vc_sw->con_deinit(vc); | |
| 1063 | + module_put(vc->vc_sw->owner); | |
| 1064 | +} | |
| 1065 | + | |
| 1059 | 1066 | int vc_allocate(unsigned int currcons) /* return 0 on success */ |
| 1060 | 1067 | { |
| 1061 | 1068 | struct vt_notifier_param param; |
| @@ -1103,6 +1110,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ · 41 unmodified lines | ||
| 1103 | 1110 | |
| 1104 | 1111 | return 0; |
| 1105 | 1112 | err_free: |
| 1113 | + visual_deinit(vc); | |
| 1106 | 1114 | kfree(vc); |
| 1107 | 1115 | vc_cons[currcons].d = NULL; |
| 1108 | 1116 | return -ENOMEM; |
| @@ -1331,9 +1339,8 @@ struct vc_data *vc_deallocate(unsigned int currcons) · 222 unmodified lines | ||
| 1331 | 1339 | param.vc = vc = vc_cons[currcons].d; |
| 1332 | 1340 | atomic_notifier_call_chain(&vt_notifier_list, VT_DEALLOCATE, ¶m); |
| 1333 | 1341 | vcs_remove_sysfs(currcons); |
| 1334 | − vc->vc_sw->con_deinit(vc); | |
| 1342 | + visual_deinit(vc); | |
| 1335 | 1343 | put_pid(vc->vt_pid); |
| 1336 | − module_put(vc->vc_sw->owner); | |
| 1337 | 1344 | vc_uniscr_set(vc, NULL); |
| 1338 | 1345 | kfree(vc->vc_screenbuf); |
| 1339 | 1346 | vc_cons[currcons].d = NULL; |
| @@ -1248,7 +1248,7 @@ finished: · 1247 unmodified lines | ||
| 1248 | 1248 | if (free_font) |
| 1249 | 1249 | vc->vc_font.data = NULL; |
| 1250 | 1250 | |
| 1251 | − if (vc->vc_hi_font_mask) | |
| 1251 | + if (vc->vc_hi_font_mask && vc->vc_screenbuf) | |
| 1252 | 1252 | set_vc_hi_font(vc, false); |
| 1253 | 1253 | |
| 1254 | 1254 | if (!con_is_bound(&fb_con)) |