Skip to content

Commit d40a28a

Browse files
Luca Fresigregkh
authored andcommitted
serial: sc16is7xx: enable THRI before filling TX FIFO
[ Upstream commit 246ac11 ] sc16is7xx_handle_tx() currently requests the THRI enable only after it has filled the TX FIFO. The request is asynchronous because the IER update is performed later by reg_work. The SC16IS7xx generates a THRI interrupt when the TX FIFO crosses its trigger level. If the FIFO drains past that level before reg_work enables THRI, the chip does not generate a new interrupt. Characters remain queued indefinitely even though the hardware FIFO is empty. This was observed on an SC16IS752 while both UART channels were active. During the stall the software TX buffer remained non-empty while TXLVL reported 64 bytes free, LSR reported THR and transmitter empty, IER had THRI enabled, and IIR reported no interrupt pending. Enable THRI synchronously before filling the FIFO so the threshold crossing cannot be missed. Fixes: cc4c1d0 ("sc16is7xx: Properly resume TX after stop") Cc: stable <stable@kernel.org> Signed-off-by: Luca Fresi <luca.fresi@bithiatec.com> Link: https://patch.msgid.link/20260721222404.204746-1-luca.fresi@bithiatec.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b0c3604 commit d40a28a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/tty/serial/sc16is7xx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,9 @@ static void sc16is7xx_tx_proc(struct kthread_work *ws)
874874
msleep(port->rs485.delay_rts_before_send);
875875

876876
guard(mutex)(&one->lock);
877+
sc16is7xx_port_update(port, SC16IS7XX_IER_REG,
878+
SC16IS7XX_IER_THRI_BIT,
879+
SC16IS7XX_IER_THRI_BIT);
877880
sc16is7xx_handle_tx(port);
878881
}
879882

0 commit comments

Comments
 (0)