Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4074412rwi; Wed, 12 Oct 2022 10:12:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5u9+JQaeKnbmYnUjUZ1X7FjriSkMga3/evlS9okM2hBz6nQcdZVKh19FZND4YH0VIi/JOy X-Received: by 2002:aa7:cb43:0:b0:458:b6ac:fb7 with SMTP id w3-20020aa7cb43000000b00458b6ac0fb7mr27970378edt.43.1665594738449; Wed, 12 Oct 2022 10:12:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665594738; cv=none; d=google.com; s=arc-20160816; b=sBsZIto67smUuzKN6GPCAoWg91NcpcVIAy5CW3xhmagdZVV8qXQ9Xfy+5TqgkYmbRa VrJIM3eoDgLz86rrINfWHqh4mdeKuxvbKRc3ZOGMHLlAi5LcGwrOhgaKr6dmfs9yv4LW K1LrxZOBkoL3jQImW7k/7F4nxDQLsFgfTkjRs7UlyHVKLBHQmpi1psv1JUxUqggRSBrE Ttk9vkoHY4p03+VfExk9G8dj7yWn5lC2siGgJ1zySCoNyOUrwxbhxWXmTmmvWm+BXVSE QVs6cqp0D0Ri3QLX9Jci0va/djgswBAveHwhHs3+7HuvihgSJO19gBHUWzlH395iUKRo kBwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bmGqIzDexb4K/x9FikhNFT7NpRKtqPgp39rIrMSMKTA=; b=0tXS8wX8lYTY+AVfPMH4S1HbyI9MBs71JYHgh9FpQncZ7bC8JIKPD5ElABWySiF5mZ rMSG3y6QhlQrCY3tXuylSW3UBEzCoI3PHN/Qup7ipfjFDOxUqTBvrKr1Nuol8tlKnReG 7Ce6uoHFs6Ehd5MeNx1RNTfrIL6st1j/bWJLRG50u1Ihd/88A8GQDamaukqzQUgKPyS2 IbvWcBnEaBdCqDdl13NtGaIC8y+MyVkH+tzd92HTplQrlrumzrc5HvQ04SVNqjKG445o I4yAKuvmQ+ZLV5oiy6U/MK6rRjGg+eC6AYO9FS7zdAEpqDwdNP1wGvoDGSD7qh2fdJM9 1BIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vJc+dkG+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fj3-20020a1709069c8300b007314b427e96si20471245ejc.633.2022.10.12.10.11.49; Wed, 12 Oct 2022 10:12:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vJc+dkG+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229607AbiJLQT6 (ORCPT + 99 others); Wed, 12 Oct 2022 12:19:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229573AbiJLQT4 (ORCPT ); Wed, 12 Oct 2022 12:19:56 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90A791C41D; Wed, 12 Oct 2022 09:19:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AAA73B81A61; Wed, 12 Oct 2022 16:19:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E16CCC433D6; Wed, 12 Oct 2022 16:19:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665591591; bh=TEDjogBy+ecqduxNWQvtcOqrUZbEXN3M1edKYOv2Kik=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vJc+dkG+SDhZ587/nB8yJgEeqLGk6vg6xMvfXgkcwSttnuYcdtUYvKQKGHMFZgGWO OXu5gGm6v3E+Aax24MEzRf58atn8s77BkPUZrhukOLvM80T8F5NmdBeQqjRmJRNYKr lbMVJynC/ibSUrrK4PjJP74170sW9LGV/uP8Lnd4= Date: Wed, 12 Oct 2022 18:20:35 +0200 From: Greg Kroah-Hartman To: Shawn Guo Cc: Jiri Slaby , Martin Kaiser , Pengutronix Kernel Team , NXP Linux Team , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] serial: imx: Add missing .thaw_noirq hook Message-ID: References: <20221012121353.2346280-1-shawn.guo@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221012121353.2346280-1-shawn.guo@linaro.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 12, 2022 at 08:13:53PM +0800, Shawn Guo wrote: > The following warning is seen with non-console UART instance when > system hibernates. > > [ 37.371969] ------------[ cut here ]------------ > [ 37.376599] uart3_root_clk already disabled > [ 37.380810] WARNING: CPU: 0 PID: 296 at drivers/clk/clk.c:952 clk_core_disable+0xa4/0xb0 > ... > [ 37.506986] Call trace: > [ 37.509432] clk_core_disable+0xa4/0xb0 > [ 37.513270] clk_disable+0x34/0x50 > [ 37.516672] imx_uart_thaw+0x38/0x5c > [ 37.520250] platform_pm_thaw+0x30/0x6c > [ 37.524089] dpm_run_callback.constprop.0+0x3c/0xd4 > [ 37.528972] device_resume+0x7c/0x160 > [ 37.532633] dpm_resume+0xe8/0x230 > [ 37.536036] hibernation_snapshot+0x288/0x430 > [ 37.540397] hibernate+0x10c/0x2e0 > [ 37.543798] state_store+0xc4/0xd0 > [ 37.547203] kobj_attr_store+0x1c/0x30 > [ 37.550953] sysfs_kf_write+0x48/0x60 > [ 37.554619] kernfs_fop_write_iter+0x118/0x1ac > [ 37.559063] new_sync_write+0xe8/0x184 > [ 37.562812] vfs_write+0x230/0x290 > [ 37.566214] ksys_write+0x68/0xf4 > [ 37.569529] __arm64_sys_write+0x20/0x2c > [ 37.573452] invoke_syscall.constprop.0+0x50/0xf0 > [ 37.578156] do_el0_svc+0x11c/0x150 > [ 37.581648] el0_svc+0x30/0x140 > [ 37.584792] el0t_64_sync_handler+0xe8/0xf0 > [ 37.588976] el0t_64_sync+0x1a0/0x1a4 > [ 37.592639] ---[ end trace 56e22eec54676d75 ]--- > > On hibernating, pm core calls into related hooks in sequence like: > > .freeze > .freeze_noirq > .thaw_noirq > .thaw > > With .thaw_noirq hook being absent, the clock will be disabled in a > unbalanced call which results the warning above. > > imx_uart_freeze() > clk_prepare_enable() > imx_uart_suspend_noirq() > clk_disable() > imx_uart_thaw > clk_disable_unprepare() > > Adding the missing .thaw_noirq hook as imx_uart_resume_noirq() will have > the call sequence corrected as below and thus fix the warning. > > imx_uart_freeze() > clk_prepare_enable() > imx_uart_suspend_noirq() > clk_disable() > imx_uart_resume_noirq() > clk_enable() > imx_uart_thaw > clk_disable_unprepare() > > Signed-off-by: Shawn Guo What commit id does this fix, and does it need to go to older/stable kernels? thanks, greg k-h