From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB5D2C433DF for ; Thu, 14 May 2020 15:18:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2B4F20728 for ; Thu, 14 May 2020 15:18:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726294AbgENPSX (ORCPT ); Thu, 14 May 2020 11:18:23 -0400 Received: from muru.com ([72.249.23.125]:54488 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbgENPSX (ORCPT ); Thu, 14 May 2020 11:18:23 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id B9C0A80C0; Thu, 14 May 2020 15:19:11 +0000 (UTC) Date: Thu, 14 May 2020 08:18:19 -0700 From: Tony Lindgren To: Tero Kristo Cc: linux-omap@vger.kernel.org, "Andrew F . Davis" , Santosh Shilimkar , Suman Anna , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rob Herring , devicetree@vger.kernel.org Subject: Re: [PATCH 2/6] soc: ti: omap-prm: Add basic power domain support Message-ID: <20200514151819.GO37466@atomide.com> References: <20200512203852.29499-1-tony@atomide.com> <20200512203852.29499-3-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org * Tero Kristo [200514 08:05]: > On 12/05/2020 23:38, Tony Lindgren wrote: > > +struct omap_prm_domain { > > + struct device *dev; > > + struct omap_prm *prm; > > + struct generic_pm_domain pd; > > + void __iomem *pwrstctrl; > > + void __iomem *pwrstst; > > I think the pwrstst is not really used as of now, it is just part of couple > of dev_dbg prints. Yes to me it seems the pwrstst only changes later on. > > +static int omap_prm_domain_power_on(struct generic_pm_domain *domain) > > +{ > > + struct omap_prm_domain *prmd; > > + u32 v; > > + > > + prmd = genpd_to_prm_domain(domain); > > + if (!prmd->cap) > > + return 0; > > + > > + dev_dbg(prmd->dev, "%s: %s: old state: pwrstctrl: %08x pwrstst: %08x\n", > > + __func__, prmd->pd.name, readl_relaxed(prmd->pwrstctrl), > > + readl_relaxed(prmd->pwrstst)); > > + > > + if (prmd->pwrstctrl_saved) > > + v = prmd->pwrstctrl_saved; > > + else > > + v = readl_relaxed(prmd->pwrstctrl); > > + > > + writel_relaxed(v | OMAP_PRMD_ON_ACTIVE, prmd->pwrstctrl); > > + dev_dbg(prmd->dev, "%s: %s: new state pwrstctrl: %08x\n", > > + __func__, prmd->pd.name, readl_relaxed(prmd->pwrstctrl)); > > Should we wait for the transition to complete here? Good idea :) > > + v &= ~PRM_POWERSTATE_MASK; > > + v |= omap_prm_domain_find_lowest(prmd); > > + > > + if (prmd->cap->statechange) > > + v |= PRM_LOWPOWERSTATECHANGE; > > + if (prmd->cap->logicretstate) > > + v &= ~PRM_LOGICRETSTATE; > > + else > > + v |= PRM_LOGICRETSTATE; > > + > > + writel_relaxed(v, prmd->pwrstctrl); > > Should we wait for the transition to complete here? Would be nice yeah. > Is any of the following clock handling needed, and if yes, whats its > purpose? > > It looks like this is only used for ABE clkctrl handling on omap4/omap5 (at > least for now), but afaik, ABE clkctrl is read only so this code would > effectively do nothing (and potentially just even fail.) Yeah this seems unnecessary, let's plan on leaving it out. I think the clocks in the l4_abe dst changes are actually handled by simple-pm-bus, not this driver, I was just confused :) Regards, Tony From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E2B8C433E1 for ; Thu, 14 May 2020 15:18:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 54ABC20728 for ; Thu, 14 May 2020 15:18:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OSj/IdUc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54ABC20728 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=atomide.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DypNdyZIZF3Thdix0x878rQeAav2okXgGW1yZMgwJxg=; b=OSj/IdUcYNRSJb z5G7Vkjvo1BdkZhNmOoYBXddVcH236sJZpeDEKeCCxrgBumhvFII4EYi4qF67WvCeZGXGFRsX4n/Z 3NQeacHWxx5wfutXWQ/qU7wOfkv2f6HtKgdBtF5tyYVkDFkCrjleevoSnU01K0brFa4UKRrPJAQ7P YxGJRy6hpOKmXk0rpM5RJXxzklkJ6xr6iGzbX+NOj5rgwkb/XKz39Tg19SzL8HbTN8SzuqtaHSm/W m0MP7+Gi0uR7aRgdf4pAiG3P9UeEcL26bcqPU5jfzyZu0diFZWaWDvxO94YoLo0aouJTEmGZxZgEN B2iq8bpekn3Sq8FdVbUA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZFcv-0004aG-RN; Thu, 14 May 2020 15:18:25 +0000 Received: from muru.com ([72.249.23.125]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZFcs-0004Zr-KU for linux-arm-kernel@lists.infradead.org; Thu, 14 May 2020 15:18:23 +0000 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id B9C0A80C0; Thu, 14 May 2020 15:19:11 +0000 (UTC) Date: Thu, 14 May 2020 08:18:19 -0700 From: Tony Lindgren To: Tero Kristo Subject: Re: [PATCH 2/6] soc: ti: omap-prm: Add basic power domain support Message-ID: <20200514151819.GO37466@atomide.com> References: <20200512203852.29499-1-tony@atomide.com> <20200512203852.29499-3-tony@atomide.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200514_081822_713590_4AC0E089 X-CRM114-Status: GOOD ( 12.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, "Andrew F . Davis" , Santosh Shilimkar , Suman Anna , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org * Tero Kristo [200514 08:05]: > On 12/05/2020 23:38, Tony Lindgren wrote: > > +struct omap_prm_domain { > > + struct device *dev; > > + struct omap_prm *prm; > > + struct generic_pm_domain pd; > > + void __iomem *pwrstctrl; > > + void __iomem *pwrstst; > > I think the pwrstst is not really used as of now, it is just part of couple > of dev_dbg prints. Yes to me it seems the pwrstst only changes later on. > > +static int omap_prm_domain_power_on(struct generic_pm_domain *domain) > > +{ > > + struct omap_prm_domain *prmd; > > + u32 v; > > + > > + prmd = genpd_to_prm_domain(domain); > > + if (!prmd->cap) > > + return 0; > > + > > + dev_dbg(prmd->dev, "%s: %s: old state: pwrstctrl: %08x pwrstst: %08x\n", > > + __func__, prmd->pd.name, readl_relaxed(prmd->pwrstctrl), > > + readl_relaxed(prmd->pwrstst)); > > + > > + if (prmd->pwrstctrl_saved) > > + v = prmd->pwrstctrl_saved; > > + else > > + v = readl_relaxed(prmd->pwrstctrl); > > + > > + writel_relaxed(v | OMAP_PRMD_ON_ACTIVE, prmd->pwrstctrl); > > + dev_dbg(prmd->dev, "%s: %s: new state pwrstctrl: %08x\n", > > + __func__, prmd->pd.name, readl_relaxed(prmd->pwrstctrl)); > > Should we wait for the transition to complete here? Good idea :) > > + v &= ~PRM_POWERSTATE_MASK; > > + v |= omap_prm_domain_find_lowest(prmd); > > + > > + if (prmd->cap->statechange) > > + v |= PRM_LOWPOWERSTATECHANGE; > > + if (prmd->cap->logicretstate) > > + v &= ~PRM_LOGICRETSTATE; > > + else > > + v |= PRM_LOGICRETSTATE; > > + > > + writel_relaxed(v, prmd->pwrstctrl); > > Should we wait for the transition to complete here? Would be nice yeah. > Is any of the following clock handling needed, and if yes, whats its > purpose? > > It looks like this is only used for ABE clkctrl handling on omap4/omap5 (at > least for now), but afaik, ABE clkctrl is read only so this code would > effectively do nothing (and potentially just even fail.) Yeah this seems unnecessary, let's plan on leaving it out. I think the clocks in the l4_abe dst changes are actually handled by simple-pm-bus, not this driver, I was just confused :) Regards, Tony _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel