linux-stable/arch/mips
Huacai Chen db0dbd57d5 MIPS: sync-r4k: reduce skew while synchronization
While synchronization, count register will go backwards for the master.
If synchronise_count_master() runs before synchronise_count_slave(),
skew becomes even more. The skew is very harmful for CPU hotplug (CPU0
do synchronization with CPU1, then CPU0 do synchronization with CPU2
and CPU0's count goes backwards, so it will be out of sync with CPU1).

After the commit cf9bfe55f2 (MIPS: Synchronize MIPS count one
CPU at a time), we needn't evaluate count_reference at the beginning of
synchronise_count_master() any more. Thus, we evaluate the initcount (It
seems like count_reference is redundant) in the 2nd loop. Since we write
the count register in the last loop, we don't need additional barriers
(the existing memory barriers are enough).

Moreover, I think we loop 3 times is enough to get a primed instruction
cache, this can also get less skew than looping 5 times.

Comments are also updated in this patch.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Patchwork: https://patchwork.linux-mips.org/patch/12163/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2016-01-24 01:31:51 +01:00
..
alchemy genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
ar7 Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-09-03 16:55:55 -07:00
ath25 genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
ath79 MIPS: ath79: Remove some unused code from setup.c 2016-01-04 09:42:26 +01:00
bcm47xx MIPS: BCM47xx: Support SPROM prefixes on other platforms 2016-01-20 00:39:20 +01:00
bcm63xx Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-11-15 09:10:53 -08:00
bmips MIPS: bmips: Support SMP on BCM63168 2016-01-04 09:42:26 +01:00
boot MIPS: dts: jz4780/ci20: Add NEMC, BCH and NAND device tree nodes 2016-01-04 09:42:26 +01:00
cavium-octeon Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-11-15 09:10:53 -08:00
cobalt MIPS: Cobalt Don't use module_init in non-modular MTD registration. 2015-06-21 22:14:30 +02:00
configs Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-11-15 09:10:53 -08:00
dec MIPS: DEC: Do not set up the FPU interrupt if no FPU 2015-04-08 01:10:46 +02:00
emma
fw
include MIPS: Cleanup the unused __arch_local_irq_restore() function 2016-01-22 01:58:49 +01:00
jazz MIPS: Jazz: Migrate to new 'set-state' interface 2015-09-03 12:07:50 +02:00
jz4740 MIPS: JZ4740: Remove unused linux/leds_pwm.h include 2015-10-26 09:49:44 +01:00
kernel MIPS: sync-r4k: reduce skew while synchronization 2016-01-24 01:31:51 +01:00
kvm MIPS: KVM: Uninit VCPU in vcpu_create error path 2015-11-18 12:25:36 +01:00
lantiq MIPS: Make MIPS_CMDLINE_DTB default 2015-11-11 08:38:37 +01:00
lasat MIPS: Lasat: Move from deprecated __initcall to arch_initcall. 2015-09-03 12:07:49 +02:00
lib MIPS: Cleanup the unused __arch_local_irq_restore() function 2016-01-22 01:58:49 +01:00
loongson32 MIPS: loongsoon32: Migrate to new 'set-state' interface 2015-09-03 12:07:53 +02:00
loongson64 MIPS: hpet: Choose a safe value for the ETIME check 2016-01-22 02:00:49 +01:00
math-emu MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00
mm MIPS: fix DMA contiguous allocation 2015-12-12 10:15:34 -08:00
mti-malta MIPS: Malta: Register UP SMP ops if all else fails 2015-11-11 08:35:49 +01:00
mti-sead3 LED/MIPS: Move SEAD3 LED driver to where it belongs. 2015-11-03 08:59:20 +01:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-10-20 06:08:27 -07:00
netlogic MIPS: Make MIPS_CMDLINE_DTB default 2015-11-11 08:38:37 +01:00
oprofile MIPS: Add cases for CPU_I6400 2015-08-26 15:23:03 +02:00
paravirt MIPS: SMP: Don't increment irq_count multiple times for call function IPIs 2015-08-03 09:25:12 +02:00
pci MIPS: pci: Add MT7620a PCIE driver 2016-01-20 00:39:20 +01:00
pistachio Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-11-15 09:10:53 -08:00
pmcs-msp71xx MIPS: Fix build error due to unused variables. 2015-12-22 15:21:18 +01:00
pnx833x
power MIPS: Hibernate: flush TLB entries earlier 2015-04-10 15:41:52 +02:00
ralink MIPS: pci: Add MT7620a PCIE driver 2016-01-20 00:39:20 +01:00
rb532 MIPS: Remove all the uses of custom gpio.h 2015-09-03 12:08:02 +02:00
sgi-ip22 MIPS: ip22-gio: Remove legacy suspend/resume support 2015-02-20 13:30:55 +01:00
sgi-ip27 MIPS: IP27: Migrate to new 'set-state' interface 2015-09-03 12:07:54 +02:00
sgi-ip32 MIPS: IP32: Fix build errors in reset code in DS1685 platform hook. 2015-05-13 00:01:41 +02:00
sibyte MIPS: Sibyte: Move bus watcher from deprecated __initcall to device_initcall 2015-09-03 12:07:49 +02:00
sni MIPS: Fix build error due to unused variables. 2015-12-22 15:21:18 +01:00
txx9 spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
vdso MIPS: VDSO: Fix build error with binutils 2.24 and earlier 2015-12-29 23:41:55 +01:00
vr41xx MIPS/IRQCHIP: Move irq_chip from arch/mips to drivers/irqchip. 2015-06-21 21:52:50 +02:00
xilfpga Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-11-15 09:10:53 -08:00
Kbuild MIPS: Initial implementation of a VDSO 2015-11-11 08:36:36 +01:00
Kbuild.platforms MIPS: xilfpga: Add mipsfpga platform code 2015-11-11 08:38:44 +01:00
Kconfig MIPS: vmlinux: create a section for appended DTB 2015-11-12 11:35:48 +01:00
Kconfig.debug MIPS: CPS: Early debug using an ns16550-compatible UART 2015-11-11 08:34:25 +01:00
Makefile MIPS: Loongson-3: Improve -march option and move it to Platform 2016-01-22 01:59:18 +01:00