From: Thomas Gleixner Date: Wed, 16 Jul 2014 21:05:20 +0000 (+0000) Subject: seqcount: Provide raw_read_seqcount() X-Git-Tag: omap-for-v3.17/fixes-against-rc2~152^2~8 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=0ea5a520f73ca31abc4c10b6d5bc14a884a0641b seqcount: Provide raw_read_seqcount() raw_read_seqcount opens a read critical section of the given seqcount without any lockdep checking and without checking or masking the LSB. Calling code is responsible for handling that. Preparatory patch to provide a NMI safe clock monotonic accessor function. Signed-off-by: Thomas Gleixner Cc: John Stultz Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Mathieu Desnoyers Signed-off-by: John Stultz --- diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 535f158977b9..dcc64b9bfc41 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h @@ -116,6 +116,22 @@ repeat: return ret; } +/** + * raw_read_seqcount - Read the raw seqcount + * @s: pointer to seqcount_t + * Returns: count to be passed to read_seqcount_retry + * + * raw_read_seqcount opens a read critical section of the given + * seqcount without any lockdep checking and without checking or + * masking the LSB. Calling code is responsible for handling that. + */ +static inline unsigned raw_read_seqcount(const seqcount_t *s) +{ + unsigned ret = ACCESS_ONCE(s->sequence); + smp_rmb(); + return ret; +} + /** * raw_read_seqcount_begin - start seq-read critical section w/o lockdep * @s: pointer to seqcount_t