Received: by 10.223.176.46 with SMTP id f43csp2334121wra; Thu, 25 Jan 2018 08:19:05 -0800 (PST) X-Google-Smtp-Source: AH8x225ePdrK0FsY7Xuou4pNhMuf9BBaiEaC37Hf+VPASEvYpS1wZB+GLpPfVwBiD8PiPPP1Syyz X-Received: by 10.98.138.21 with SMTP id y21mr16581942pfd.147.1516897145681; Thu, 25 Jan 2018 08:19:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516897145; cv=none; d=google.com; s=arc-20160816; b=EG29LT7uTlqqj+uMuebB4vMTyQiyBjFdr8I0p/r1jl9j364jK6fXFhEOOwN3t09eAo VETK/eHdVWMqQ8CWMxYS/YupCtwZzyDFW18K6fJfeNLHFoNOKxW0bFjHpJZQpZU6Mpq3 b1nnxb2lSbcafHf8iAMQVYZ34S4lT6oLMHyu6aFv7hINj6FtFClXAvZon2/LYVcHoaey OO4D2QWSDehNwPIXCkscZReaHw7ErUD0AhLqnC/cb/SNcW8oZ6bK1/jxSTr7KhFURY/v E4a1L49V0jDi6urilXDZWQOhajCKo1FRnXyCkTKnaVaI5dpRu2tGHA1OKFktIu8i0RQ6 Uvlw== 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 :arc-authentication-results; bh=gU3qlMm35cJVWSMNzmEsWtNsLojpyG+AeuJfxc9ZZ5I=; b=Jj1uDMA5ot6pzrjNtkektyfe7L6ZqWa6psVihxWrVq5xOdhCxw9kM1+mmK0NCtyxyq xqjjVGE6JLyrto93MP6JLBxLcf0wQ4iqd8eJ2dw0zRKGnLCKY33wHLYyepPBV7uBPklX V+xjfACu5gq+N3sj28fu4jE1LXk6+nfoBQnXOrTF0jZkGwT4mF0MXprD/d9CkqqIpOnZ ypjKCaNShDWiGXT+pQMPCT+t5KDZeF92fImeqoIrPKFiUJmQBWQFPQ7DZmBrVsmtnedK gBwXMrHcUQt5jC+h7r65/JdScoYWOfhZexBFhIw/RJDCGergCCTy7WluX2zZpe0RDSxj EqwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=Y+q2b868; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e16-v6si2168798pli.588.2018.01.25.08.18.51; Thu, 25 Jan 2018 08:19:05 -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=fail header.i=@lechnology.com header.s=default header.b=Y+q2b868; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751356AbeAYQSX (ORCPT + 99 others); Thu, 25 Jan 2018 11:18:23 -0500 Received: from vern.gendns.com ([206.190.152.46]:33480 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204AbeAYQSV (ORCPT ); Thu, 25 Jan 2018 11:18:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gU3qlMm35cJVWSMNzmEsWtNsLojpyG+AeuJfxc9ZZ5I=; b=Y+q2b8686LecDPGc+EG4e8lOBc cd9AZ+Zojl8anNT221fcEmVFc/WlAptgHn0TIMgXJh4lfWQiYPxHcHPimHt8U6rzLGyVNPpGKRcQO dO5867fDMdaH04KE5FrGat9F3luBYzCztYq6DkRB77VZmygTAM4A0RQmWnrshOeFODx6UDpoVaI9h jAXD6dgiGljZ1XrC9Hp7rqTiVZjXqJgKQc7XF46ZMJkt4yaseKQyp1brtYxBDdiO1s6i6iufb7Xkp /V1CDf1nF21untHQBptcF1SktDVgs4mqcWLHQtpeYvJD6qRJzadw9luJjfOcdNqQ5NqZzB/6mGc+M OmB/SAGg==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:51056 helo=[192.168.0.134]) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1eekDd-004OEf-I2; Thu, 25 Jan 2018 11:17:41 -0500 Subject: =?UTF-8?Q?Re:_[PATCH_v6_00/41]_ARM:_davinci:_convert_to_common_cloc?= =?UTF-8?Q?k_framework=e2=80=8b?= To: Sekhar Nori , Bartosz Golaszewski Cc: Adam Ford , linux-clk@vger.kernel.org, devicetree , linux-arm-kernel@lists.infradead.org, Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland , Kevin Hilman , Bartosz Golaszewski , Linux Kernel Mailing List References: <1516468460-4908-1-git-send-email-david@lechnology.com> <615bc302-e129-1501-63be-fa701f5ecaad@lechnology.com> <5f836454-5de7-c51d-d262-2c2dbc26e438@lechnology.com> <597caa1a-a790-3629-3186-5d2152f45e06@ti.com> From: David Lechner Message-ID: <12b97dc0-84e9-decd-16c0-9656b8aee072@lechnology.com> Date: Thu, 25 Jan 2018 10:18:19 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <597caa1a-a790-3629-3186-5d2152f45e06@ti.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/25/2018 06:53 AM, Sekhar Nori wrote: > On Wednesday 24 January 2018 01:33 PM, Bartosz Golaszewski wrote: >> 2018-01-23 21:23 GMT+01:00 David Lechner : >>> On 01/23/2018 02:05 PM, David Lechner wrote: >>>> >>>> On 01/23/2018 02:01 PM, David Lechner wrote: >>>>> >>>>> On 01/23/2018 01:53 PM, Bartosz Golaszewski wrote: >>>>>> >>>>>> >>>>>> In the mdio case - the problem is that devm_clk_get() doesn't fail, >>>>>> but somehow the clock doesn't end up in the list of the device's >>>>>> clocks - which is why it's not enabled by pm_runtime_get_sync(). >>>>>> >>>>> >>>>> >>>>> Right. This is because devm_clk_get() now finds the clock via device >>>>> tree instead of a clkdev lookup entry. However, I think that the PM >>>>> notifier registered in arch/arm/mach-davinci/pm_domain.c only uses >>>>> the clkdev lookup to match the con_id and does not use device tree. >>>>> The same thing is happing in mdio, emac and lcdc. >>>>> >>>> >>>> Minor correction: It looks like emac doesn't do this because it doesn't >>>> have a con_id of "fck". But, the same clock is shared by emac and mdio, so >>>> since mdio enables the clock, emac doesn't notice or care that it did >>>> not enable the clock itself. >>> >>> >>> How about using pm_clk_add_clk() in these drivers to explicitly use the >>> clocks for power management instead of relying on pm_clk_add_notifier() >>> to do this implicitly? >> >> Yes, this sounds good. > > Looking at how pm_clk_notify() in clock_ops.c uses con_id[] list, right > now pm_runtime() will work only for clocks which have con_id (from the > list above) mentioned in DT. Since clk_find() mandates con_id match when > its available, NULL con_id does not match. > > For simple devices like DaVinci which uses just one clock for power > management per device (multiple devices might share a clock, but not > other way around as far as I recall, anyway I will double check this > assertion), the attached patch should make EMAC work. > > That still leaves why lcdc does not work. One difference is it uses > PSC1. Are there other devices in PSC1 which work (just to rule out any > thing wrong with PSC1 handling). > > Thanks, > Sekhar > > ---8<--- > diff --git a/arch/arm/mach-davinci/pm_domain.c b/arch/arm/mach-davinci/pm_domain.c > index 78eac2c0c146..0dce7397856d 100644 > --- a/arch/arm/mach-davinci/pm_domain.c > +++ b/arch/arm/mach-davinci/pm_domain.c > @@ -23,7 +23,6 @@ static struct dev_pm_domain davinci_pm_domain = { > > static struct pm_clk_notifier_block platform_bus_notifier = { > .pm_domain = &davinci_pm_domain, > - .con_ids = { "fck", "master", "slave", NULL }, > }; > > static int __init davinci_pm_runtime_init(void) > > Won't this cause *all* clocks, not just PSC clocks, to be used for power management? Some examples of devices with more than just the PSC clock are SATA and the USB PHY.