WSL2-Linux-Kernel/arch
Paul Mackerras 43875cc0a5 [POWERPC] Fix off-by-one error in setting decrementer on Book E/4xx (v2)
The decrementer in Book E and 4xx processors interrupts on the
transition from 1 to 0, rather than on the 0 to -1 transition as on
64-bit server and 32-bit "classic" (6xx/7xx/7xxx) processors.  At the
moment we subtract 1 from the count of how many decrementer ticks are
required before the next interrupt before putting it into the
decrementer, which is correct for server/classic processors, but could
possibly cause the interrupt to happen too early on Book E and 4xx if
the timebase/decrementer frequency is low.

This fixes the problem by making set_dec subtract 1 from the count for
server and classic processors, instead of having the callers subtract
1.  Since set_dec already had a bunch of ifdefs to handle different
processor types, there is no net increase in ugliness. :)

Note that calling set_dec(0) may not generate an interrupt on some
processors.  To make sure that decrementer_set_next_event always calls
set_dec with an interval of at least 1 tick, we set min_delta_ns of
the decrementer_clockevent to correspond to 2 ticks (2 rather than 1
to compensate for truncations in the conversions between ticks and
ns).

This also removes a redundant call to set the decrementer to
0x7fffffff - it was already set to that earlier in timer_interrupt.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-11-08 14:15:31 +11:00
..
alpha alpha: sg_virt() fallout 2007-10-23 12:31:05 +02:00
arm [ARM] 4636/1: pxa: add default configuration for zylonite 2007-10-31 15:21:48 +00:00
avr32 [AVR32] ARRAY_SIZE() cleanup 2007-10-23 11:20:26 +02:00
blackfin Blackfin arch: reclaim a few bytes from the end of our init section 2007-10-30 12:00:02 +08:00
cris typo fixes 2007-10-20 01:34:40 +02:00
frv scatterlist fallout: frv 2007-10-27 22:18:11 -07:00
h8300 Kbuild/doc: fix links to Documentation files 2007-10-30 14:26:30 -07:00
ia64 [IA64] Fix incorrect return value from ia64_setup_msi_irq() 2007-10-30 09:54:47 -07:00
m32r spelling fixes: arch/m32r/ 2007-10-20 01:14:39 +02:00
m68k m68k: sg fallout 2007-10-24 08:55:40 +02:00
m68knommu m68knommu: mark mem init functions as __init 2007-10-23 20:45:44 -07:00
mips [MIPS] tb0219: Update copyright message. 2007-10-29 19:35:37 +00:00
parisc parisc: fix sg_page() fallout 2007-10-23 09:49:31 +02:00
powerpc [POWERPC] Fix off-by-one error in setting decrementer on Book E/4xx (v2) 2007-11-08 14:15:31 +11:00
ppc [POWERPC] i8259: Add disable method 2007-11-08 14:15:29 +11:00
s390 Kbuild/doc: fix links to Documentation files 2007-10-30 14:26:30 -07:00
sh Combine instrumentation menus in kernel/Kconfig.instrumentation 2007-10-19 11:53:54 -07:00
sh64 Kbuild/doc: fix links to Documentation files 2007-10-30 14:26:30 -07:00
sparc [SPARC32]: Fix build-warning in io-unit.c 2007-10-27 00:54:14 -07:00
sparc64 [SPARC64]: Update defconfig. 2007-11-01 03:18:02 -07:00
um misc uml annotation and section fixes 2007-10-29 07:41:32 -07:00
v850 spelling fixes: arch/v850/ 2007-10-20 01:24:05 +02:00
x86 Remove bogus default y for DMAR and NET_DMA 2007-10-30 08:06:55 -07:00
xtensa Kbuild/doc: fix links to Documentation files 2007-10-30 14:26:30 -07:00