Trying to improve the power efficiency in linux/seqlock.h,
using macros cpu_relaxed_read and cpu_read_relax.
Bug
1440421
Change-Id: I8dcc9dc9c72e5a6848c7823768c76f5d38e9f0d1
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>
Reviewed-on: http://git-master/r/398943
(cherry picked from commit
ed77ee4d50641b1a5668545c946cda681c06fcd2)
Reviewed-on: http://git-master/r/422258
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sri Krishna Chowdary <schowdary@nvidia.com>
Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com>
#include <linux/spinlock.h>
#include <linux/preempt.h>
#include <asm/processor.h>
+#include <asm/relaxed.h>
/*
* Version using sequence counter only.
unsigned ret;
repeat:
- ret = ACCESS_ONCE(s->sequence);
+ ret = cpu_relaxed_read((volatile u32 *)&s->sequence);
if (unlikely(ret & 1)) {
- cpu_relax();
+ cpu_read_relax();
goto repeat;
}
return ret;