From patchwork Fri May 8 12:33:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226119 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BBF1C47254 for ; Fri, 8 May 2020 13:17:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D6148218AC for ; Fri, 8 May 2020 13:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588943824; bh=iu9kPeQefUOz9tbxzl85LDuwE2UENP8ezYaTmda1qaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=E7vshJlP/02lSUJjWtQANTDvKuxJNkeQ0PDwBt0cb83bqZ3P/cYJsAAjZ1vK+F90Y +ngR8sr9aEN8Znq+nQiQ1n4caHcm6i58NcK54fWVy3vpdh7jdAi3Ofyojw0akVdmPt ylghRBCv7oiupbN7jksNojC9DDmhfXmZ5ZntMvXI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728038AbgEHMo1 (ORCPT ); Fri, 8 May 2020 08:44:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:42822 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729192AbgEHMoZ (ORCPT ); Fri, 8 May 2020 08:44:25 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D8BDD208D6; Fri, 8 May 2020 12:44:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588941865; bh=iu9kPeQefUOz9tbxzl85LDuwE2UENP8ezYaTmda1qaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TqAS4wrSVLrAyX9LgSSvR8VVrZbBeQk0WYpD0bT/mFO6VBdpjF+YAu03OVMGFfzk4 hAT3cF4r5nRL5QRFkUe1e1k6wBXLhxwqpWNp7lnqv6XxvjSUgZQWROAzSFaryM9EZr uV7wSu7kmM7oOVnDYQbpZmo6ckISb47BHrOL94Vw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tero Kristo , Tony Lindgren , Stephen Boyd Subject: [PATCH 4.4 204/312] clk: ti: omap3+: dpll: use non-locking version of clk_get_rate Date: Fri, 8 May 2020 14:33:15 +0200 Message-Id: <20200508123138.772609902@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123124.574959822@linuxfoundation.org> References: <20200508123124.574959822@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tero Kristo commit a0d54c3899aaeb047969d9479263c6bcf385c331 upstream. 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 Signed-off-by: Greg Kroah-Hartman --- drivers/clk/ti/dpll3xxx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/clk/ti/dpll3xxx.c +++ b/drivers/clk/ti/dpll3xxx.c @@ -437,7 +437,8 @@ int omap3_noncore_dpll_enable(struct clk 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 {