linux_dsm_epyc7002/arch/arc
Vineet Gupta 36425cd670 ARC: udelay: fix inline assembler by adding LP_COUNT to clobber list
commit 3c7c7a2fc8 ("ARC: Don't use "+l" inline asm constraint")
modified the inline assembly to setup LP_COUNT register manually and NOT
rely on gcc to do it (with the +l inline assembler contraint hint, now
being retired in the compiler)

However the fix was flawed as we didn't add LP_COUNT to asm clobber list,
meaning gcc doesn't know that LP_COUNT or zero-delay-loops are in action
in the inline asm.

This resulted in some fun - as nested ZOL loops were being generared

| mov lp_count,250000 ;16 # tmp235,
| lp .L__GCC__LP14 #		<======= OUTER LOOP (gcc generated)
|   .L14:
|   ld r2, [r5] # MEM[(volatile u32 *)prephitmp_43], w
|   dmb 1
|   breq r2, -1, @.L21 #, w,,
|   bbit0 r2,1,@.L13 # w,,
|   ld r4,[r7] ;25 # loops_per_jiffy, loops_per_jiffy
|   mpymu r3,r4,r6 #, loops_per_jiffy, tmp234
|
|   mov lp_count, r3 #		 <====== INNER LOOP (from inline asm)
|   lp 1f
| 	 nop
|   1:
|   nop_s
| .L__GCC__LP14: ; loop end, start is @.L14 #,

This caused issues with drivers relying on sane behaviour of udelay
friends.

With LP_COUNT added to clobber list, gcc doesn't generate the outer
loop in say above case.

Addresses STAR 9001146134

Reported-by: Joao Pinto <jpinto@synopsys.com>
Fixes: 3c7c7a2fc8 ("ARC: Don't use "+l" inline asm constraint")
Cc: stable@vger.kernel.org
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2017-01-24 10:54:24 -08:00
..
boot ARC updates for 4.10-rc1 (part 1) 2016-12-15 14:15:17 -08:00
configs ARC: axs10x: really enable ARC PGU 2016-11-30 11:54:25 -08:00
include ARC: udelay: fix inline assembler by adding LP_COUNT to clobber list 2017-01-24 10:54:24 -08:00
kernel ARCv2: MCIP: Deprecate setting of affinity in Device Tree 2017-01-24 10:22:48 -08:00
lib ARC: dw2 unwind: enable cfi pseudo ops in string lib 2016-09-30 14:48:22 -07:00
mm ARC: Revert "ARC: mm: IOC: Don't enable IOC by default" 2017-01-18 19:21:06 -08:00
oprofile ARC: OProfile support 2013-02-15 23:16:00 +05:30
plat-axs10x ARC: move mcip.h into include/soc and adjust the includes 2016-11-30 11:54:25 -08:00
plat-eznps soc: Support for NPS HW scheduling 2016-11-30 11:54:25 -08:00
plat-sim ARCv2: Add support for ZeBu Emulation platform for HS cores 2016-09-30 14:48:15 -07:00
plat-tb10x arc: select GPIOLIB directly 2016-04-26 14:07:59 +02:00
Kbuild ARC: Build system: Makefiles, Kconfig, Linker script 2013-02-11 20:00:25 +05:30
Kconfig ARC: module: Fix !CONFIG_ARC_DW2_UNWIND builds 2017-01-18 11:17:44 -08:00
Kconfig.debug ARC: With earlycon in use, retire EARLY_PRINTK 2015-05-11 11:20:21 +05:30
Makefile ARC fixes for 4.9-rc5 2016-11-11 16:51:50 -08:00