Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp598302pxb; Thu, 15 Apr 2021 01:56:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7pWSyCRg/VhoLfhviLq0FmUy6nyYC/y2YeXgD2FPhm+u+42jvFH+QI9t6urc3WQsIPEPr X-Received: by 2002:aa7:c64b:: with SMTP id z11mr2921810edr.8.1618476999334; Thu, 15 Apr 2021 01:56:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618476999; cv=none; d=google.com; s=arc-20160816; b=cVKvypjimt1F6E6bhraFi86NKRpCrJ9JntiG1j6wZl2vM9lOUaoCkHB+idqDgd5py5 3S0iu6ESnCxOIpFDftIZIDSfKfYi25Bf27aNoR4jl2Z10cRWog12pEnnnS++ApnajYws gktf/EB3qzwL824W1JWT/t1Mja0aQd3SIjn3B8HKzDb/75J+mCPmZLoRFDg1bBkyF+Lp NPu0rsUnHJqnMDCKraDZ17QIQtHuFFlnQc5gdT62b34+NVU9XMp96+4gEBkD9oW02hbD Y4n2gmHQ/2Zjqivn6t3z5UZKGwAhL97B8jFzx/cXEuCL1Co1oRVfwKhxwKCxmN2bQafv 3UCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=BsF5FRR4nyzmJIpYoCNYNhH/OlyZ9BCnyAf0Afmt+VQ=; b=rwEnWuASwd0z7axxyF1Z1bZ0I0ypXfAP9/pIrZEvjmvX+o1U9GXkp3MlRm39CzqGOg eIilqe8LwU/yK0sfDLVfGLbQuCShGwoshBeigMj3RpiXR+Ff3M2oWOoskDDqE+qO316x CMRRgAoTCLJlTrGbnSkjNIaC9crIm6tD9wYKZ9rBtPgYpXrmOYVUTwGjq1BMw9VhJg49 YMllHqYQB18xkVVBNW8p5547pbiHaI9T86XdN6NkS1Ozz0/63zKJEQRNyO6LrikiynHC QyfMHH22OGubAQ9LJThMjXGBMZumQTBgHJRb2cxeei5NBC1fRE61JLKjIG31H3svIq+X 34qA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z26si1740542edx.5.2021.04.15.01.56.15; Thu, 15 Apr 2021 01:56:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231682AbhDOIzf (ORCPT + 99 others); Thu, 15 Apr 2021 04:55:35 -0400 Received: from muru.com ([72.249.23.125]:54704 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231326AbhDOIze (ORCPT ); Thu, 15 Apr 2021 04:55:34 -0400 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 7CD6F80CF; Thu, 15 Apr 2021 08:56:27 +0000 (UTC) From: Tony Lindgren To: Daniel Lezcano , Thomas Gleixner Cc: Keerthy , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Aaro Koskinen , Adam Ford , Andreas Kemnade , Lokesh Vutla , Peter Ujfalusi Subject: [PATCH] clocksource/drivers/timer-ti-dm: Save and restore timer TIOCP_CFG Date: Thu, 15 Apr 2021 11:55:06 +0300 Message-Id: <20210415085506.56828-1-tony@atomide.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As we are using cpu_pm to save and restore context, we must also save and restore the timer sysconfig register TIOCP_CFG. This is needed because we are not calling PM runtime functions at all with cpu_pm. Fixes: b34677b0999a ("clocksource/drivers/timer-ti-dm: Implement cpu_pm notifier for context save and restore") Cc: Aaro Koskinen Cc: Adam Ford Cc: Andreas Kemnade Cc: Lokesh Vutla Cc: Peter Ujfalusi Signed-off-by: Tony Lindgren --- drivers/clocksource/timer-ti-dm.c | 6 ++++++ include/clocksource/timer-ti-dm.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c --- a/drivers/clocksource/timer-ti-dm.c +++ b/drivers/clocksource/timer-ti-dm.c @@ -78,6 +78,9 @@ static void omap_dm_timer_write_reg(struct omap_dm_timer *timer, u32 reg, static void omap_timer_restore_context(struct omap_dm_timer *timer) { + __omap_dm_timer_write(timer, OMAP_TIMER_OCP_CFG_OFFSET, + timer->context.ocp_cfg, 0); + omap_dm_timer_write_reg(timer, OMAP_TIMER_WAKEUP_EN_REG, timer->context.twer); omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, @@ -95,6 +98,9 @@ static void omap_timer_restore_context(struct omap_dm_timer *timer) static void omap_timer_save_context(struct omap_dm_timer *timer) { + timer->context.ocp_cfg = + __omap_dm_timer_read(timer, OMAP_TIMER_OCP_CFG_OFFSET, 0); + timer->context.tclr = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); timer->context.twer = diff --git a/include/clocksource/timer-ti-dm.h b/include/clocksource/timer-ti-dm.h --- a/include/clocksource/timer-ti-dm.h +++ b/include/clocksource/timer-ti-dm.h @@ -74,6 +74,7 @@ #define OMAP_TIMER_ERRATA_I103_I767 0x80000000 struct timer_regs { + u32 ocp_cfg; u32 tidr; u32 tier; u32 twer; -- 2.31.1