Received: by 10.223.176.46 with SMTP id f43csp2140322wra; Thu, 25 Jan 2018 05:38:00 -0800 (PST) X-Google-Smtp-Source: AH8x2247xSMFoIivrUjznrGiNLbgwYUhjgZPuC5cw2Y0A94XpT4fpZOfMf8vfZiXLrqWH2A5YA0Y X-Received: by 10.99.153.1 with SMTP id d1mr3291148pge.190.1516887480756; Thu, 25 Jan 2018 05:38:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516887480; cv=none; d=google.com; s=arc-20160816; b=Aekj/H6JrAs3lXCg6MwInYB8v6b7oBRLL39zIajac3Fb5OLUOP3eQGbDy2l1a3TBei 0udcDN4WRyPiY4IlEufKkihW9OiW7o0tVWzKZW0OrcOYlDqPcdmkotUpkyNsGj4byXmK mqt/JEL+QQeOJjSmSLkptKB+3TznW+tnWg7wykaVhzmiGY2EolniHnv4holFTTV/eA2N JGuSyyKZGwwgDN6vvRR6ymkh9qBJ/l5qYlHeeaNTt2DEXQ5g6WPWxqb/TDXwFOGOfsjf Tnkw1BfJtttuktLQHpOm0KWansJfpjhTSje/VLzvWtv+kYN3CRd/nAy2sT/Spss/dOPy +sBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=dFlQZp5QLjA/RQaKK8sCrr1MH6OOi/ELQB1cQBiWu8A=; b=SbK/JmoIh6tkuNDtdjoBfm1YcbGpnQn0qM2kTYvrlmnnWwifgEah1SBjlyVeOKnqWD GuNuNd20rRNV86ttW5JbUjgydGliAB7uAd+sJ1y47AR+1H3FDvuFRvPmKZNJHRDTe2pZ lDll1cPhi6n4FYBQdzSeVEnrW6V49MBYtj3tgabbyxGAWtEw6RUsfiJy1UW8urY/HYab CcLJ7rFKiuHNxmF4OB8Z6nZR29h91IxQLsK4NFfJK+xnQptRj9BEDrZ8d9OeRjnvrCsd iNuzm+BWtkOFtEOou1Ur1Q8H5kUp/DKBjB3nbq+059NJ9nLpHcTEaWPuI8NL+uE8wo03 PDwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=db/WNKea; 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 x70si1574340pgd.590.2018.01.25.05.37.46; Thu, 25 Jan 2018 05:38:00 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=db/WNKea; 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 S1751388AbeAYNe6 (ORCPT + 99 others); Thu, 25 Jan 2018 08:34:58 -0500 Received: from mail-vk0-f67.google.com ([209.85.213.67]:36546 "EHLO mail-vk0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751375AbeAYNev (ORCPT ); Thu, 25 Jan 2018 08:34:51 -0500 Received: by mail-vk0-f67.google.com with SMTP id m197so4824588vka.3 for ; Thu, 25 Jan 2018 05:34:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=dFlQZp5QLjA/RQaKK8sCrr1MH6OOi/ELQB1cQBiWu8A=; b=db/WNKeaaGv+A6vS99ytX5APBPj/pWZsnv3Cpwm4lgHkloxqPwihJNem032kb7v/Ma xYxDmyXJGqbFOvVF81nMri05oxbGWBp28t+piRS/M7x4XMm9Kfc6J47CeQ6MVvukgxQy bJhsOMiGTEGROn/RAJlU2CA/wjI9n5w8plG4/fmXF93BUlXW3pRuyljHHwJ/EMsgc0zY xHL+KI1cSEyYq2TPECVANLud13V8DOvD8y7P96Jqflo1UTbGijv2nk620K+up3P7BM+y bY66J2IetjOfEWP2NFvlzQEBuq/lX09meXbziN955lDwrTPhStOBw011qT7xTchmV311 5Bmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=dFlQZp5QLjA/RQaKK8sCrr1MH6OOi/ELQB1cQBiWu8A=; b=brVY+oxqooG6F18+GthicHjG4wwPAmkMf3Aln41U7A4cObX/5Ub9BOBCz6Lk4F2ael h6tsIovbq3gnrtgodQ/pWZHMo0dyIoP8YECQKmjdjRnS8u9BM2AJlV0UF8r0eMa4Zumd ExachsxWO23AsTKv2MRreqIsYOdG5nUcqAEe8+3Jk7msI4ToHey+6KWguB78HdPuiL8E 3OqGT5/vVbmugP0xJJfzPNOPC/3xqnveIV8O0C+tuEm4sNtTWqC6jYu7kqCutHjLFV/H vpRw+E+D2hLJlbwtxCCdQ9kRrkANy6EKyPRVgtbkE6Cbcrjzdya7EJftqCd0ZAMXv6+m vl1g== X-Gm-Message-State: AKwxytd5LW3P6uT1iPs953KiSdrPGqRubVcAKrMrOfbQVS99iYhoBVI/ PyHij2/vM25fwinpl71A14bs7qpnJTKmD2UYYRJU9A== X-Received: by 10.31.227.68 with SMTP id a65mr7360627vkh.95.1516887290730; Thu, 25 Jan 2018 05:34:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.134.87 with HTTP; Thu, 25 Jan 2018 05:34:50 -0800 (PST) In-Reply-To: <597caa1a-a790-3629-3186-5d2152f45e06@ti.com> 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: Bartosz Golaszewski Date: Thu, 25 Jan 2018 14:34:50 +0100 Message-ID: Subject: =?UTF-8?Q?Re=3A_=5BPATCH_v6_00=2F41=5D_ARM=3A_davinci=3A_convert_to_common?= =?UTF-8?Q?_clock_framework=E2=80=8B?= To: Sekhar Nori Cc: Bartosz Golaszewski , David Lechner , Adam Ford , linux-clk@vger.kernel.org, devicetree , arm-soc , Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland , Kevin Hilman , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-01-25 13:53 GMT+01:00 Sekhar Nori : > 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. > Tested on da850-lcdk - patch does indeex fix emac on da850-lcdk, but tilcdc still complains. > 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). > Emac uses PSC1 too. GPIO and I2C1 work fine, but OHCI rarely lives through any cpufreq transition. I'm still trying to figure out why it's dying. Thanks, Bartosz