From patchwork Mon Feb 22 22:05:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 8384211 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 24CD79F372 for ; Mon, 22 Feb 2016 22:07:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 48C472034F for ; Mon, 22 Feb 2016 22:07:18 +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 6930C202E6 for ; Mon, 22 Feb 2016 22:07:17 +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 1aXybq-0006IZ-LG; Mon, 22 Feb 2016 22:05:38 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aXybo-0006Aw-Ib for linux-arm-kernel@lists.infradead.org; Mon, 22 Feb 2016 22:05:37 +0000 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 7B64460679; Mon, 22 Feb 2016 22:05:15 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 6CAB96060D; Mon, 22 Feb 2016 22:05:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: 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 Received: from localhost (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 102466022D; Mon, 22 Feb 2016 22:05:14 +0000 (UTC) Date: Mon, 22 Feb 2016 14:05:14 -0800 From: Stephen Boyd To: Tony Lindgren Subject: Re: [PATCHv2] clk: ti: omap3+: dpll: use non-locking version of clk_get_rate Message-ID: <20160222220514.GZ4847@codeaurora.org> References: <1455966777-30576-1-git-send-email-t-kristo@ti.com> <20160222165252.GF13417@atomide.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160222165252.GF13417@atomide.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160222_140536_660360_936332EC X-CRM114-Status: GOOD ( 21.34 ) 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: Tero Kristo , mturquette@baylibre.com, linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On 02/22, Tony Lindgren wrote: > * Tero Kristo [160220 03:12]: > > As the code in this file is being executed within irq context in some > > cases, we must avoid the clk_get_rate which uses mutex internally. > > Switch the code to use clk_hw_get_rate instead which is non-locking. > > > > This fixes an issue where PM runtime will hang the system if enabled > > with a serial console before a suspend-resume cycle. > > Can you please add the "Fixes: " line here? > > And when applying, please tag this one Cc stable. > > Other than that, please feel free to add: > > Tested-by: Tony Lindgren > This is what I got. "Fixes" should take care of stable. From: Tero Kristo Subject: [PATCH] clk: ti: omap3+: dpll: use non-locking version of clk_get_rate As the code in this file is being executed within irq context in some cases, we must avoid the clk_get_rate which uses mutex internally. Switch the code to use clk_hw_get_rate instead which is non-locking. This fixes an issue where PM runtime will hang the system if enabled with a serial console before a suspend-resume cycle. Signed-off-by: Tero Kristo Tested-by: Tony Lindgren Fixes: a53ad8ef3dcc ("clk: ti: Convert to clk_hw based provider APIs") Signed-off-by: Stephen Boyd --- drivers/clk/ti/dpll3xxx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/ti/dpll3xxx.c b/drivers/clk/ti/dpll3xxx.c index 1c300388782b..cc739291a3ce 100644 --- a/drivers/clk/ti/dpll3xxx.c +++ b/drivers/clk/ti/dpll3xxx.c @@ -460,7 +460,8 @@ int omap3_noncore_dpll_enable(struct clk_hw *hw) parent = clk_hw_get_parent(hw); - if (clk_hw_get_rate(hw) == clk_get_rate(dd->clk_bypass)) { + if (clk_hw_get_rate(hw) == + clk_hw_get_rate(__clk_get_hw(dd->clk_bypass))) { WARN_ON(parent != __clk_get_hw(dd->clk_bypass)); r = _omap3_noncore_dpll_bypass(clk); } else {