imx_serial: Generate interrupt on tx empty if enabled
PATCH 1/1 imx_serial: Generate interrupt on tx empty if enabled
Generate an interrupt if the tx buffer is empty and the tx empty interrupt is enabled. This fixes a problem seen when running a Linux image since Linux commit 55c3cb1358e ("serial: imx: remove unneeded imx_transmit_buffer() from imx_start_tx()"). Linux now waits for the tx empty interrupt before starting to send data, causing transmit stalls until there is an interrupt for another reason.
--- hw/char/imx_serial.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
hw/char/imx_serial.c +3 -1
@@ -145,7 +145,9 @@ static void imx_update(IMXSerialState *s)uint32_t flags; flags = (s->usr1 & s->ucr1) & (USR1_TRDY |USR1_RRDY ); -if (!(s->ucr1 &UCR1_TXMPTYEN )) { +if (s->ucr1 &UCR1_TXMPTYEN ) { + flags |= (s->uts1 &UTS1_TXEMPTY ); + }else { flags &= ~USR1_TRDY ; }
Signature · 1 line
2.1.4
Can we please have some r-b or ACK for this? :)
Quoted 28 lines · Guenter Roeck
Generate an interrupt if the tx buffer is empty and the tx empty interrupt is enabled. This fixes a problem seen when running a Linux image since Linux commit
55c3cb1358e("serial: imx: remove unneededimx_transmit_buffer()fromimx_start_tx()"). Linux now waits for the tx empty interrupt before starting to send data, causing transmit stalls until there is an interrupt for another reason.Signed-off-by Guenter Roeck <[email protected]>--- hw/char/imx_serial.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)hw/char/imx_serial.c +3
-1@@ -145,7 +145,9 @@ static void imx_update(IMXSerialState *s)uint32_t flags; flags = (s->usr1 & s->ucr1) & (USR1_TRDY |USR1_RRDY ); -if (!(s->ucr1 &UCR1_TXMPTYEN )) { +if (s->ucr1 &UCR1_TXMPTYEN ) { + flags |= (s->uts1 &UTS1_TXEMPTY ); + }else { flags &= ~USR1_TRDY ; }
Peter Crosthwaite
Reviewed-byQuoted 12 lines · Michael Tokarev
Can we please have some r-b or ACK for this? :)
Quoted 8 lines · Guenter Roeck
Generate an interrupt if the tx buffer is empty and the tx empty interrupt is enabled. This fixes a problem seen when running a Linux image since Linux commit
55c3cb1358e("serial: imx: remove unneededimx_transmit_buffer()fromimx_start_tx()"). Linux now waits for the tx empty interrupt before starting to send data, causing transmit stalls until there is an interrupt for another reason.Signed-off-by Guenter Roeck <[email protected]>
Looks right, Jean-Christophe may know more though.
Quoted 11 lines
Quoted 11 lines
--- hw/char/imx_serial.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)hw/char/imx_serial.c +0
-0@@ -145,7 +145,9 @@ static void imx_update(IMXSerialState *s)uint32_t flags;
Quoted 6 lines
hw/char/imx_serial.c static void imx_update(IMXSerialState *s) · line 151
Quoted 6 lines
hw/char/imx_serial.c +3
-1flags = (s->usr1 & s->ucr1) & (USR1_TRDY |USR1_RRDY ); -if (!(s->ucr1 &UCR1_TXMPTYEN )) { +if (s->ucr1 &UCR1_TXMPTYEN ) { + flags |= (s->uts1 &UTS1_TXEMPTY ); + }else { flags &= ~USR1_TRDY ;
Out of scope, but this conditional looks wrong (in original code too). Why does TXMPTYEN gate TRDY?
Regards,
Peter
Quoted 5 lines
Quoted 3 lines
hw/char/imx_serial.c +0
-0}
Michael Tokarev
AppliedQuoted 12 lines · Peter Crosthwaite
Quoted 11 lines · Michael Tokarev
Can we please have some r-b or ACK for this? :)
Quoted 7 lines · Guenter Roeck
Generate an interrupt if the tx buffer is empty and the tx empty interrupt is enabled. This fixes a problem seen when running a Linux image since Linux commit
55c3cb1358e("serial: imx: remove unneededimx_transmit_buffer()fromimx_start_tx()"). Linux now waits for the tx empty interrupt before starting to send data, causing transmit stalls until there is an interrupt for another reason.
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Signed-off-by Guenter Roeck <[email protected]>Looks right, Jean-Christophe may know more though.
Thanks, applied to the trivial-patches tree :)
/mjt