Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp12162173ybl; Sat, 28 Dec 2019 06:29:13 -0800 (PST) X-Google-Smtp-Source: APXvYqyn4f2KA+/g7MsPEunQP4MIlN8phgIBceysO7vtT68rrDdSF9FHXTDStY0erAqqQMEI37y9 X-Received: by 2002:a05:6830:2102:: with SMTP id i2mr60861022otc.123.1577543353552; Sat, 28 Dec 2019 06:29:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577543353; cv=none; d=google.com; s=arc-20160816; b=EmIBxj7Y6hXZNOI+/5lR2XWmf8Guv61nFW6LvmVhEUbUZoHuGrm9pIDrBWr8pSYEty KPpklY+3/jl+naoTk/jdCZh50+b2PJN76kHIF3Ay0O5jpZxqi5wuJYbdvJ7uTKwo6aAn 5Hh5Bs3EX6aBaAizuI0sljR7XeLVlmFeIclY6jXIfdQXaf7ZSZvEHDjkipHb+vY24rDa bmtOozFsFx+HvWyufSoB/fasNhHn19O+oNAgOAZbv3T8hZ0SkDRGo5+7NJ3z/w0wUUrI IgvToj8/pEcifyIFB9wfvHu5SuOCrr7B44ce7bYV4zyOIdbWkYU2b3GDtkSTN6SqLTqq WiPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=iAuK2SBAgN48OmwXuS6DbfYeXQRIySmXgJ5nwEn6J+0=; b=zux82zUjBVuMEkeyn8TGRQDz8As1+9HvF/RKfZsN0pgsgPgBDpwW/3JcgLgDBnuFKa xA+R3ughIMB9jlqlmr+9T/L2CPjx1uEFvWorJ6ptH/CkCIApHVVMJRpAha0IBTh4Eg2v /q2zVN7hiwcCVXuapsvyW+wQ5WtxQAzcYrxYYcsLa48LPW4xkmm3W1fSUhlQbPNJJwwU MACz0F+62wAX/AJmmvV2T/dHSgl8qVSlr3Y27HT9vqt80p/Va+yTMJBF9zt6WAhOSqKJ S61FNnOJDbkrQDSY6DerYDPqOzna8vwH1XF5Eqmz8Wmzc1zdEABmd2OTsT9bWgP/ErQy Zbxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ikTPpXF2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l26si18753891oti.152.2019.12.28.06.29.02; Sat, 28 Dec 2019 06:29:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ikTPpXF2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726310AbfL1O23 (ORCPT + 99 others); Sat, 28 Dec 2019 09:28:29 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:35099 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726080AbfL1O22 (ORCPT ); Sat, 28 Dec 2019 09:28:28 -0500 Received: by mail-lj1-f195.google.com with SMTP id j1so21982675lja.2; Sat, 28 Dec 2019 06:28:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=iAuK2SBAgN48OmwXuS6DbfYeXQRIySmXgJ5nwEn6J+0=; b=ikTPpXF27m2ICXJim+rCrrRHWHjsrqOyiZ5r0f9CyoOwRsVnnmB82THtJadZClWkGG 4kKt5rbX3X8doChqSkTclrGZtBm3mhfxxifOYHL4JTTlz9/4LMwy7r/zeifzotHVBxcb V5c3yYwAIlYSU34W70FFp6PIGKFWPeore8OIgKxVlxSu0D7I0Yc1qBvt53+we1zdrcZe TBRSGheIXAGofownsYtROn14ZSXV15Vp3RvwanWQ6FAYGiaexfDLHH6nAUiDQKYXbU5s VTJ2Ytz0zUPixs+yOQgjnzOxCbFNS8NUYSAudM6IU5gbmMRwNVF7F+vzbJKTBzZ4t5rn WvBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=iAuK2SBAgN48OmwXuS6DbfYeXQRIySmXgJ5nwEn6J+0=; b=LC7qui1GaD+2cKLnidwIYboKgo3jUNIFocBkmfjjOeyMO7+bbU67BJIiOPh4t+0nD3 ZHDZSQTxlXnZENWYFEioOMJ63TF99q8JOiPHybFFrvZwTwZxj21YOecIRJcC8PTUjRFo AYTvekks99j7LrU83PbE6+rBuahEWmi2A9Qhl0QFoRk7peS3q1NGf9Jpx1m2iGcmEABo JPJWnuNmEclm+DLfugFpIqEy3Ns11pPy881Hw+DPZwg+/axAF3jb1hLzZ2RBI0MMOpE4 EgDOKB8FbhlkoIs8fqwGgb4vZf4aGM9cYQThqFl4P4Z1GfZWqQA9n6Ux1mej4dvJvZcr UIUQ== X-Gm-Message-State: APjAAAUT5qAswZw7cA/pUae9MTBXIQ/s3EeJuFnt0wOpDNJk6l9trmEl xHkKrKIkeUNZ+lPfu/seD4m7Ysi9 X-Received: by 2002:a2e:9e55:: with SMTP id g21mr10456969ljk.245.1577543306222; Sat, 28 Dec 2019 06:28:26 -0800 (PST) Received: from [192.168.2.145] (79-139-233-37.dynamic.spd-mgts.ru. [79.139.233.37]) by smtp.googlemail.com with ESMTPSA id w6sm16026296lfq.95.2019.12.28.06.28.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 28 Dec 2019 06:28:25 -0800 (PST) Subject: Re: [PATCH v5 12/19] ASoC: tegra: Add initial parent configuration for audio mclk To: Sowjanya Komatineni , thierry.reding@gmail.com, jonathanh@nvidia.com, broonie@kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, mperttunen@nvidia.com, gregkh@linuxfoundation.org, sboyd@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: pdeschrijver@nvidia.com, pgaikwad@nvidia.com, spujar@nvidia.com, josephl@nvidia.com, daniel.lezcano@linaro.org, mmaddireddy@nvidia.com, markz@nvidia.com, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org References: <1576880825-15010-1-git-send-email-skomatineni@nvidia.com> <1576880825-15010-13-git-send-email-skomatineni@nvidia.com> <1b79ab92-c163-3857-dd38-df35c509b823@gmail.com> <4fd01e04-8240-8562-467d-324f7adbdbdf@nvidia.com> From: Dmitry Osipenko Message-ID: <0eaf3942-047b-2412-7843-315842dcf5d1@gmail.com> Date: Sat, 28 Dec 2019 17:28:24 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <4fd01e04-8240-8562-467d-324f7adbdbdf@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 28.12.2019 00:25, Sowjanya Komatineni пишет: > > On 12/22/19 1:18 PM, Dmitry Osipenko wrote: >> 23.12.2019 00:14, Dmitry Osipenko пишет: >>> 21.12.2019 01:26, Sowjanya Komatineni пишет: >>>> Tegra PMC clock clk_out_1 is dedicated for audio mclk from Tegra30 >>>> through Tegra210 and currently Tegra clock driver does initial parent >>>> configuration for audio mclk "clk_out_1" and enables them by default. >>>> >>>> With the move of Tera PMC clocks from clock driver to Tegra PMC >>>> driver, initial parent configuration for audio clocks are through >>>> the device tree using assigned-clock-parents property. >>>> >>>> Default clock parents can be specified in device tree using >>>> assigned-clocks and assigned-clock-parents and there is no need >>>> to have clock driver do parent configuration and enable audio related >>>> clocks. >>>> >>>> This patch has implementation for initial parent configuration in >>>> audio driver when default parent configuration is not specified in the >>>> device tree using assigned-clock properties and enables audio clocks >>>> during the clock rate change. >>>> >>>> This patch configures PLLA_OUT0 as parent to extern1 and extern1 >>>> as parent to clk_out_1 and uses clk_out_1 as cdev1 clock to allow >>>> mclk control from this driver. >>>> >>>> Signed-off-by: Sowjanya Komatineni >>>> --- >>>>   sound/soc/tegra/tegra_asoc_utils.c | 71 >>>> ++++++++++++++++++++++---------------- >>>>   1 file changed, 41 insertions(+), 30 deletions(-) >>>> >>>> diff --git a/sound/soc/tegra/tegra_asoc_utils.c >>>> b/sound/soc/tegra/tegra_asoc_utils.c >>>> index 38535962029c..fc3135c08f43 100644 >>>> --- a/sound/soc/tegra/tegra_asoc_utils.c >>>> +++ b/sound/soc/tegra/tegra_asoc_utils.c >>>> @@ -7,6 +7,7 @@ >>>>    */ >>>>     #include >>>> +#include >>> This is illegal, it is not a clock provider. >>> > __clk_is_enabled API is used in this patch to disable clock only when > its enabled. As I wrote in the other reply, this is a wrong solution since it works around the problem and doesn't solve the root of the problem. Please fix it properly in the next version. > __clk_is_enabled API is from clk-provider.h That's exactly the reason why it is in clk-provider.h, you absolutely cannot use __clk_is_enabled() outside of clk providers because: 1. __clk_is_enabled doesn't use any lockings, so you need to be very careful when using it 2. every function that is prefixed with __ is usually meant for internal use only 3. tegra_asoc_utils is simply not a clk provider, such cases when you need to do hacks in order to achieve something are a good indication about that you're likely doing something wrong