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.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull serial driver fixes from Greg KH:
"Here are two small serial driver fixes for 6.13-rc3. They are:

- ioport build fallout fix for the 8250 port driver that should
resolve Guenter's runtime problems

- sh-sci driver bugfix for a reported problem

Both of these have been in linux-next for a while with no reported
issues"

* tag 'tty-6.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
tty: serial: Work around warning backtrace in serial8250_set_defaults
serial: sh-sci: Check if TX data was written to device in .tx_empty()

+31 -1
+2 -1
drivers/tty/serial/8250/8250_port.c
··· 467 467 break; 468 468 #endif 469 469 default: 470 - WARN(1, "Unsupported UART type %x\n", p->iotype); 470 + WARN(p->iotype != UPIO_PORT || p->iobase, 471 + "Unsupported UART type %x\n", p->iotype); 471 472 p->serial_in = no_serial_in; 472 473 p->serial_out = no_serial_out; 473 474 }
+29
drivers/tty/serial/sh-sci.c
··· 157 157 158 158 bool has_rtscts; 159 159 bool autorts; 160 + bool tx_occurred; 160 161 }; 161 162 162 163 #define SCI_NPORTS CONFIG_SERIAL_SH_SCI_NR_UARTS ··· 851 850 { 852 851 struct tty_port *tport = &port->state->port; 853 852 unsigned int stopped = uart_tx_stopped(port); 853 + struct sci_port *s = to_sci_port(port); 854 854 unsigned short status; 855 855 unsigned short ctrl; 856 856 int count; ··· 887 885 } 888 886 889 887 sci_serial_out(port, SCxTDR, c); 888 + s->tx_occurred = true; 890 889 891 890 port->icount.tx++; 892 891 } while (--count > 0); ··· 1243 1240 1244 1241 if (kfifo_len(&tport->xmit_fifo) < WAKEUP_CHARS) 1245 1242 uart_write_wakeup(port); 1243 + 1244 + s->tx_occurred = true; 1246 1245 1247 1246 if (!kfifo_is_empty(&tport->xmit_fifo)) { 1248 1247 s->cookie_tx = 0; ··· 1736 1731 s->cookie_tx = -EINVAL; 1737 1732 } 1738 1733 } 1734 + 1735 + static void sci_dma_check_tx_occurred(struct sci_port *s) 1736 + { 1737 + struct dma_tx_state state; 1738 + enum dma_status status; 1739 + 1740 + if (!s->chan_tx) 1741 + return; 1742 + 1743 + status = dmaengine_tx_status(s->chan_tx, s->cookie_tx, &state); 1744 + if (status == DMA_COMPLETE || status == DMA_IN_PROGRESS) 1745 + s->tx_occurred = true; 1746 + } 1739 1747 #else /* !CONFIG_SERIAL_SH_SCI_DMA */ 1740 1748 static inline void sci_request_dma(struct uart_port *port) 1741 1749 { 1742 1750 } 1743 1751 1744 1752 static inline void sci_free_dma(struct uart_port *port) 1753 + { 1754 + } 1755 + 1756 + static void sci_dma_check_tx_occurred(struct sci_port *s) 1745 1757 { 1746 1758 } 1747 1759 ··· 2098 2076 { 2099 2077 unsigned short status = sci_serial_in(port, SCxSR); 2100 2078 unsigned short in_tx_fifo = sci_txfill(port); 2079 + struct sci_port *s = to_sci_port(port); 2080 + 2081 + sci_dma_check_tx_occurred(s); 2082 + 2083 + if (!s->tx_occurred) 2084 + return TIOCSER_TEMT; 2101 2085 2102 2086 return (status & SCxSR_TEND(port)) && !in_tx_fifo ? TIOCSER_TEMT : 0; 2103 2087 } ··· 2275 2247 2276 2248 dev_dbg(port->dev, "%s(%d)\n", __func__, port->line); 2277 2249 2250 + s->tx_occurred = false; 2278 2251 sci_request_dma(port); 2279 2252 2280 2253 ret = sci_request_irq(s);