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: 8384191 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 00CFEC0553 for ; Mon, 22 Feb 2016 22:05:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1F3D3205D1 for ; Mon, 22 Feb 2016 22:05:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D56C205C2 for ; Mon, 22 Feb 2016 22:05:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755880AbcBVWFR (ORCPT ); Mon, 22 Feb 2016 17:05:17 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:56798 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755613AbcBVWFQ (ORCPT ); Mon, 22 Feb 2016 17:05:16 -0500 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id C52A860617; Mon, 22 Feb 2016 22:05:15 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B81436022D; 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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Cc: Tero Kristo , mturquette@baylibre.com, linux-clk@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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 {