From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755941AbdLVMvL (ORCPT ); Fri, 22 Dec 2017 07:51:11 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:41163 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755464AbdLVMvG (ORCPT ); Fri, 22 Dec 2017 07:51:06 -0500 X-Google-Smtp-Source: ACJfBouDtCsKTzDOUg168kCF3iogCmeeGutPsxFVDNwPtDFkCZYYoQMDDIbfXKkA63SC2Fvj6eu0IPu89iW6/1ncMpA= MIME-Version: 1.0 In-Reply-To: <1513935965-12909-1-git-send-email-aisheng.dong@nxp.com> References: <1513935965-12909-1-git-send-email-aisheng.dong@nxp.com> From: Ulf Hansson Date: Fri, 22 Dec 2017 13:51:05 +0100 Message-ID: Subject: Re: [RFC PATCH V1 1/2] clk: use atomic runtime pm api in clk_core_is_enabled To: Dong Aisheng Cc: linux-clk , Linux Kernel Mailing List , linux-arm-kernel@lists.infradead.org, Stephen Boyd , Mike Turquette , Marek Szyprowski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22 December 2017 at 10:46, Dong Aisheng wrote: > Current clk_pm_runtime_put is using pm_runtime_put_sync which > is not safe to be called in clk_core_is_enabled as it should > be able to run in atomic context. > > Thus use pm_runtime_put instead which is atomic safe. > > Cc: Stephen Boyd > Cc: Michael Turquette > Cc: Ulf Hansson > Cc: Marek Szyprowski > Fixes: 9a34b45397e5 ("clk: Add support for runtime PM") > Signed-off-by: Dong Aisheng Reviewed-by: Ulf Hansson Kind regards Uffe > --- > drivers/clk/clk.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c > index 5ec5809..e24968f 100644 > --- a/drivers/clk/clk.c > +++ b/drivers/clk/clk.c > @@ -227,7 +227,8 @@ static bool clk_core_is_enabled(struct clk_core *core) > > ret = core->ops->is_enabled(core->hw); > done: > - clk_pm_runtime_put(core); > + if (core->dev) > + pm_runtime_put(core->dev); > > return ret; > } > -- > 2.7.4 >