qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] imx_serial: Generate interrupt on tx empty if enabled
@ 2015-08-20 15:52 Guenter Roeck
  2015-09-11  7:37 ` Michael Tokarev
  0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2015-08-20 15:52 UTC (permalink / raw)
  To: Peter Chubb; +Cc: qemu-trivial, qemu-devel, 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 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.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 hw/char/imx_serial.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c
index f3fbc77..8dc791d 100644
--- a/hw/char/imx_serial.c
+++ b/hw/char/imx_serial.c
@@ -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;
     }
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] imx_serial: Generate interrupt on tx empty if enabled
  2015-08-20 15:52 [Qemu-devel] [PATCH] imx_serial: Generate interrupt on tx empty if enabled Guenter Roeck
@ 2015-09-11  7:37 ` Michael Tokarev
  2015-09-13 20:17   ` Peter Crosthwaite
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Tokarev @ 2015-09-11  7:37 UTC (permalink / raw)
  To: Guenter Roeck, Peter Chubb; +Cc: qemu-trivial, qemu-devel


Can we please have some r-b or ACK for this? :)

20.08.2015 18:52, Guenter Roeck wrote:
> 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.
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  hw/char/imx_serial.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c
> index f3fbc77..8dc791d 100644
> --- a/hw/char/imx_serial.c
> +++ b/hw/char/imx_serial.c
> @@ -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;
>      }
>  
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] imx_serial: Generate interrupt on tx empty if enabled
  2015-09-11  7:37 ` Michael Tokarev
@ 2015-09-13 20:17   ` Peter Crosthwaite
  2015-09-16 10:28     ` Michael Tokarev
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Crosthwaite @ 2015-09-13 20:17 UTC (permalink / raw)
  To: Michael Tokarev, Jean-Christophe Dubois
  Cc: qemu-trivial, Peter Chubb, qemu-devel@nongnu.org Developers,
	Guenter Roeck

On Fri, Sep 11, 2015 at 12:37 AM, Michael Tokarev <mjt@tls.msk.ru> wrote:
>
> Can we please have some r-b or ACK for this? :)
>
> 20.08.2015 18:52, Guenter Roeck wrote:
>> 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.
>>
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>


Looks right, Jean-Christophe may know more though.

Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>

>> ---
>>  hw/char/imx_serial.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c
>> index f3fbc77..8dc791d 100644
>> --- a/hw/char/imx_serial.c
>> +++ b/hw/char/imx_serial.c
>> @@ -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;

Out of scope, but this conditional looks wrong (in original code too).
Why does TXMPTYEN gate TRDY?

Regards,
Peter

>>      }
>>
>>
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] imx_serial: Generate interrupt on tx empty if enabled
  2015-09-13 20:17   ` Peter Crosthwaite
@ 2015-09-16 10:28     ` Michael Tokarev
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Tokarev @ 2015-09-16 10:28 UTC (permalink / raw)
  To: Peter Crosthwaite, Jean-Christophe Dubois
  Cc: qemu-trivial, Peter Chubb, qemu-devel@nongnu.org Developers,
	Guenter Roeck

13.09.2015 23:17, Peter Crosthwaite wrote:
> On Fri, Sep 11, 2015 at 12:37 AM, Michael Tokarev <mjt@tls.msk.ru> wrote:
>>
>> Can we please have some r-b or ACK for this? :)
>>
>> 20.08.2015 18:52, Guenter Roeck wrote:
>>> 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.
>>>
>>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> 
> Looks right, Jean-Christophe may know more though.

Thanks, applied to the trivial-patches tree :)

/mjt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-16 10:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-20 15:52 [Qemu-devel] [PATCH] imx_serial: Generate interrupt on tx empty if enabled Guenter Roeck
2015-09-11  7:37 ` Michael Tokarev
2015-09-13 20:17   ` Peter Crosthwaite
2015-09-16 10:28     ` Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).