Received: by 10.192.165.156 with SMTP id m28csp2030991imm; Thu, 12 Apr 2018 07:32:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Jd8flupwlZV0Hl1MZmN1PasaakXhu3aD/vK0U7axRkIO0mm0OPemlIwKSCy4/V3F5aPF8 X-Received: by 10.99.170.70 with SMTP id x6mr925303pgo.114.1523543522043; Thu, 12 Apr 2018 07:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523543522; cv=none; d=google.com; s=arc-20160816; b=cNiLFz8XPAV8X687F5n/nYF5M6TOYzycksnc8LiJNf3nIV3msIsGXDEmQCj+MN83EG 4xsCwkecv00GXIyvyhSjYzux/fv3qyPJ8ScN1FTgYboD68W9tmd0/nYAy1qdo2rnwRIH juzyxeup8VKXXASfLbYsJsqX6xPI+9B7PjehO9IsbxVaigcXlpUU8LJDoEqqOvQigrGM 31iFcscI+TfdVl2rBPzot9l7KMl+92h0Ggk73kQOcLymP1yNJA40EtNl0kZVs4bbWNgl MdPWEojbqpYTBoyi1fYi4L6ZJAhSzf8fYJWBt6S0MEnHmxR/4tw480QTjrGZSTbaDpKV KR3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=uWWcNCW7oMcDLzCkOw/bzKy5t4YbsTfovXsc3ZtfX9Y=; b=OfMHrC81c7PwgeFmR2mapHCdPlirjtOYu6oVPAeojH0DFYIY+RCctPlza7hTJIl82O WdF0ftQBYaWZPIGAK5yw5ciCoSMuvR0XjCzJuvFVwIzH7i4+aQPzkzFnXBGBm4XUwWEa sKFnRLdU0wu25hCoUqM9yoXkc6DdrhUrKR3qkh8LKVBCSeRXi0OS39TXSdesmcQ06C21 1JPnaMIyHnzCQz4bW+3PtsgJdwkheabUjS0M7paDMPVN3Hljhy71m2VrOeVuc1oCMI4z ckhrBY5hIBKoO6P9qnyFHCJx79NDtJlAbWSHFlkHcm3026yH8gif1vp33A1QuFDxMifi hfvA== 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 n4si2615934pfn.352.2018.04.12.07.31.25; Thu, 12 Apr 2018 07:32:02 -0700 (PDT) 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 S1753071AbeDLO1T (ORCPT + 99 others); Thu, 12 Apr 2018 10:27:19 -0400 Received: from muru.com ([72.249.23.125]:36426 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752826AbeDLO1S (ORCPT ); Thu, 12 Apr 2018 10:27:18 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 369CF8081; Thu, 12 Apr 2018 14:28:50 +0000 (UTC) Date: Thu, 12 Apr 2018 07:27:14 -0700 From: Tony Lindgren To: Keerthy Cc: linus.walleij@linaro.org, grygorii.strashko@ti.com, t-kristo@ti.com, Russ.Dill@ti.com, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, ssantosh@kernel.org, haojian.zhuang@linaro.org, linux-arm-kernel@lists.infradead.org, d-gerlach@ti.com Subject: Re: [PATCH 12/14] OMAP: CLK: CLKSRC: Add suspend resume hooks Message-ID: <20180412142714.GX5700@atomide.com> References: <1523505239-16229-1-git-send-email-j-keerthy@ti.com> <1523505239-16229-13-git-send-email-j-keerthy@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1523505239-16229-13-git-send-email-j-keerthy@ti.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Keerthy [180412 03:56]: > Add the save and restore for clksrc as part of suspend and resume > so that it saves the counter value and restores. This is needed in > modes like rtc+ddr in self-refresh not doing this stalls the time. I suspect this too should really happen with cpu_pm. > --- a/arch/arm/mach-omap2/timer.c > +++ b/arch/arm/mach-omap2/timer.c > @@ -442,6 +442,38 @@ static int __init __maybe_unused omap2_sync32k_clocksource_init(void) > return ret; > } > > +static unsigned int omap2_gptimer_clksrc_load; > + > +static void omap2_gptimer_clksrc_suspend(struct clocksource *unused) > +{ > + struct omap_hwmod *oh; > + > + omap2_gptimer_clksrc_load = > + __omap_dm_timer_read_counter(&clksrc, OMAP_TIMER_NONPOSTED); > + > + oh = omap_hwmod_lookup(clocksource_gpt.name); > + if (!oh) > + return; > + > + omap_hwmod_idle(oh); > +} Probably no need to look up the hwmod every time? Especially if am437x will start supporting deeper idle modes during runtime. And probably the cpu_pm notifies should be directly in the hwmod code so we don't need to add more any more dependencies to hwmod functions to timer code. We should have this code move to drivers anyways at some point. Regards, Tony