Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752343AbbHQTXV (ORCPT ); Mon, 17 Aug 2015 15:23:21 -0400 Received: from www.linutronix.de ([62.245.132.108]:54026 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752293AbbHQTXR (ORCPT ); Mon, 17 Aug 2015 15:23:17 -0400 Date: Mon, 17 Aug 2015 21:22:48 +0200 (CEST) From: Thomas Gleixner To: Taichi Kageyama cc: "gregkh@linuxfoundation.org" , "peter@hurleysoftware.com" , "linux-serial@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "jslaby@suse.cz" , "prarit@redhat.com" , Naoya Horiguchi , "jiang.liu@linux.intel.com" Subject: Re: [PATCH v4] serial: 8250: Fix autoconfig_irq() to avoid race conditions In-Reply-To: <1439779518-31560-1-git-send-email-t-kageyama@cp.jp.nec.com> Message-ID: References: <1439779518-31560-1-git-send-email-t-kageyama@cp.jp.nec.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1130 Lines: 31 On Mon, 17 Aug 2015, Taichi Kageyama wrote: > diff --git tty-next.org/drivers/tty/serial/8250/8250_port.c tty-next.work/drivers/tty/serial/8250/8250_port.c > index 54e6c8d..9300b59 100644 > --- tty-next.org/drivers/tty/serial/8250/8250_port.c > +++ tty-next.work/drivers/tty/serial/8250/8250_port.c > @@ -1238,6 +1238,9 @@ static void autoconfig_irq(struct uart_8250_port *up) > inb_p(ICP); > } > > + if (uart_console(port)) > + console_lock(); > + > /* forget possible initially masked and pending IRQ */ > probe_irq_off(probe_irq_on()); > save_mcr = serial_in(up, UART_MCR); > @@ -1269,6 +1272,9 @@ static void autoconfig_irq(struct uart_8250_port *up) > if (port->flags & UPF_FOURPORT) > outb_p(save_ICP, ICP); > > + if (uart_console(port)) > + console_unlock(); > + > port->irq = (irq > 0) ? irq : 0; > } Reviewed-by: Thomas Gleixner -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/