From patchwork Fri May 18 08:40:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J, KEERTHY" X-Patchwork-Id: 10408785 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7506060230 for ; Fri, 18 May 2018 08:43:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64F85288B9 for ; Fri, 18 May 2018 08:43:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59374288BA; Fri, 18 May 2018 08:43:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 80280288BD for ; Fri, 18 May 2018 08:43:44 +0000 (UTC) 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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=c/z4zB51Mj9W6i/LRp0eq6cSAoW7LCuRUp4fND+8+xk=; b=RL1g3htiGokuo8 alpVG3bUKFVK5KeoKmlYSk6jaEbBO4mSWZ6r07DpwUAircb4UD5cFn5p4fDGbXUiMKTtp+5PRE1U+ jo7ZMMrJktTBGVMLyru7lFKektW6NZsBuNW8HwTj8itcvYRADz/Am5ydeO4e3zh0DW1g4J0kxxmgo CJXaniWnicm31m2ekStZz0on3PRCVS2oWrLLQ3ALtxF/y9jq2gbFSffc65AV+uVxFFC1cR8jzAVLx 6y73eLY6+2K8rrd582svcp99bq+5EBy2R7e/+G61MxL4w1O1AOj/SPnN/e6AU+YQQeVe8J19vxvdW gD+fLhuvLQNpGiDjHbHQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJaz9-0004NO-NC; Fri, 18 May 2018 08:43:35 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJayh-0004CK-Fj for linux-arm-kernel@bombadil.infradead.org; Fri, 18 May 2018 08:43:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=s2ui6mSN7wmffWbtE0O+wpYSdXMnz/GjS08saSag3ic=; b=JD0oBGbMKRKhgJ2MHv0f6SJX2 DTskYoEktOpC5KcHxww+MU1IuJKyZ1mNQZaGgCycE632KSXuVISfirhkcs/TuJuPeG2bkyz+T3YtC R6TMzEl7/3EC9x3KmyY9YFqKeSIvm496rnXOSiHtNwV6nu5vzYBpft4OQ6iP/bIInaI1+0te52Nid 7TpodeeQ3TbTeqWWdjDOhg96suqDGjMDIBSuwe4/5fWpJurF6h7+QghE3gfNSJYBc0YeLvZsuh6Vt ffr634ZBwnBbKHs74Q9/QEOO0M30stROgW6O2RZnEPLVqd4Wc0pZbEvA1drnv8DUUSCT3LB2zfclN NXWlcXJLw==; Received: from lelnx193.ext.ti.com ([198.47.27.77]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJawa-00019h-OS for linux-arm-kernel@lists.infradead.org; Fri, 18 May 2018 08:40:58 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w4I8edMp013218; Fri, 18 May 2018 03:40:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1526632839; bh=s2ui6mSN7wmffWbtE0O+wpYSdXMnz/GjS08saSag3ic=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=En+GhrU17z6k+g7XwKpfxrJ9aP4MGFcgVzka2ccRocNUwteKj77zX6CZuWi/Di96r hPosHYOY1Z549oNTMD3w6Oqgx4v8NC/LnXcH6JMwxYW4VyV8Hzqa3gfu2VR+YUSmAR ML9krqlkdQqQe/X5GNOU/wLWVoYB+Y6+wdZxBqBk= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w4I8ed2s000849; Fri, 18 May 2018 03:40:39 -0500 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 18 May 2018 03:40:39 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 18 May 2018 03:40:39 -0500 Received: from ula0393675.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w4I8eYv6013143; Fri, 18 May 2018 03:40:37 -0500 From: Keerthy To: Subject: [PATCH 2/2] ARM: mach-omap2: prm44xx: Inroduce cpu_pm notifiers for context save/restore Date: Fri, 18 May 2018 14:10:22 +0530 Message-ID: <1526632822-26049-2-git-send-email-j-keerthy@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1526632822-26049-1-git-send-email-j-keerthy@ti.com> References: <1526632822-26049-1-git-send-email-j-keerthy@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180518_044056_914646_52AB0953 X-CRM114-Status: GOOD ( 13.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: t-kristo@ti.com, j-keerthy@ti.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Inroduce cpu_pm notifiers for context save/restore. This will be needed for am43xx family in case of rtc only mode with ddr in self-refresh. Signed-off-by: Keerthy --- arch/arm/mach-omap2/prm44xx.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index 0a4aa90..5478c71 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c @@ -12,6 +12,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include @@ -30,6 +31,7 @@ #include "prcm44xx.h" #include "prminst44xx.h" #include "powerdomain.h" +#include "pm.h" /* Static data */ @@ -718,6 +720,22 @@ void prm_restore_context(void) omap4_prcm_irq_setup.pm_ctrl); } +static int cpu_notifier(struct notifier_block *nb, unsigned long cmd, void *v) +{ + switch (cmd) { + case CPU_CLUSTER_PM_ENTER: + if (enable_off_mode) + prm_save_context(); + break; + case CPU_CLUSTER_PM_EXIT: + if (enable_off_mode) + prm_restore_context(); + break; + } + + return NOTIFY_OK; +} + /* * XXX document */ @@ -738,6 +756,7 @@ void prm_restore_context(void) int __init omap44xx_prm_init(const struct omap_prcm_init_data *data) { + static struct notifier_block nb; omap_prm_base_init(); prm_init_data = data; @@ -759,6 +778,12 @@ int __init omap44xx_prm_init(const struct omap_prcm_init_data *data) omap4_prcm_irq_setup.mask = AM43XX_PRM_IRQENABLE_MPU_OFFSET; } + /* Only AM43XX can lose prm context during rtc-ddr suspend */ + if (soc_is_am43xx()) { + nb.notifier_call = cpu_notifier; + cpu_pm_register_notifier(&nb); + } + return prm_register(&omap44xx_prm_ll_data); }