diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2014-09-14 17:34:38 +0400 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2014-09-14 17:35:36 +0400 |
| commit | db985cbd67c45f875ef43cb5febfaa8cbd203c27 (patch) | |
| tree | 63542d05b1c0f730ec1ad5f915dc4eb3c015e616 /include/linux/seqlock.h | |
| parent | c6f1224573c3b609bd8073b39f496637a16cc06f (diff) | |
| parent | 468a903c0e5147e3f93187f0b808a3ef957fd00e (diff) | |
| download | linux-db985cbd67c45f875ef43cb5febfaa8cbd203c27.tar.xz | |
Merge tag 'irqchip-core-3.18' of git://git.infradead.org/users/jcooper/linux into irq/core
irqchip core changes for v3.18
- renesas: suspend to RAM, runtime PM, cleanups and DT binding docs
- keystone: add new driver
- hip04: add Hisilicon HiP04 driver (without touching irq-gic.c)
- gic: Use defines instead of magic number, preserve v2 bybass bits
- handle_domain_irq: common low level interrupt entry handler
Diffstat (limited to 'include/linux/seqlock.h')
| -rw-r--r-- | include/linux/seqlock.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 535f158977b9..cc359636cfa3 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h @@ -117,6 +117,22 @@ repeat: } /** + * 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 * Returns: count to be passed to read_seqcount_retry @@ -164,8 +180,6 @@ static inline unsigned read_seqcount_begin(const seqcount_t *s) static inline unsigned raw_seqcount_begin(const seqcount_t *s) { unsigned ret = ACCESS_ONCE(s->sequence); - - seqcount_lockdep_reader_access(s); smp_rmb(); return ret & ~1; } @@ -220,6 +234,17 @@ static inline void raw_write_seqcount_end(seqcount_t *s) } /* + * raw_write_seqcount_latch - redirect readers to even/odd copy + * @s: pointer to seqcount_t + */ +static inline void raw_write_seqcount_latch(seqcount_t *s) +{ + smp_wmb(); /* prior stores before incrementing "sequence" */ + s->sequence++; + smp_wmb(); /* increment "sequence" before following stores */ +} + +/* * Sequence counter only version assumes that callers are using their * own mutexing. */ |
