Received: by 10.223.176.46 with SMTP id f43csp2096636wra; Thu, 25 Jan 2018 04:59:26 -0800 (PST) X-Google-Smtp-Source: AH8x226ZEBJz6+GZ1RjkaQpdq97NvPAq9v9TQStd2jQN7vrMRmHN4M1hs8gnci4DgkQzRyvhI7nD X-Received: by 10.98.74.133 with SMTP id c5mr16274649pfj.188.1516885166144; Thu, 25 Jan 2018 04:59:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516885166; cv=none; d=google.com; s=arc-20160816; b=cLfowYIt2fpCQQPHIGvBAXBZWxm1xYa/W30wHgXw33KV6lq9ID2XbOEFEAYReZgiFY np8pjrU1S2bqoTGgixDhtWnoKxJZdZPaiEMwj4P5/FocDucN0L18mTKOyd0X4Yhx1I7K KcNbJeLwkwZyQv4zrR71k4zOYBkSD9GLhjlO23k6vcX7BZ0Cb+mDDnyQqrfixuKdAKFC ou9M/5YRcMVLzkZJ0UN+fFTmMftQMvyXxyxzrFiuhpCP3lidQcp2BOzGhy3Mwq5F8FiZ 2YFoKxeI8qeELoCfrikMU1qoRcmw9BaFYxv2vhwjFXyYx7RyztbIk5/bwekO8OT0TKCE YzVg== 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=3LjJx+Z6Ifm9fiBZWnUUX5JwjEJC8BVczjXq1Tb9bCU=; b=bhT9AJGlOfDIiqqID1PyAuQyur3ggGXwYr5UuhLj8JAcQb0LS4Wy1GvJBzQOwjkVIe 8ulLmzMXQqn+UMJIoj09dUx1SQ9cLiZQd+21ka2Y9Fqc25rKexVT8HAvxbAaDeCrtEmM ti62HCSrzZQCBnu5c8Gqt/nT+bEoX0AO6N1G34I2GHtT8iaAvdsNWBoJXuwPueMkGsxl 3nVcx1UQFj7ZIO/oMDXtciPTAvgpIY5loAWhz4HPdPTFusfFISTPvWhXICmxTcRCBtEW TV2ej2jlJfQ87fs8O1osqJRkJTuHIU0oGKcVupYVoesDQanfh5qg6+Ih7c/kZKdyInp/ Ok+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=GfgtVZ2w; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b21si4589377pfn.195.2018.01.25.04.59.11; Thu, 25 Jan 2018 04:59:26 -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=@ti.com header.s=ti-com-17Q1 header.b=GfgtVZ2w; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751902AbeAYMy6 (ORCPT + 99 others); Thu, 25 Jan 2018 07:54:58 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:16585 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751227AbeAYMyz (ORCPT ); Thu, 25 Jan 2018 07:54:55 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w0PCrnRg030156; Thu, 25 Jan 2018 06:53:49 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1516884829; bh=bYoInKt6lillfilLjORkpUROS6bjW79+4EjfDLgTuqc=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=GfgtVZ2ww8C+NEEQS+1hqyzlj5k6OVyIfW0lpRwXqNaRBsuXQ9PSrZgNZTFTd1p39 M9OrDRVo8IApgkkt4Fy3UJ3xOg+8lQQqNv4OQf4C9fttkdOKCKiWLVy1cLxv7bSKxv vrY2SFzm3jlacurEVP1Xvj+95JsuVNu3pJYf9fQc= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w0PCrnpv019896; Thu, 25 Jan 2018 06:53:49 -0600 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Thu, 25 Jan 2018 06:53:49 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Thu, 25 Jan 2018 06:53:49 -0600 Received: from [172.24.190.171] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w0PCrN4o018000; Thu, 25 Jan 2018 06:53:29 -0600 Subject: =?UTF-8?Q?Re:_[PATCH_v6_00/41]_ARM:_davinci:_convert_to_common_cloc?= =?UTF-8?Q?k_framework=e2=80=8b?= To: Bartosz Golaszewski , David Lechner CC: Adam Ford , , devicetree , , 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> From: Sekhar Nori Message-ID: <597caa1a-a790-3629-3186-5d2152f45e06@ti.com> Date: Thu, 25 Jan 2018 18:23:23 +0530 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: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)