From patchwork Mon Oct 24 20:56:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 79080 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp2782220qge; Mon, 24 Oct 2016 13:56:55 -0700 (PDT) X-Received: by 10.98.74.147 with SMTP id c19mr32084243pfj.16.1477342614665; Mon, 24 Oct 2016 13:56:54 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zx17si3491800pab.11.2016.10.24.13.56.54; Mon, 24 Oct 2016 13:56:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965522AbcJXU4x (ORCPT + 2 others); Mon, 24 Oct 2016 16:56:53 -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 Received: by mail-oi0-f67.google.com with SMTP id p136so4009370oic.1; Mon, 24 Oct 2016 13:56:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=06OhgE7hsIXcCIcjzjvyfSWfCMYysff6/RATVf2UaBI=; b=amnMEULEjX07BzNjRRN3qhXwvPY590Tjfz9s+vaUY8eMsXyfRQdueFMmO7ZlEak4eM g+yl/BlOw3ctTbaF5z8qLX7HxA9IVqLPa4ywduG48mawCMwnT2IyVCW0LfHB9FvvLb+Y Iaz1kW8L2fUvH6P7cQNP0o4gSzJk0ywzWGk6RIiTg47pTZuA2vcCBSCdUDPoaD9TiFSP /AtV5ivKd6UHYicUNXyCoAWls9hoyAhNegrfCcfelXPlh45Cf6eGs0Fi+S4IFQNkzCcZ OyZ4zi2PScqD311q+dLOcMvhXm3+E9Odjp+3WAMrIaY774BK+CmsthMLarL1kYFX3LFM tnyA== X-Gm-Message-State: ABUngvdvEGZWJoYcWUyWjJOJJHOvoLulhTXKraCp8RzHl/Pkw9KJWAEMmva1vj9m0/7K+Q== X-Received: by 10.157.60.79 with SMTP id j15mr2760664ote.241.1477342611296; Mon, 24 Oct 2016 13:56:51 -0700 (PDT) Received: from rob-hp-laptop.herring.priv (72-48-98-129.dyn.grandenetworks.net. [72.48.98.129]) by smtp.googlemail.com with ESMTPSA id y88sm7263ota.2.2016.10.24.13.56.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Oct 2016 13:56:50 -0700 (PDT) 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 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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(-) -- 2.10.1 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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.