Received: by 10.192.165.156 with SMTP id m28csp2041432imm; Thu, 12 Apr 2018 07:41:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+JIZ+SXVbD/CY03TRGB3tNcucK/LMWln1XCgVL1F2wdUVuYxgHZu7l+nDrj+20Zwwd26GV X-Received: by 10.98.61.206 with SMTP id x75mr7819405pfj.233.1523544106008; Thu, 12 Apr 2018 07:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523544105; cv=none; d=google.com; s=arc-20160816; b=XPwGYEwiDj7wfnk95Wbxt/LLnMbGARyrQFMIC/uQYW8GvBRKoEHmJSemV3zKt/kLVZ E6X5SshbCGB94X1QBRa4Tj86Vhlpxc7L5d55/qWu0CBKLIpz3hgTziVEYQSo9rM/4dzj fg1vLtjbuvVO0M943lcm/spnYK+Mn7VRjK4FzW+xPwjAEtd43PNofAdknxsZQMRnGz+s S9aV7mB/0rynSkm11UCOco9V/KIPp41Zd/RWauPTG3W58K74r66Rpwz7tHQrZr6vbEOD 9cd6Z6dghWy1ASrfpOdakn4Y/K/xJMimU9XXTCJxwDQW3agQ6vPKC2LstKZA33Q0LaZF rcHA== 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=3+pNMuqExvasp7uFhjXoLQ2ita4u1XDB0vA/ZO+ePEs=; b=PTp4xXgPXCHHbggKiLDtuvAHwVIbFo4Vp7eYuOlChU0jsi55YnYV0cRui9UtapKSFv Lw1qjxkz6KPDCeSPiB1l6tZGTmmNX+52KtJP2Hj+irlBYD7oX+5G1dJpLFQj9Qqo8FIq zmJ86dBMOYoJ1wn9NbKTIZSPKxCerWFtJErsMrpn24RCIpRODgWdXaUdUKYtpKXN67Vf 63BD5uWvBTXwKcSCc6qPA+Vz37qh0YA4y7WQMZsUK97m5S/zCRoDI9Sb1zg8SNV34pCE sYN0Z33OtPrLdRN5GjIJg5/I1Re19A12JocAxx8PUUG3usk9U1qt7fJDD0ytFKDK92pR 1Nww== 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 m1-v6si3473383plk.577.2018.04.12.07.41.09; Thu, 12 Apr 2018 07:41:45 -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 S1753172AbeDLOhW (ORCPT + 99 others); Thu, 12 Apr 2018 10:37:22 -0400 Received: from muru.com ([72.249.23.125]:36454 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752721AbeDLOhV (ORCPT ); Thu, 12 Apr 2018 10:37:21 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 296438081; Thu, 12 Apr 2018 14:38:53 +0000 (UTC) Date: Thu, 12 Apr 2018 07:37:17 -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 05/14] ARM: OMAP2: Add functions to save and restore powerdomain context Message-ID: <20180412143717.GZ5700@atomide.com> References: <1523505239-16229-1-git-send-email-j-keerthy@ti.com> <1523505239-16229-6-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-6-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]: > From: Russ Dill > --- a/arch/arm/mach-omap2/powerdomain.c > +++ b/arch/arm/mach-omap2/powerdomain.c > @@ -1199,3 +1199,63 @@ bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm) > > return 0; > } > + > +/** > + * pwrdm_save_context - save powerdomain registers > + * > + * Register state is going to be lost due to a suspend or hibernate > + * event. Save the powerdomain registers. > + */ > +static int pwrdm_save_context(struct powerdomain *pwrdm, void *unused) > +{ > + if (arch_pwrdm && arch_pwrdm->pwrdm_save_context) > + arch_pwrdm->pwrdm_save_context(pwrdm); > + return 0; > +} > + > +/** > + * pwrdm_save_context - restore powerdomain registers > + * > + * Restore powerdomain control registers after a suspend or resume > + * event. > + */ > +static int pwrdm_restore_context(struct powerdomain *pwrdm, void *unused) > +{ > + if (arch_pwrdm && arch_pwrdm->pwrdm_restore_context) > + arch_pwrdm->pwrdm_restore_context(pwrdm); > + return 0; > +} Here too we should use notifiers with the idea being that it allows making powerdomains into a regular device driver eventually. Regards, Tony