Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965555AbcJXU45 (ORCPT ); Mon, 24 Oct 2016 16:56:57 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:34066 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965406AbcJXU4w (ORCPT ); Mon, 24 Oct 2016 16:56:52 -0400 From: Rob Herring To: Greg Kroah-Hartman , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Mike Galbraith , Mugunthan V N , Geert Uytterhoeven Cc: linux-kernel@vger.kernel.org, Peter Hurley , Alan Cox , Jiri Slaby , linux-serial@vger.kernel.org Subject: [PATCH] serial: core: fix console problems on uart_close Date: Mon, 24 Oct 2016 15:56:49 -0500 Message-Id: <20161024205649.32430-1-robh@kernel.org> X-Mailer: git-send-email 2.10.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1846 Lines: 50 Commit 761ed4a94582 ('tty: serial_core: convert uart_close to use tty_port_close') started setting the ttyport console flag for serial drivers. This is causing crashes, hangs, or garbage output on several platforms because the serial shutdown is skipped and IRQs are left enabled. Partially revert commit 761ed4a94582 and drop reporting UART tty_ports as a console leaving the console handling to the serial_core as it was before. Fixes: 761ed4a94582ab29 ("tty: serial_core: convert uart_close to use tty_port_close") Reported-by: Niklas Söderlund Reported-by: Mike Galbraith Reported-by: Mugunthan V N Cc: Peter Hurley Cc: Geert Uytterhoeven Cc: Alan Cox Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-serial@vger.kernel.org Signed-off-by: Rob Herring --- Geert's fix seems to be inadequate for some systems as Mike reported[1]. This fix works in Mike's case. Geert, Mugunthan, Can you all test this is enough to fix your issues. Rob [1] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1254753.html drivers/tty/serial/serial_core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 6e4f63627479..664c99aeeca5 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -2746,8 +2746,6 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport) uport->cons = drv->cons; uport->minor = drv->tty_driver->minor_start + uport->line; - port->console = uart_console(uport); - /* * If this port is a console, then the spinlock is already * initialised. -- 2.10.1