WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] ns16550: fix poll handling regression

To: Jan Beulich <JBeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] ns16550: fix poll handling regression
From: Keir Fraser <keir@xxxxxxx>
Date: Wed, 12 Oct 2011 17:14:08 +0100
Cc:
Delivery-date: Wed, 12 Oct 2011 09:16:24 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=KDvrVFeXO/eFXocNCdZKV7Rw91x8zkXeLxlYIikdQ9c=; b=r51eiCeuy/N43vVZXWDTAVomB81K1NyHAqsraHom+H6cqtIOzaPOJ0tv/Wq/gn20Cq S+7Wz1zsTsgZ4zkhsBIJ9Q1qXonRd1WfT92/EqfRbvrps+rjft6vbUc5K9IFvWGRadQM 2kkJDmvc1wScLm9TFcNza1A2lyEVCfknnrkCQ=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E95D0EB020000780005AE7D@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcyI+fg+kjpy6lqo9EKfR8gS06CCTA==
Thread-topic: [Xen-devel] [PATCH] ns16550: fix poll handling regression
User-agent: Microsoft-Entourage/12.30.0.110427
On 12/10/2011 16:39, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

> Prior to c/s 23811:f1349a968a5a LSR_THRE was checked only once, while
> there it got promoted into the surrounding loop's condition. Since that
> bit may not clear for an extended period of time (i.e. when no new
> output is generated), it must not be used in this way indefinitely.

That particular part of 23811 was gratuitous on my part, as well as being
wrong. I've simply reverted it, as c/s 23948. Thanks for spotting it or
tracking it down!

 -- Keir

> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> --- a/xen/drivers/char/ns16550.c
> +++ b/xen/drivers/char/ns16550.c
> @@ -157,15 +157,18 @@ static void __ns16550_poll(struct cpu_us
>  {
>      struct serial_port *port = this_cpu(poll_port);
>      struct ns16550 *uart = port->uart;
> -    char lsr;
> +    unsigned char lsr, mask = LSR_DR | LSR_THRE;
>  
>      if ( uart->intr_works )
>          return; /* Interrupts work - no more polling */
>  
> -    while ( (lsr = ns_read_reg(uart, LSR)) & (LSR_DR|LSR_THRE) )
> +    while ( (lsr = ns_read_reg(uart, LSR)) & mask )
>      {
>          if ( lsr & LSR_THRE )
> +        {
>              serial_tx_interrupt(port, regs);
> +            mask &= ~LSR_THRE;
> +        }
>          if ( lsr & LSR_DR )
>              serial_rx_interrupt(port, regs);
>      }
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>