From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>,
Alan Cox <alan@linux.intel.com>,
"Li, Aubrey" <aubrey.li@linux.intel.com>,
LKML <linux-kernel@vger.kernel.org>,
Linux PM list <linux-pm@vger.kernel.org>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Kristen Carlson Accardi <kristen@linux.intel.com>,
John Stultz <john.stultz@linaro.org>,
Len Brown <len.brown@intel.com>
Subject: [PATCH 2/6] timekeeping: Pass readout base to update_fast_timekeeper()
Date: Wed, 11 Feb 2015 05:01:52 +0100 [thread overview]
Message-ID: <1973562.AfpZ97hsgV@vostro.rjw.lan> (raw)
In-Reply-To: <8292243.ibkmfVtXac@vostro.rjw.lan>
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Modify update_fast_timekeeper() to take a struct tk_read_base
pointer as its argument (instead of a struct timekeeper pointer)
and update its kerneldoc comment to reflect that.
That will allow a struct tk_read_base that is not part of a
struct timekeeper to be passed to it in the next patch.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
kernel/time/timekeeping.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
Index: linux-pm/kernel/time/timekeeping.c
===================================================================
--- linux-pm.orig/kernel/time/timekeeping.c
+++ linux-pm/kernel/time/timekeeping.c
@@ -230,9 +230,7 @@ static inline s64 timekeeping_get_ns_raw
/**
* update_fast_timekeeper - Update the fast and NMI safe monotonic timekeeper.
- * @tk: The timekeeper from which we take the update
- * @tkf: The fast timekeeper to update
- * @tbase: The time base for the fast timekeeper (mono/raw)
+ * @tkr: Timekeeping readout base from which we take the update
*
* We want to use this from any context including NMI and tracing /
* instrumenting the timekeeping code itself.
@@ -244,11 +242,11 @@ static inline s64 timekeeping_get_ns_raw
* smp_wmb(); <- Ensure that the last base[1] update is visible
* tkf->seq++;
* smp_wmb(); <- Ensure that the seqcount update is visible
- * update(tkf->base[0], tk);
+ * update(tkf->base[0], tkr);
* smp_wmb(); <- Ensure that the base[0] update is visible
* tkf->seq++;
* smp_wmb(); <- Ensure that the seqcount update is visible
- * update(tkf->base[1], tk);
+ * update(tkf->base[1], tkr);
*
* The reader side does:
*
@@ -269,7 +267,7 @@ static inline s64 timekeeping_get_ns_raw
* slightly wrong timestamp (a few nanoseconds). See
* @ktime_get_mono_fast_ns.
*/
-static void update_fast_timekeeper(struct timekeeper *tk)
+static void update_fast_timekeeper(struct tk_read_base *tkr)
{
struct tk_read_base *base = tk_fast_mono.base;
@@ -277,7 +275,7 @@ static void update_fast_timekeeper(struc
raw_write_seqcount_latch(&tk_fast_mono.seq);
/* Update base[0] */
- memcpy(base, &tk->tkr, sizeof(*base));
+ memcpy(base, tkr, sizeof(*base));
/* Force readers back to base[0] */
raw_write_seqcount_latch(&tk_fast_mono.seq);
@@ -462,7 +460,7 @@ static void timekeeping_update(struct ti
memcpy(&shadow_timekeeper, &tk_core.timekeeper,
sizeof(tk_core.timekeeper));
- update_fast_timekeeper(tk);
+ update_fast_timekeeper(&tk->tkr);
}
/**
next prev parent reply other threads:[~2015-02-11 4:01 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-11 4:00 [PATCH 0/6] PM / sleep: Support for quiescing timers during suspend-to-idle Rafael J. Wysocki
2015-02-11 4:01 ` [PATCH 1/6] PM / sleep: Re-implement suspend-to-idle handling Rafael J. Wysocki
2015-02-12 13:14 ` Peter Zijlstra
2015-02-12 16:18 ` Rafael J. Wysocki
2015-02-12 22:33 ` [Update][PATCH 1/6 v2] " Rafael J. Wysocki
2015-02-11 4:01 ` Rafael J. Wysocki [this message]
2015-02-13 0:29 ` [PATCH 2/6] timekeeping: Pass readout base to update_fast_timekeeper() John Stultz
2015-02-11 4:03 ` [PATCH 3/6] timekeeping: Make it safe to use the fast timekeeper while suspended Rafael J. Wysocki
2015-02-13 0:53 ` John Stultz
2015-02-13 2:03 ` Rafael J. Wysocki
2015-02-13 2:59 ` Travis
2015-02-13 9:03 ` John Stultz
2015-02-13 14:32 ` Rafael J. Wysocki
2015-02-14 17:30 ` John Stultz
2015-02-11 4:03 ` [PATCH 4/6] PM / sleep: Make it possible to quiesce timers during suspend-to-idle Rafael J. Wysocki
2015-02-12 13:24 ` Peter Zijlstra
2015-02-12 16:19 ` Rafael J. Wysocki
2015-02-12 22:36 ` [Update][PATCH 4/6 v2] " Rafael J. Wysocki
2015-02-11 4:04 ` [PATCH 5/6] intel_idle: Add ->enter_freeze callbacks Rafael J. Wysocki
2015-02-12 13:26 ` Peter Zijlstra
2015-02-12 16:24 ` Rafael J. Wysocki
2015-02-12 16:25 ` Peter Zijlstra
2015-03-04 23:50 ` Li, Aubrey
2015-03-05 0:18 ` Rafael J. Wysocki
2015-03-05 0:09 ` Li, Aubrey
2015-02-11 4:04 ` [PATCH 6/6] ACPI / idle: Implement ->enter_freeze callback routine Rafael J. Wysocki
2015-02-13 8:13 ` [PATCH 0/6] PM / sleep: Support for quiescing timers during suspend-to-idle Peter Zijlstra
2015-02-13 14:29 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1973562.AfpZ97hsgV@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=alan@linux.intel.com \
--cc=aubrey.li@linux.intel.com \
--cc=john.stultz@linaro.org \
--cc=kristen@linux.intel.com \
--cc=len.brown@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox