Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'tty-6.10-rc4' 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 that resolve som
reported problems. Included in here are:

- n_tty lookahead buffer bugfix

- WARN_ON() removal where it was not needed

- 8250_dw driver bugfixes

- 8250_pxa bugfix

- sc16is7xx Kconfig fixes for reported build issues

All of these have been in linux-next for over a week with no reported
problems"

* tag 'tty-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
serial: drop debugging WARN_ON_ONCE() from uart_write()
serial: sc16is7xx: re-add Kconfig SPI or I2C dependency
serial: sc16is7xx: rename Kconfig CONFIG_SERIAL_SC16IS7XX_CORE
serial: port: Don't block system suspend even if bytes are left to xmit
serial: 8250_pxa: Configure tx_loadsz to match FIFO IRQ level
serial: 8250_dw: Revert "Move definitions to the shared header"
serial: 8250_dw: Don't use struct dw8250_data outside of 8250_dw
tty: n_tty: Fix buffer offsets when lookahead is used

+64 -45
+16 -6
drivers/tty/n_tty.c
··· 1619 1619 else if (ldata->raw || (L_EXTPROC(tty) && !preops)) 1620 1620 n_tty_receive_buf_raw(tty, cp, fp, count); 1621 1621 else if (tty->closing && !L_EXTPROC(tty)) { 1622 - if (la_count > 0) 1622 + if (la_count > 0) { 1623 1623 n_tty_receive_buf_closing(tty, cp, fp, la_count, true); 1624 - if (count > la_count) 1625 - n_tty_receive_buf_closing(tty, cp, fp, count - la_count, false); 1624 + cp += la_count; 1625 + if (fp) 1626 + fp += la_count; 1627 + count -= la_count; 1628 + } 1629 + if (count > 0) 1630 + n_tty_receive_buf_closing(tty, cp, fp, count, false); 1626 1631 } else { 1627 - if (la_count > 0) 1632 + if (la_count > 0) { 1628 1633 n_tty_receive_buf_standard(tty, cp, fp, la_count, true); 1629 - if (count > la_count) 1630 - n_tty_receive_buf_standard(tty, cp, fp, count - la_count, false); 1634 + cp += la_count; 1635 + if (fp) 1636 + fp += la_count; 1637 + count -= la_count; 1638 + } 1639 + if (count > 0) 1640 + n_tty_receive_buf_standard(tty, cp, fp, count, false); 1631 1641 1632 1642 flush_echoes(tty); 1633 1643 if (tty->ops->flush_chars)
+34 -2
drivers/tty/serial/8250/8250_dw.c
··· 55 55 #define DW_UART_QUIRK_SKIP_SET_RATE BIT(2) 56 56 #define DW_UART_QUIRK_IS_DMA_FC BIT(3) 57 57 #define DW_UART_QUIRK_APMC0D08 BIT(4) 58 + #define DW_UART_QUIRK_CPR_VALUE BIT(5) 59 + 60 + struct dw8250_platform_data { 61 + u8 usr_reg; 62 + u32 cpr_value; 63 + unsigned int quirks; 64 + }; 65 + 66 + struct dw8250_data { 67 + struct dw8250_port_data data; 68 + const struct dw8250_platform_data *pdata; 69 + 70 + int msr_mask_on; 71 + int msr_mask_off; 72 + struct clk *clk; 73 + struct clk *pclk; 74 + struct notifier_block clk_notifier; 75 + struct work_struct clk_work; 76 + struct reset_control *rst; 77 + 78 + unsigned int skip_autocfg:1; 79 + unsigned int uart_16550_compatible:1; 80 + }; 81 + 82 + static inline struct dw8250_data *to_dw8250_data(struct dw8250_port_data *data) 83 + { 84 + return container_of(data, struct dw8250_data, data); 85 + } 58 86 59 87 static inline struct dw8250_data *clk_to_dw8250_data(struct notifier_block *nb) 60 88 { ··· 460 432 static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data) 461 433 { 462 434 unsigned int quirks = data->pdata ? data->pdata->quirks : 0; 435 + u32 cpr_value = data->pdata ? data->pdata->cpr_value : 0; 436 + 437 + if (quirks & DW_UART_QUIRK_CPR_VALUE) 438 + data->data.cpr_value = cpr_value; 463 439 464 440 #ifdef CONFIG_64BIT 465 441 if (quirks & DW_UART_QUIRK_OCTEON) { ··· 746 714 747 715 static const struct dw8250_platform_data dw8250_renesas_rzn1_data = { 748 716 .usr_reg = DW_UART_USR, 749 - .cpr_val = 0x00012f32, 750 - .quirks = DW_UART_QUIRK_IS_DMA_FC, 717 + .cpr_value = 0x00012f32, 718 + .quirks = DW_UART_QUIRK_CPR_VALUE | DW_UART_QUIRK_IS_DMA_FC, 751 719 }; 752 720 753 721 static const struct dw8250_platform_data dw8250_starfive_jh7100_data = {
+1 -2
drivers/tty/serial/8250/8250_dwlib.c
··· 242 242 void dw8250_setup_port(struct uart_port *p) 243 243 { 244 244 struct dw8250_port_data *pd = p->private_data; 245 - struct dw8250_data *data = to_dw8250_data(pd); 246 245 struct uart_8250_port *up = up_to_u8250p(p); 247 246 u32 reg, old_dlf; 248 247 ··· 277 278 278 279 reg = dw8250_readl_ext(p, DW_UART_CPR); 279 280 if (!reg) { 280 - reg = data->pdata->cpr_val; 281 + reg = pd->cpr_value; 281 282 dev_dbg(p->dev, "CPR is not available, using 0x%08x instead\n", reg); 282 283 } 283 284 if (!reg)
+1 -32
drivers/tty/serial/8250/8250_dwlib.h
··· 2 2 /* Synopsys DesignWare 8250 library header file. */ 3 3 4 4 #include <linux/io.h> 5 - #include <linux/notifier.h> 6 5 #include <linux/types.h> 7 - #include <linux/workqueue.h> 8 6 9 7 #include "8250.h" 10 - 11 - struct clk; 12 - struct reset_control; 13 8 14 9 struct dw8250_port_data { 15 10 /* Port properties */ ··· 14 19 struct uart_8250_dma dma; 15 20 16 21 /* Hardware configuration */ 22 + u32 cpr_value; 17 23 u8 dlf_size; 18 24 19 25 /* RS485 variables */ 20 26 bool hw_rs485_support; 21 27 }; 22 28 23 - struct dw8250_platform_data { 24 - u8 usr_reg; 25 - u32 cpr_val; 26 - unsigned int quirks; 27 - }; 28 - 29 - struct dw8250_data { 30 - struct dw8250_port_data data; 31 - const struct dw8250_platform_data *pdata; 32 - 33 - int msr_mask_on; 34 - int msr_mask_off; 35 - struct clk *clk; 36 - struct clk *pclk; 37 - struct notifier_block clk_notifier; 38 - struct work_struct clk_work; 39 - struct reset_control *rst; 40 - 41 - unsigned int skip_autocfg:1; 42 - unsigned int uart_16550_compatible:1; 43 - }; 44 - 45 29 void dw8250_do_set_termios(struct uart_port *p, struct ktermios *termios, const struct ktermios *old); 46 30 void dw8250_setup_port(struct uart_port *p); 47 - 48 - static inline struct dw8250_data *to_dw8250_data(struct dw8250_port_data *data) 49 - { 50 - return container_of(data, struct dw8250_data, data); 51 - } 52 31 53 32 static inline u32 dw8250_readl_ext(struct uart_port *p, int offset) 54 33 {
+1
drivers/tty/serial/8250/8250_pxa.c
··· 125 125 uart.port.iotype = UPIO_MEM32; 126 126 uart.port.regshift = 2; 127 127 uart.port.fifosize = 64; 128 + uart.tx_loadsz = 32; 128 129 uart.dl_write = serial_pxa_dl_write; 129 130 130 131 ret = serial8250_register_8250_port(&uart);
+2 -1
drivers/tty/serial/Kconfig
··· 1023 1023 help 1024 1024 Support for console on SCCNXP serial ports. 1025 1025 1026 - config SERIAL_SC16IS7XX_CORE 1026 + config SERIAL_SC16IS7XX 1027 1027 tristate "NXP SC16IS7xx UART support" 1028 + depends on SPI_MASTER || I2C 1028 1029 select SERIAL_CORE 1029 1030 select SERIAL_SC16IS7XX_SPI if SPI_MASTER 1030 1031 select SERIAL_SC16IS7XX_I2C if I2C
+1 -1
drivers/tty/serial/Makefile
··· 75 75 obj-$(CONFIG_SERIAL_SAMSUNG) += samsung_tty.o 76 76 obj-$(CONFIG_SERIAL_SB1250_DUART) += sb1250-duart.o 77 77 obj-$(CONFIG_SERIAL_SCCNXP) += sccnxp.o 78 - obj-$(CONFIG_SERIAL_SC16IS7XX_CORE) += sc16is7xx.o 78 + obj-$(CONFIG_SERIAL_SC16IS7XX) += sc16is7xx.o 79 79 obj-$(CONFIG_SERIAL_SC16IS7XX_SPI) += sc16is7xx_spi.o 80 80 obj-$(CONFIG_SERIAL_SC16IS7XX_I2C) += sc16is7xx_i2c.o 81 81 obj-$(CONFIG_SERIAL_SH_SCI) += sh-sci.o
+1 -1
drivers/tty/serial/serial_core.c
··· 622 622 return -EL3HLT; 623 623 624 624 port = uart_port_lock(state, flags); 625 - if (WARN_ON_ONCE(!state->port.xmit_buf)) { 625 + if (!state->port.xmit_buf) { 626 626 uart_port_unlock(port, flags); 627 627 return 0; 628 628 }
+7
drivers/tty/serial/serial_port.c
··· 64 64 if (port->flags & UPF_DEAD) 65 65 return 0; 66 66 67 + /* 68 + * Nothing to do on pm_runtime_force_suspend(), see 69 + * DEFINE_RUNTIME_DEV_PM_OPS. 70 + */ 71 + if (!pm_runtime_enabled(dev)) 72 + return 0; 73 + 67 74 uart_port_lock_irqsave(port, &flags); 68 75 if (!port_dev->tx_enabled) { 69 76 uart_port_unlock_irqrestore(port, flags);