Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2666561pxj; Mon, 14 Jun 2021 04:26:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqO/KCXsdRtBK1YYiZCGgP9dyV7dB1EchcYdUbAEvkfLe9BvdA5KXNexr7Eg4I01XaHgMU X-Received: by 2002:a17:906:7742:: with SMTP id o2mr15112057ejn.284.1623670016676; Mon, 14 Jun 2021 04:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623670016; cv=none; d=google.com; s=arc-20160816; b=otGCys2Wrt5OBuX8S8si3l6YvWOf9AcOkfFwAJM8eQacPK5bGGdbMiGHoLTcZCIPJe Dsr0D2NvsAE1/BaWyTup+78l8Wr/2HmmhDuK8G8FYW+pbGHYyKCdLFzLZS3iLrEenxT0 OEUtuwVgb8BiW4pyJSlOtFVeJjEoIq1qjbTXsoGFGxlJquO5xHJz2AIuIMK6GSqeR9mc WzYt/EkHISx1w/D50vPxU3yM9CDR06FLa+tB5Ws2+iHhSSgyGozE/dcfPaj+99+NcDTD D0MMZq9TIQKp09j2xfgWs/LXrRaEGIM1Jni5FBdcSDQLg9fvRLLnA7GRWG5mbSYyFa6Z EMVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=LcbcGY7RHwWFWdd8p1qG6VBjeAwxmPOTGIsI1i0jypU=; b=BYJJEBrsX2El+2Bv4ipyOvHcVqomWJpcdTmUQCRts7VMq2DAeXV4+HGIut5k5HAsc0 L7WSJyl/LQ8VEZyshrvCwfY0cYhY+UoE6AuCJ6NkDI1d88d80blbj6pjxqPFhWZ9pK7Z 4/F4ygcu3LT7Y7rsZrklXnpjukBqopvF87zEyhMhmzk3E0eFdSDWTWaodfYufRuLUg8c +J7zTIKKggimccnC0NLCtVRy8wTcfQ4GmzvexVBLyhu+h1JZukK34QpUOuoEYIxzaywF xe8K4ZrLvwgPnb/W+k+isyJD6ToV6TrAnxGdDoPbChJviZl16A5zRDUigK2L2+Ldnpb3 5ehA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ar29si10630750ejc.193.2021.06.14.04.26.29; Mon, 14 Jun 2021 04:26:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233708AbhFNL1j convert rfc822-to-8bit (ORCPT + 99 others); Mon, 14 Jun 2021 07:27:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:42878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235126AbhFNLNM (ORCPT ); Mon, 14 Jun 2021 07:13:12 -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 C194A61961; Mon, 14 Jun 2021 10:48:42 +0000 (UTC) Date: Mon, 14 Jun 2021 11:50:43 +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: <20210614115043.07ea0ae1@jic23-huawei> In-Reply-To: <20210613233041.128961-2-alexander.sverdlin@gmail.com> References: <20210613233041.128961-1-alexander.sverdlin@gmail.com> <20210613233041.128961-2-alexander.sverdlin@gmail.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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; > }