From patchwork Mon Jan 4 18:22:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Fuzzey X-Patchwork-Id: 7950041 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8A8609F1C0 for ; Mon, 4 Jan 2016 18:23:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A5ED7202B8 for ; Mon, 4 Jan 2016 18:23:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 16FF6202B4 for ; Mon, 4 Jan 2016 18:23:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aG9m6-00017S-RV; Mon, 04 Jan 2016 18:22:34 +0000 Received: from ip83.parkeon.com ([213.152.31.83] helo=mta2.parkeon.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aG9m2-0000sX-2U for linux-arm-kernel@lists.infradead.org; Mon, 04 Jan 2016 18:22:32 +0000 Received: from time001.besancon.parkeon.com ([10.32.16.23] helo=mail.besancon.parkeon.com) by mta2.parkeon.com with esmtp (Exim 4.82) (envelope-from ) id 1aG9le-0007ns-Kb; Mon, 04 Jan 2016 19:22:06 +0100 Received: from [10.32.51.9] (port=41617 helo=[127.0.0.1]) by mail.besancon.parkeon.com with esmtp (Exim 4.71) (envelope-from ) id 1aG9le-0005CB-JW; Mon, 04 Jan 2016 19:22:06 +0100 Subject: [PATCH] serial: imx: Fix suspend / resume. To: Greg Kroah-Hartman From: Martin Fuzzey Date: Mon, 04 Jan 2016 19:22:06 +0100 Message-ID: <20160104182206.10852.47155.stgit@localhost> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Spam-Score: -2.0 (--) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160104_102230_304399_E93D6B40 X-CRM114-Status: GOOD ( 11.10 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Suspend fails due to unprepared clock: [ 638.794563] PM: Syncing filesystems ... done. [ 638.878902] Freezing user space processes ... (elapsed 0.002 seconds) done. [ 638.888454] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. [ 638.996697] PM: suspend of devices complete after 97.200 msecs [ 639.002611] PM: suspend devices took 0.100 seconds [ 639.013020] PM: late suspend of devices complete after 2.288 msecs [ 639.021486] ------------[ cut here ]------------ [ 639.026147] WARNING: CPU: 0 PID: 488 at drivers/clk/clk.c:732 clk_core_enable+0xc0/0x12c() [ 639.034413] Modules linked in: [ 639.037490] CPU: 0 PID: 488 Comm: system_server Tainted: G W 4.4.0-rc5-pknbsp-svn2214-atag-v4.4-rc5-121-gebfd9cb #1304 [ 639.049312] Hardware name: Freescale i.MX53 (Device Tree Support) [ 639.055444] [] (unwind_backtrace) from [] (show_stack+0x20/0x24) [ 639.063199] [] (show_stack) from [] (dump_stack+0x20/0x28) [ 639.070442] [] (dump_stack) from [] (warn_slowpath_common+0x88/0xc0) [ 639.078541] [] (warn_slowpath_common) from [] (warn_slowpath_null+0x2c/0x34) [ 639.087332] [] (warn_slowpath_null) from [] (clk_core_enable+0xc0/0x12c) [ 639.095777] [] (clk_core_enable) from [] (clk_enable+0x2c/0x40) [ 639.103441] [] (clk_enable) from [] (imx_serial_port_suspend_noirq+0x20/0xe0) [ 639.112336] [] (imx_serial_port_suspend_noirq) from [] (dpm_run_callback+0x68/0x16c) [ 639.121825] [] (dpm_run_callback) from [] (__device_suspend_noirq+0xf4/0x22c) [ 639.130705] [] (__device_suspend_noirq) from [] (dpm_suspend_noirq+0x148/0x30c) [ 639.139764] [] (dpm_suspend_noirq) from [] (suspend_devices_and_enter+0x2e8/0x6a4) [ 639.149078] [] (suspend_devices_and_enter) from [] (pm_suspend+0x310/0x4b8) [ 639.157782] [] (pm_suspend) from [] (state_store+0x7c/0xcc) [ 639.165099] [] (state_store) from [] (kobj_attr_store+0x1c/0x28) [ 639.172858] [] (kobj_attr_store) from [] (sysfs_kf_write+0x54/0x58) [ 639.180871] [] (sysfs_kf_write) from [] (kernfs_fop_write+0x100/0x1c8) [ 639.189152] [] (kernfs_fop_write) from [] (__vfs_write+0x3c/0xe8) [ 639.196991] [] (__vfs_write) from [] (vfs_write+0xa4/0x160) [ 639.204307] [] (vfs_write) from [] (SyS_write+0x4c/0x98) [ 639.211363] [] (SyS_write) from [] (ret_fast_syscall+0x0/0x3c) Signed-off-by: Martin Fuzzey --- drivers/tty/serial/imx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 016e4be..16a551b 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -2071,13 +2071,13 @@ static int imx_serial_port_suspend_noirq(struct device *dev) struct imx_port *sport = platform_get_drvdata(pdev); int ret; - ret = clk_enable(sport->clk_ipg); + ret = clk_prepare_enable(sport->clk_ipg); if (ret) return ret; serial_imx_save_context(sport); - clk_disable(sport->clk_ipg); + clk_disable_unprepare(sport->clk_ipg); return 0; } @@ -2088,13 +2088,13 @@ static int imx_serial_port_resume_noirq(struct device *dev) struct imx_port *sport = platform_get_drvdata(pdev); int ret; - ret = clk_enable(sport->clk_ipg); + ret = clk_prepare_enable(sport->clk_ipg); if (ret) return ret; serial_imx_restore_context(sport); - clk_disable(sport->clk_ipg); + clk_disable_unprepare(sport->clk_ipg); return 0; }