Patch "serial: core: only stop transmit when HW fifo is empty" has been added to the 6.8-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    serial: core: only stop transmit when HW fifo is empty

to the 6.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     serial-core-only-stop-transmit-when-hw-fifo-is-empty.patch
and it can be found in the queue-6.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f2517cf23dc69e01c7effc8f2a243b24fd71b11e
Author: Jonas Gorski <jonas.gorski@xxxxxxxxx>
Date:   Sun Mar 3 16:08:07 2024 +0100

    serial: core: only stop transmit when HW fifo is empty
    
    [ Upstream commit 7bfb915a597a301abb892f620fe5c283a9fdbd77 ]
    
    If the circular buffer is empty, it just means we fit all characters to
    send into the HW fifo, but not that the hardware finished transmitting
    them.
    
    So if we immediately call stop_tx() after that, this may abort any
    pending characters in the HW fifo, and cause dropped characters on the
    console.
    
    Fix this by only stopping tx when the tx HW fifo is actually empty.
    
    Fixes: 8275b48b2780 ("tty: serial: introduce transmit helpers")
    Cc: stable@xxxxxxxxxxxxxxx
    Signed-off-by: Jonas Gorski <jonas.gorski@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20240303150807.68117-1-jonas.gorski@xxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 55b1f3ba48ac1..bb0f2d4ac62f6 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -786,7 +786,8 @@ enum UART_TX_FLAGS {
 	if (pending < WAKEUP_CHARS) {					      \
 		uart_write_wakeup(__port);				      \
 									      \
-		if (!((flags) & UART_TX_NOSTOP) && pending == 0)	      \
+		if (!((flags) & UART_TX_NOSTOP) && pending == 0 &&	      \
+		    __port->ops->tx_empty(__port))			      \
 			__port->ops->stop_tx(__port);			      \
 	}								      \
 									      \




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux