From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754471AbZBSRxT (ORCPT ); Thu, 19 Feb 2009 12:53:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751506AbZBSRxG (ORCPT ); Thu, 19 Feb 2009 12:53:06 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:48634 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751805AbZBSRxF (ORCPT ); Thu, 19 Feb 2009 12:53:05 -0500 X-IronPort-AV: E=Sophos;i="4.38,236,1233550800"; d="scan'208";a="40450099" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18845.40059.190188.291643@mariner.uk.xensource.com> Date: Thu, 19 Feb 2009 17:52:59 +0000 To: Linux Kernel Mailing List Cc: Anders Kaseorg , "xen-devel@lists.xensource.com" , Markus Armbruster Subject: Re: [PATCH] IRQ handling race and spurious IIR read in serial/8250.c In-Reply-To: <18834.63479.700909.321686@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> X-Mailer: VM 7.19 under Emacs 21.4.1 From: Ian Jackson X-OriginalArrivalTime: 19 Feb 2009 17:53:02.0098 (UTC) FILETIME=[E89D8720:01C992BA] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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. From mboxrd@z Thu Jan 1 00:00:00 1970 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.