From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.5 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 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 D26ACC4320A for ; Sun, 8 Aug 2021 13:55:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B24EE6103B for ; Sun, 8 Aug 2021 13:55:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231736AbhHHNzl (ORCPT ); Sun, 8 Aug 2021 09:55:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:33132 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229923AbhHHNzk (ORCPT ); Sun, 8 Aug 2021 09:55:40 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (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 216746101E; Sun, 8 Aug 2021 13:55:19 +0000 (UTC) Date: Sun, 8 Aug 2021 14:58:09 +0100 From: Jonathan Cameron To: Alexander Sverdlin Cc: Geert Uytterhoeven , Nikita Shubin , linux-iio@vger.kernel.org, Lars-Peter Clausen , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/7] iio: ep93xx: Prepare clock before using it Message-ID: <20210808145809.5797c590@jic23-huawei> In-Reply-To: <24f29bc6-311c-4f96-2e1b-1a5df936bb3a@gmail.com> References: <20210613233041.128961-1-alexander.sverdlin@gmail.com> <20210613233041.128961-2-alexander.sverdlin@gmail.com> <20210614115043.07ea0ae1@jic23-huawei> <24f29bc6-311c-4f96-2e1b-1a5df936bb3a@gmail.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2 Aug 2021 09:30:23 +0200 Alexander Sverdlin wrote: > Hello Jonathan! > > On 14/06/2021 12:50, Jonathan Cameron wrote: > > On Mon, 14 Jun 2021 01:30:35 +0200 > > Alexander Sverdlin wrote: > > > >> Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch > >> to Common Clock Framework, otherwise the following is visible: > >> > >> WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc > >> Enabling unprepared ep93xx-adc > >> CPU: 0 PID: 1 Comm: swapper Not tainted 5.13.0-rc5-... #1 > >> Hardware name: Cirrus Logic EDB9302 Evaluation Board > >> [] (unwind_backtrace) from [] (show_stack+0x10/0x18) > >> [] (show_stack) from [] (dump_stack+0x20/0x2c) > >> [] (dump_stack) from [] (__warn+0x98/0xc0) > >> [] (__warn) from [] (warn_slowpath_fmt+0x90/0xc0) > >> [] (warn_slowpath_fmt) from [] (clk_core_enable+0x9c/0xbc) > >> [] (clk_core_enable) from [] (clk_core_enable_lock+0x18/0x30) > >> [] (clk_core_enable_lock) from [] (ep93xx_adc_probe+0xe4/0x1a0) > >> [] (ep93xx_adc_probe) from [] (platform_probe+0x34/0x80) > >> [] (platform_probe) from [] (really_probe+0xe8/0x394) > >> [] (really_probe) from [] (device_driver_attach+0x5c/0x64) > >> [] (device_driver_attach) from [] (__driver_attach+0x7c/0xec) > >> [] (__driver_attach) from [] (bus_for_each_dev+0x78/0xc4) > >> [] (bus_for_each_dev) from [] (driver_attach+0x18/0x24) > >> [] (driver_attach) from [] (bus_add_driver+0x140/0x1cc) > >> [] (bus_add_driver) from [] (driver_register+0x74/0x114) > >> [] (driver_register) from [] (__platform_driver_register+0x18/0x24) > >> [] (__platform_driver_register) from [] (ep93xx_adc_driver_init+0x10/0x1c) > >> [] (ep93xx_adc_driver_init) from [] (do_one_initcall+0x7c/0x1a4) > >> [] (do_one_initcall) from [] (kernel_init_freeable+0x17c/0x1fc) > >> [] (kernel_init_freeable) from [] (kernel_init+0x8/0xf8) > >> [] (kernel_init) from [] (ret_from_fork+0x14/0x3c) > >> ... > >> ep93xx-adc ep93xx-adc: Cannot enable clock > >> ep93xx-adc: probe of ep93xx-adc failed with error -108 > >> > >> Signed-off-by: Alexander Sverdlin > > Acked-by: Jonathan Cameron > > > > From cover letter I'm assuming you want these to go through same route as > > the common clock conversion? If not shout and I can pick this one up. > > We didn't manage to consolidate the delivery path for this series, could > you please take this patch alone, as you proposed initially? Sure. Applied to the togreg branch of iio.git and pushed out as testing for 0-day to see if it can find anything we missed. Thanks, Jonathan > > >> --- > >> drivers/iio/adc/ep93xx_adc.c | 6 +++--- > >> 1 file changed, 3 insertions(+), 3 deletions(-) > >> > >> diff --git a/drivers/iio/adc/ep93xx_adc.c b/drivers/iio/adc/ep93xx_adc.c > >> index c08ab3c6dfaf..5c85257b814c 100644 > >> --- a/drivers/iio/adc/ep93xx_adc.c > >> +++ b/drivers/iio/adc/ep93xx_adc.c > >> @@ -207,7 +207,7 @@ static int ep93xx_adc_probe(struct platform_device *pdev) > >> */ > >> } > >> > >> - ret = clk_enable(priv->clk); > >> + ret = clk_prepare_enable(priv->clk); > >> if (ret) { > >> dev_err(&pdev->dev, "Cannot enable clock\n"); > >> return ret; > >> @@ -215,7 +215,7 @@ static int ep93xx_adc_probe(struct platform_device *pdev) > >> > >> ret = iio_device_register(iiodev); > >> if (ret) > >> - clk_disable(priv->clk); > >> + clk_disable_unprepare(priv->clk); > >> > >> return ret; > >> } > >> @@ -226,7 +226,7 @@ static int ep93xx_adc_remove(struct platform_device *pdev) > >> struct ep93xx_adc_priv *priv = iio_priv(iiodev); > >> > >> iio_device_unregister(iiodev); > >> - clk_disable(priv->clk); > >> + clk_disable_unprepare(priv->clk); > >> > >> return 0; > >> } > >