Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1954698pxt; Sun, 8 Aug 2021 06:57:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3MqwHzt03bfqFL74rTzHmoRhIooMSW4aawTpdcrVotOrYXlim1kuWAEFvwNCXtD1JeM54 X-Received: by 2002:a17:906:3c10:: with SMTP id h16mr3258115ejg.205.1628431052410; Sun, 08 Aug 2021 06:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628431052; cv=none; d=google.com; s=arc-20160816; b=yuopgPskvAwxHqilHwHeQPja1oZFbzRSEfnc8BtA5EdCKdDUHRB+PbwHTCcQ1c4Jdd Bz5c8gxBrycUyi3xsiQz0vj7S/1GR98EE74WV0cJhwRQeC/FZc82IGFofijiGZZMdWHF ZFiWZDRghElt5wtp3m6ATEfii2VKC7S6AF+fAe7Ca1mWHDtK7jixkGf392/nZWdPTe3j 4b4ynL7zFjoRe8rPLZp3Vofa+6Zm2OCPeebCrBKevTkFcShSClPW0kQqbOjn3Srg0hUe 6zVYsJRbr9knCN8s3K9dJH0i0DFhT5HypptQXoq5Pbg6uVIovvPk07KaYtb+aktwS0Xw aA6w== 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=LxTRfixxiz5libXemxY9zhgA4nmuandtXO0Zvl+l2Ns=; b=clNBhCvyTSBNncrDE1iQoRP8ux8JOC5nnoYdk3KkRVpfcW8YGe6X7/p+syiM/NKQQc nt4wPjFYTWljrQsAbhu1VsJ9SKHtnEe+dPimh+usTrRhFMDe1R/dqhg7O8pVL89vYr/T TWinCI7d+r0dAK3Zds4WzYN9yNGh8g01ER49YqAOxfT/TWW+NfxS5rA4sYRklBGeBQGz e1NpwZH0NtpoUp6gSZN9+rfeJ2i5Az9T2GZLM69SZzYQYCHE7amRcooBlb38Rrz0ce55 QQZ9uEms/ohK9+p0HxISYgA8AidPz+fS9PUhsc0Ta1OhatykLHpcdKnBIW1uFeieFR0v M1MA== 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 hy6si14071085ejc.7.2021.08.08.06.57.08; Sun, 08 Aug 2021 06:57:32 -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 S231649AbhHHNzk (ORCPT + 99 others); Sun, 8 Aug 2021 09:55:40 -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; > >> } > >