* ARC: Use __force to suppress per-CPU cmpxchg complaints
@ 2024-10-09 17:55 Paul E. McKenney
2024-10-16 5:33 ` Vineet Gupta
0 siblings, 1 reply; 3+ messages in thread
From: Paul E. McKenney @ 2024-10-09 17:55 UTC (permalink / raw)
To: linux-arch, linux-kernel, linux-snps-arc; +Cc: vgupta
Currently, the cast of the first argument to cmpxchg_emu_u8() drops the
__percpu address-space designator, which results in sparse complaints
when applying cmpxchg() to per-CPU variables in ARC. Therefore, use
__force to suppress these complaints, given that this does not pertain
to cmpxchg() semantics, which are plently well-defined on variables in
general, whether per-CPU or otherwise.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202409251336.ToC0TvWB-lkp@intel.com/
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Vineet Gupta <vgupta@kernel.org>
Cc: <linux-snps-arc@lists.infradead.org>
diff --git a/arch/arc/include/asm/cmpxchg.h b/arch/arc/include/asm/cmpxchg.h
index 58045c8983404..76f43db0890fc 100644
--- a/arch/arc/include/asm/cmpxchg.h
+++ b/arch/arc/include/asm/cmpxchg.h
@@ -48,7 +48,7 @@
\
switch(sizeof((_p_))) { \
case 1: \
- _prev_ = (__typeof__(*(ptr)))cmpxchg_emu_u8((volatile u8 *)_p_, (uintptr_t)_o_, (uintptr_t)_n_); \
+ _prev_ = (__typeof__(*(ptr)))cmpxchg_emu_u8((volatile u8 *__force)_p_, (uintptr_t)_o_, (uintptr_t)_n_); \
break; \
case 4: \
_prev_ = __cmpxchg(_p_, _o_, _n_); \
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: ARC: Use __force to suppress per-CPU cmpxchg complaints
2024-10-09 17:55 ARC: Use __force to suppress per-CPU cmpxchg complaints Paul E. McKenney
@ 2024-10-16 5:33 ` Vineet Gupta
2024-10-16 13:28 ` Paul E. McKenney
0 siblings, 1 reply; 3+ messages in thread
From: Vineet Gupta @ 2024-10-16 5:33 UTC (permalink / raw)
To: paulmck, linux-arch, linux-kernel, linux-snps-arc; +Cc: vgupta
On 10/9/24 10:55, Paul E. McKenney wrote:
> Currently, the cast of the first argument to cmpxchg_emu_u8() drops the
> __percpu address-space designator, which results in sparse complaints
> when applying cmpxchg() to per-CPU variables in ARC. Therefore, use
> __force to suppress these complaints, given that this does not pertain
> to cmpxchg() semantics, which are plently well-defined on variables in
> general, whether per-CPU or otherwise.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202409251336.ToC0TvWB-lkp@intel.com/
> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> Cc: Vineet Gupta <vgupta@kernel.org>
> Cc: <linux-snps-arc@lists.infradead.org>
>
> diff --git a/arch/arc/include/asm/cmpxchg.h b/arch/arc/include/asm/cmpxchg.h
> index 58045c8983404..76f43db0890fc 100644
> --- a/arch/arc/include/asm/cmpxchg.h
> +++ b/arch/arc/include/asm/cmpxchg.h
> @@ -48,7 +48,7 @@
> \
> switch(sizeof((_p_))) { \
> case 1: \
> - _prev_ = (__typeof__(*(ptr)))cmpxchg_emu_u8((volatile u8 *)_p_, (uintptr_t)_o_, (uintptr_t)_n_); \
> + _prev_ = (__typeof__(*(ptr)))cmpxchg_emu_u8((volatile u8 *__force)_p_, (uintptr_t)_o_, (uintptr_t)_n_); \
> break; \
> case 4: \
> _prev_ = __cmpxchg(_p_, _o_, _n_); \
Added to for-curr.
Thx,
-Vineet
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: ARC: Use __force to suppress per-CPU cmpxchg complaints
2024-10-16 5:33 ` Vineet Gupta
@ 2024-10-16 13:28 ` Paul E. McKenney
0 siblings, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2024-10-16 13:28 UTC (permalink / raw)
To: Vineet Gupta; +Cc: linux-arch, linux-kernel, linux-snps-arc
On Tue, Oct 15, 2024 at 10:33:14PM -0700, Vineet Gupta wrote:
> On 10/9/24 10:55, Paul E. McKenney wrote:
> > Currently, the cast of the first argument to cmpxchg_emu_u8() drops the
> > __percpu address-space designator, which results in sparse complaints
> > when applying cmpxchg() to per-CPU variables in ARC. Therefore, use
> > __force to suppress these complaints, given that this does not pertain
> > to cmpxchg() semantics, which are plently well-defined on variables in
> > general, whether per-CPU or otherwise.
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202409251336.ToC0TvWB-lkp@intel.com/
> > Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> > Cc: Vineet Gupta <vgupta@kernel.org>
> > Cc: <linux-snps-arc@lists.infradead.org>
> >
> > diff --git a/arch/arc/include/asm/cmpxchg.h b/arch/arc/include/asm/cmpxchg.h
> > index 58045c8983404..76f43db0890fc 100644
> > --- a/arch/arc/include/asm/cmpxchg.h
> > +++ b/arch/arc/include/asm/cmpxchg.h
> > @@ -48,7 +48,7 @@
> > \
> > switch(sizeof((_p_))) { \
> > case 1: \
> > - _prev_ = (__typeof__(*(ptr)))cmpxchg_emu_u8((volatile u8 *)_p_, (uintptr_t)_o_, (uintptr_t)_n_); \
> > + _prev_ = (__typeof__(*(ptr)))cmpxchg_emu_u8((volatile u8 *__force)_p_, (uintptr_t)_o_, (uintptr_t)_n_); \
> > break; \
> > case 4: \
> > _prev_ = __cmpxchg(_p_, _o_, _n_); \
>
>
> Added to for-curr.
Thank you! As soon as it shows up in -next, I will drop it from my tree.
Thanx, Paul
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-16 13:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-09 17:55 ARC: Use __force to suppress per-CPU cmpxchg complaints Paul E. McKenney
2024-10-16 5:33 ` Vineet Gupta
2024-10-16 13:28 ` Paul E. McKenney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox