From: Ian Jackson Subject: Re: [PATCH] IRQ handling race and spurious IIR read in serial/8250.c Date: Thu, 19 Feb 2009 17:52:59 +0000 Message-ID: <18845.40059.190188.291643@mariner.uk.xensource.com> References: <1233800599.5398.0.camel@balanced-tree> <18827.7191.646173.99255@mariner.uk.xensource.com> <1233862446.5676.28.camel@balanced-tree> <1233870772.5676.40.camel@balanced-tree> <18833.40557.119090.48930@mariner.uk.xensource.com> <18834.63479.700909.321686@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <18834.63479.700909.321686@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Linux Kernel Mailing List Cc: "xen-devel@lists.xensource.com" , Markus Armbruster , Anders Kaseorg List-Id: xen-devel@lists.xenproject.org I wrote: > In drivers/serial/8250.c in Linux there are two bugs: > 1. UART_BUG_TXEN can be spuriously set, due to an IRQ race > 2. The workaround then applied by the kernel is itself buggy Markus Armbruster has also experienced this problem in a Xen environment and has confirmed that my patch fixes it. I think at the very least this change: > Proposed initial band-aid fix (against 2.6.28.4): > > Do not read IIR in serial8250_start_tx when UART_BUG_TXEN > > Reading the IIR clears some oustanding interrupts so it is not safe. > Instead, simply transmit immediately if the buffer is empty without > regard to IIR. > > Signed-off-by: Ian Jackson should be made right away. Ian.