Received: by 10.223.185.116 with SMTP id b49csp6955095wrg; Wed, 28 Feb 2018 19:42:20 -0800 (PST) X-Google-Smtp-Source: AG47ELtd/oWLDjo9G9XTcrJ1XyachWigkdrRSzzCWJ1uqQHjHHMINo2o1UFPOqMisaMdGFknYQvF X-Received: by 10.99.110.131 with SMTP id j125mr389131pgc.382.1519875740274; Wed, 28 Feb 2018 19:42:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519875740; cv=none; d=google.com; s=arc-20160816; b=ZEPyLcz+O6rrLsWhrFwFY4vj0dQPzbVWQSu/1XjVUcdNvnVWDwnvjYkv13UUV6tf2t Jh7XbSZtOXwsDTcbtmkuG2DXUCbjgOjWmfAKWqXYaRBAcgpnS635lM6v5L6MFcY/HK/f FDsMMwqmycnzoWUE9N6ERZv48F7X+rbfhWegvFJgpUwAIbrlDC71l6CuMxN8v5eTqASk fdCE7QaQChCbQBtYw8lFPs5sYBFjGohVuGR6ouiUgCdtlc21Jlg3aO03XCkKggpnguM7 mIdjziooNu69N28sIktQwidMVC23YaXTXPtfDfS/WcVLPlkS0uYXxoYISu1Z1lJJ8Q6J fB7g== 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:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id:arc-authentication-results; bh=vqRbmKKyxNMxhFKd+yZzI9gN+nNrFHg2tKApZ2PBjM8=; b=dQnIF8FVuK57/t8FRuooKTVumTTS9c/qbml2+bR9M5cJRi0PkGGP9wYogqDdWsT/S8 9Hrb8RdaU8D4kEYUQuj/YpCdpGDZ04WAgpjjXT0qqXSfEOnFPKT9HYs1VrTW1u5XbQTd 7Vr60Q8Nx/81LHrQt5HHZKfB0u8NqbveDv5/37dwWYh/RATq+kE0QGkyARUv1htmtMF1 L7QIkdeG7/PBtQa3PBpwq02LiisyVU6im6xVvi6gUN/2MewQbKcHSebW7OYrwh/d3uFE 9XXgNjTq2qS7QMNGyyLxwhRqumtUeWLC8oVTcq54qujTz9EHdY2ZaSdm4zQn5Sya8byw 4J7Q== ARC-Authentication-Results: i=1; mx.google.com; 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 r17si1907729pgo.179.2018.02.28.19.41.54; Wed, 28 Feb 2018 19:42:20 -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; 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 S965697AbeCADkz (ORCPT + 99 others); Wed, 28 Feb 2018 22:40:55 -0500 Received: from regular1.263xmail.com ([211.150.99.131]:37998 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965662AbeCADky (ORCPT ); Wed, 28 Feb 2018 22:40:54 -0500 Received: from jeffy.chen?rock-chips.com (unknown [192.168.167.13]) by regular1.263xmail.com (Postfix) with ESMTP id A2B9D6208; Thu, 1 Mar 2018 11:40:47 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from [172.16.22.73] (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 736383D2; Thu, 1 Mar 2018 11:40:42 +0800 (CST) X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: tfiga@chromium.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: <010f964ee3883e8c87f6b5547557c0be> X-ATTACHMENT-NUM: 0 X-SENDER: cjf@rock-chips.com X-DNS-TYPE: 0 Received: from [172.16.22.73] (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 28218RXSRYB; Thu, 01 Mar 2018 11:40:47 +0800 (CST) Message-ID: <5A977638.8010506@rock-chips.com> Date: Thu, 01 Mar 2018 11:40:40 +0800 From: JeffyChen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20130126 Thunderbird/19.0 MIME-Version: 1.0 To: Tomasz Figa , Geert Uytterhoeven CC: Linux Kernel Mailing List , Dmitry Torokhov , Robin Murphy , Heiko Stuebner , Caesar Wang , Elaine Zhang , "open list:ARM/Rockchip SoC..." , Geert Uytterhoeven , Linux ARM , Ulf Hansson Subject: Re: [PATCH] soc: rockchip: power-domain: remove PM clocks References: <20180228111113.13639-1-jeffy.chen@rock-chips.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi guys, if i'm reading the code right, the PM clk means: 1/ the clocks which would be enabled while power on 2/ these clocks are optional, it's ok if anything wrong with them 3/ controlled by pm_domain(or USE_PM_CLK_RUNTIME_OPS & pm_clk_add_notifier) and currently we're adding all clocks of the attached device as PM clk in rockchip PM domain driver, which seems wrong. because we might have these kinds of clocks: 1/ critical, should block power on if anything wrong with it(failed to get/ prepare/ enable) 2/ optional, could ignore it if anything wrong 3/ only required in some special cases, for example register r/w, and doesn't need to stay enabled while power on so maybe we can: 1/ let the device(dts) or driver decide which clock is PM clk, and add it using *pm_clk_add* APIs (even of_pm_clk_add_clks() if all clocks are pm clk) 2/ add support for critical PM clk, which would return error to the driver if anything wrong 3/ make sure PM clk always be controlled(otherwise it might be unexpected disabled by other clocks under the same clk parent?): a) make sure Runtime PM is always enabled. and as discussed, we can select PM in ARCH_ROCKCHIP b) make sure the device has a PM domain to control PM clk: select ROCKCHIP_PM_DOMAINS for ARCH_ROCKCHIP(that would also select PM_GENERIC_DOMAINS) check dev->pm_domain before hand over PM clk, since we only care about EPROBE_DEFER when attach PM domain: ret = dev_pm_domain_attach(_dev, true); if (ret != -EPROBE_DEFER) { if (drv->probe) { ret = drv->probe(dev); or c) make pm_clk_suspend/pm_clk_resume part of the generic PM Runtime flow(even without a PM domain) On 02/28/2018 10:07 PM, Tomasz Figa wrote: > On Wed, Feb 28, 2018 at 10:11 PM, Geert Uytterhoeven > wrote: >> Hi Tomasz, >> >> On Wed, Feb 28, 2018 at 1:49 PM, Tomasz Figa wrote: >>> On Wed, Feb 28, 2018 at 9:32 PM, Geert Uytterhoeven >>> wrote: >>>> On Wed, Feb 28, 2018 at 1:29 PM, Tomasz Figa wrote: >>>>> Also, how about systems where runtime PM is disabled? I think that's >>>>> one of the reasons we control the clocks explicitly in the drivers >>>>> anyway. >>>> >>>> On many platforms, Runtime PM is always enabled. >>> >>> Can we make such assumption? If so, could we just make an explicit >>> "select PM_RUNTIME" in Kconfig of the SoC? >> >> Note that the PM_RUNTIME symbol was removed in commit 464ed18ebdb6236f >> ("PM: Eliminate CONFIG_PM_RUNTIME"), in favor of plain PM. >> >> The following already select PM unconditionally: >> - ARCH_OMAP2PLUS_TYPICAL >> - ARCH_RENESAS (except EMEV2) >> - ARCH_TEGRA >> - ARCH_VEXPRESS > > Thanks! Sounds like we might be able to simplify a lot of things with > doing the same for Rockchip. > > Best regards, > Tomasz > > >