From patchwork Thu Jan 25 12:53:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sekhar Nori X-Patchwork-Id: 10183979 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 112D760388 for ; Thu, 25 Jan 2018 12:55:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F24BE28A87 for ; Thu, 25 Jan 2018 12:55:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3DFB28A8A; Thu, 25 Jan 2018 12:55:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 703D628A87 for ; Thu, 25 Jan 2018 12:55:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VHHOqBIOO84q0UbdKM4S1N90l/xtL+On3u63yHPsbm0=; b=s+brbJ8jzcI88u CkTdclH67HQRjB4F74PUuJr8dHowr7I/YmlU3fwTlcPtv2wjnBL428l9aADeR5eR32n9KmgMNx4f6 ylVnM+YiXbwB8dNO/Pt8GwPKQ/HtxmZi7kmi56H++RImOshStlCV8XzgitI4bP2McqgtUOegZWGYE cg8hS4tXIvtaaPqcvm+GHSUC2ijYw7FMqYpQQ71V2PBjLFvw4pVNB+FlN0vkvuiRn49fSEpG8kXhZ MP1oksSqAimAVfEX1x9Dj4mFaNxUPHk5TM7gkNB8FEjYjVvifztLdTNOLYSp8oBviyV8AwOUzmn2A /5f7HQZZpQtE7KhkWTeg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eeh3R-0007er-5J; Thu, 25 Jan 2018 12:54:57 +0000 Received: from lelnx193.ext.ti.com ([198.47.27.77]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eeh3M-0007eN-Se for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2018 12:54:54 +0000 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 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-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree , Kevin Hilman , Michael Turquette , Stephen Boyd , Linux Kernel Mailing List , Bartosz Golaszewski , Rob Herring , Adam Ford , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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)