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=-3.7 required=3.0 tests=BAYES_00, 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 09AE8C433DF for ; Wed, 19 Aug 2020 12:53:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9910206DA for ; Wed, 19 Aug 2020 12:53:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727944AbgHSMxx (ORCPT ); Wed, 19 Aug 2020 08:53:53 -0400 Received: from muru.com ([72.249.23.125]:41134 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728124AbgHSMxw (ORCPT ); Wed, 19 Aug 2020 08:53:52 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 6B952807A; Wed, 19 Aug 2020 12:53:49 +0000 (UTC) Date: Wed, 19 Aug 2020 15:54:17 +0300 From: Tony Lindgren To: Adam Ford Cc: Linux-OMAP , Adam Ford-BE , Russell King , Eduardo Valentin , Keerthy , Zhang Rui , Daniel Lezcano , Amit Kucheria , arm-soc , Linux Kernel Mailing List , linux-pm@vger.kernel.org Subject: Re: [PATCH 1/2] thermal: ti-soc-thermal: Enable addition power management Message-ID: <20200819125417.GG2994@atomide.com> References: <20200818154633.5421-1-aford173@gmail.com> <20200819045914.GS2994@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 * Adam Ford [200819 12:21]: > On Tue, Aug 18, 2020 at 11:58 PM Tony Lindgren wrote: > > > > * Adam Ford [200818 15:46]: > > > @@ -1153,6 +1166,38 @@ static int ti_bandgap_suspend(struct device *dev) > > > return err; > > > } > > > > > > +static int bandgap_omap_cpu_notifier(struct notifier_block *nb, > > > + unsigned long cmd, void *v) > > > +{ > > > + struct ti_bandgap *bgp; > > > + > > > + bgp = container_of(nb, struct ti_bandgap, nb); > > > + > > > + spin_lock(&bgp->lock); > > > + switch (cmd) { > > > + case CPU_CLUSTER_PM_ENTER: > > > + if (bgp->is_suspended) > > > + break; > > > + ti_bandgap_save_ctxt(bgp); > > > + ti_bandgap_power(bgp, false); > > > + if (TI_BANDGAP_HAS(bgp, CLK_CTRL)) > > > + clk_disable(bgp->fclock); > > > + break; > > > + case CPU_CLUSTER_PM_ENTER_FAILED: > > > + case CPU_CLUSTER_PM_EXIT: > > > + if (bgp->is_suspended) > > > + break; > > > + if (TI_BANDGAP_HAS(bgp, CLK_CTRL)) > > > + clk_enable(bgp->fclock); > > > + ti_bandgap_power(bgp, true); > > > + ti_bandgap_restore_ctxt(bgp); > > > + break; > > > + } > > > + spin_unlock(&bgp->lock); > > > + > > > + return NOTIFY_OK; > > > +} > > > > Hmm to me it looks like is_suspended is not used right now? > > I guess you want to set it in ti_bandgap_suspend() and clear > > it in ti_bandgap_resume()? > > > > Otherwise looks good to me, I can't test the power consumption > > right now though so you may want to check it to make sure > > device still hits off mode during idle. > > I have a V2. Do you want me to re-post 2/2 with V2 as no change, or > should I just submit this patch alone? Up to you, might make it easier for other folks to follow if the whole series is reposted. 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=-3.8 required=3.0 tests=BAYES_00,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 D79EDC433DF for ; Wed, 19 Aug 2020 12:55:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 A7710221E2 for ; Wed, 19 Aug 2020 12:55:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FS3uG+nL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7710221E2 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+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=merlin.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=e3+5lHETNOnvW2YhP+wPF5jGf+gCEsejbs0Vx44IiHc=; b=FS3uG+nL1INCo/YKMjAhLZeBt 5A9K42cpvjyKdRn93cdF1pR0uM/Hk/weax4ju80aayzjQQZqdKMTaEbntxtO1x/VIa+cYBzcfzskf xbcUcBak+H7sByD+im5N65Bwc16oDLdjU082f8y6nLgZvqUeDEF0aZpkZNxoDMf1qSUrqYe8o75nn KaDOTWxjd3oooo6VGjp5Ji2pr7nA66B3B6E2EaCaPyz9P1WJh5+SaH6OmmbjPyWANrSODiRfq1suu HWPjjrR3pm333WPiXsXrrNdLyt+Bks7iiJ24uKEY+gvz/uruW27YnKf6Z+tB2RU6iP99ErXX2RFcY elsWZ6fFg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8NbP-00077z-SL; Wed, 19 Aug 2020 12:54:03 +0000 Received: from muru.com ([72.249.23.125]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8NbF-00073q-Rm for linux-arm-kernel@lists.infradead.org; Wed, 19 Aug 2020 12:53:54 +0000 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 6B952807A; Wed, 19 Aug 2020 12:53:49 +0000 (UTC) Date: Wed, 19 Aug 2020 15:54:17 +0300 From: Tony Lindgren To: Adam Ford Subject: Re: [PATCH 1/2] thermal: ti-soc-thermal: Enable addition power management Message-ID: <20200819125417.GG2994@atomide.com> References: <20200818154633.5421-1-aford173@gmail.com> <20200819045914.GS2994@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-20200819_085354_000169_EDAB8158 X-CRM114-Status: GOOD ( 22.77 ) 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: Amit Kucheria , Linux Kernel Mailing List , linux-pm@vger.kernel.org, Keerthy , Daniel Lezcano , Adam Ford-BE , Russell King , Eduardo Valentin , Zhang Rui , Linux-OMAP , arm-soc Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org * Adam Ford [200819 12:21]: > On Tue, Aug 18, 2020 at 11:58 PM Tony Lindgren wrote: > > > > * Adam Ford [200818 15:46]: > > > @@ -1153,6 +1166,38 @@ static int ti_bandgap_suspend(struct device *dev) > > > return err; > > > } > > > > > > +static int bandgap_omap_cpu_notifier(struct notifier_block *nb, > > > + unsigned long cmd, void *v) > > > +{ > > > + struct ti_bandgap *bgp; > > > + > > > + bgp = container_of(nb, struct ti_bandgap, nb); > > > + > > > + spin_lock(&bgp->lock); > > > + switch (cmd) { > > > + case CPU_CLUSTER_PM_ENTER: > > > + if (bgp->is_suspended) > > > + break; > > > + ti_bandgap_save_ctxt(bgp); > > > + ti_bandgap_power(bgp, false); > > > + if (TI_BANDGAP_HAS(bgp, CLK_CTRL)) > > > + clk_disable(bgp->fclock); > > > + break; > > > + case CPU_CLUSTER_PM_ENTER_FAILED: > > > + case CPU_CLUSTER_PM_EXIT: > > > + if (bgp->is_suspended) > > > + break; > > > + if (TI_BANDGAP_HAS(bgp, CLK_CTRL)) > > > + clk_enable(bgp->fclock); > > > + ti_bandgap_power(bgp, true); > > > + ti_bandgap_restore_ctxt(bgp); > > > + break; > > > + } > > > + spin_unlock(&bgp->lock); > > > + > > > + return NOTIFY_OK; > > > +} > > > > Hmm to me it looks like is_suspended is not used right now? > > I guess you want to set it in ti_bandgap_suspend() and clear > > it in ti_bandgap_resume()? > > > > Otherwise looks good to me, I can't test the power consumption > > right now though so you may want to check it to make sure > > device still hits off mode during idle. > > I have a V2. Do you want me to re-post 2/2 with V2 as no change, or > should I just submit this patch alone? Up to you, might make it easier for other folks to follow if the whole series is reposted. Regards, Tony _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel