mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
Revert "Revert "seqlock: lockdep assert non-preemptibility on seqcount_t write""
This reverts commit 5e9203d837.
It should now be fixed up properly in Linus's tree, so revert this
revert to clear up any merge issues with the "real" fix that is
happening upstream.
Link: https://lore.kernel.org/r/87v9hqxolz.fsf@nanos
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I57c6a5777befa560af8e89ff708a1be4eb46cb33
This commit is contained in:
@@ -266,6 +266,12 @@ static inline void raw_write_seqcount_end(seqcount_t *s)
|
||||
kcsan_nestable_atomic_end();
|
||||
}
|
||||
|
||||
static inline void __write_seqcount_begin_nested(seqcount_t *s, int subclass)
|
||||
{
|
||||
raw_write_seqcount_begin(s);
|
||||
seqcount_acquire(&s->dep_map, subclass, 0, _RET_IP_);
|
||||
}
|
||||
|
||||
/**
|
||||
* write_seqcount_begin_nested() - start a seqcount_t write section with
|
||||
* custom lockdep nesting level
|
||||
@@ -276,8 +282,19 @@ static inline void raw_write_seqcount_end(seqcount_t *s)
|
||||
*/
|
||||
static inline void write_seqcount_begin_nested(seqcount_t *s, int subclass)
|
||||
{
|
||||
raw_write_seqcount_begin(s);
|
||||
seqcount_acquire(&s->dep_map, subclass, 0, _RET_IP_);
|
||||
lockdep_assert_preemption_disabled();
|
||||
__write_seqcount_begin_nested(s, subclass);
|
||||
}
|
||||
|
||||
/*
|
||||
* A write_seqcount_begin() variant w/o lockdep non-preemptibility checks.
|
||||
*
|
||||
* Use for internal seqlock.h code where it's known that preemption is
|
||||
* already disabled. For example, seqlock_t write side functions.
|
||||
*/
|
||||
static inline void __write_seqcount_begin(seqcount_t *s)
|
||||
{
|
||||
__write_seqcount_begin_nested(s, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -575,7 +592,7 @@ static inline unsigned read_seqretry(const seqlock_t *sl, unsigned start)
|
||||
static inline void write_seqlock(seqlock_t *sl)
|
||||
{
|
||||
spin_lock(&sl->lock);
|
||||
write_seqcount_begin(&sl->seqcount);
|
||||
__write_seqcount_begin(&sl->seqcount);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -601,7 +618,7 @@ static inline void write_sequnlock(seqlock_t *sl)
|
||||
static inline void write_seqlock_bh(seqlock_t *sl)
|
||||
{
|
||||
spin_lock_bh(&sl->lock);
|
||||
write_seqcount_begin(&sl->seqcount);
|
||||
__write_seqcount_begin(&sl->seqcount);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -628,7 +645,7 @@ static inline void write_sequnlock_bh(seqlock_t *sl)
|
||||
static inline void write_seqlock_irq(seqlock_t *sl)
|
||||
{
|
||||
spin_lock_irq(&sl->lock);
|
||||
write_seqcount_begin(&sl->seqcount);
|
||||
__write_seqcount_begin(&sl->seqcount);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -649,7 +666,7 @@ static inline unsigned long __write_seqlock_irqsave(seqlock_t *sl)
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&sl->lock, flags);
|
||||
write_seqcount_begin(&sl->seqcount);
|
||||
__write_seqcount_begin(&sl->seqcount);
|
||||
return flags;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user