From patchwork Wed Dec 4 23:54:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 3285851 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 21696C0D4A for ; Wed, 4 Dec 2013 23:54:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 062E7204FF for ; Wed, 4 Dec 2013 23:54:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ABB4D204FB for ; Wed, 4 Dec 2013 23:54:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754489Ab3LDXyq (ORCPT ); Wed, 4 Dec 2013 18:54:46 -0500 Received: from gloria.sntech.de ([95.129.55.99]:45256 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754216Ab3LDXyp (ORCPT ); Wed, 4 Dec 2013 18:54:45 -0500 Received: from 146-52-37-199-dynip.superkabel.de ([146.52.37.199] helo=marty.localnet) by gloria.sntech.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1VoMHA-00082M-V6; Thu, 05 Dec 2013 00:54:41 +0100 From: Heiko =?utf-8?q?St=C3=BCbner?= To: "Greg Kroah-Hartman" Subject: [PATCH] serial: samsung: move clock deactivation below uart registration Date: Thu, 5 Dec 2013 00:54:38 +0100 User-Agent: KMail/1.13.7 (Linux/3.2.0-3-686-pae; KDE/4.8.4; i686; ; ) Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Kukjin Kim , Chander Kashyap MIME-Version: 1.0 Message-Id: <201312050054.39327.heiko@sntech.de> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 60e93575476f (serial: samsung: enable clock before clearing pending interrupts during init) added handling of the controller clock during init. On most systems this clock is also one of the baud_clock sources and possibly used by the earlycon and thus already enabled by the bootloader. Therefore a gap exists between s3c24xx_serial_init_port disabling the clock and an attached console reenabling it, making the transition from earlycon to regular console possibly hang the system - as seen on my S3C2442 based Freerunner today. Therefore move the disabling of the clock from s3c24xx_serial_init_port below the uart port registration, effectively creating an overlap and keeping the clock running non-stop if the console wants to grab this port. Signed-off-by: Heiko Stuebner Reviewed-by: Tomasz Figa --- drivers/tty/serial/samsung.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index c1af04d..9cd706d 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -1209,7 +1209,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, /* reset the fifos (and setup the uart) */ s3c24xx_serial_resetport(port, cfg); - clk_disable_unprepare(ourport->clk); return 0; } @@ -1287,6 +1286,13 @@ static int s3c24xx_serial_probe(struct platform_device *pdev) uart_add_one_port(&s3c24xx_uart_drv, &ourport->port); platform_set_drvdata(pdev, &ourport->port); + /* + * Deactivate the clock enabled in s3c24xx_serial_init_port here, + * so that a potential re-enablement through the pm-callback overlaps + * and keeps the clock enabled in this case. + */ + clk_disable_unprepare(ourport->clk); + #ifdef CONFIG_SAMSUNG_CLOCK ret = device_create_file(&pdev->dev, &dev_attr_clock_source); if (ret < 0)