projects/linux·commit 174ddfd5

Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

174ddfd5 · Linus Torvalds <[email protected]> · 2017-05-01 16:15:18 -07:00

Pull timer updates from Thomas Gleixner:
 "The timer departement delivers:

   - more year 2038 rework

   - a massive rework of the arm achitected timer

   - preparatory patches to allow NTP correction of clock event devices
     to avoid early expiry

   - the usual pile of fixes and enhancements all over the place"

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (91 commits)
  timer/sysclt: Restrict timer migration sysctl values to 0 and 1
  arm64/arch_timer: Mark errata handlers as __maybe_unused
  Clocksource/mips-gic: Remove redundant non devicetree init
  MIPS/Malta: Probe gic-timer via devicetree
  clocksource: Use GENMASK_ULL in definition of CLOCKSOURCE_MASK
  acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver
  clocksource: arm_arch_timer: add GTDT support for memory-mapped timer
  acpi/arm64: Add memory-mapped timer support in GTDT driver
  clocksource: arm_arch_timer: simplify ACPI support code.
  acpi/arm64: Add GTDT table parse driver
  clocksource: arm_arch_timer: split MMIO timer probing.
  clocksource: arm_arch_timer: add structs to describe MMIO timer
  clocksource: arm_arch_timer: move arch_timer_needs_of_probing into DT init call
  clocksource: arm_arch_timer: refactor arch_timer_needs_probing
  clocksource: arm_arch_timer: split dt-only rate handling
  x86/uv/time: Set ->min_delta_ticks and ->max_delta_ticks
  unicore32/time: Set ->min_delta_ticks and ->max_delta_ticks
  um/time: Set ->min_delta_ticks and ->max_delta_ticks
  tile/time: Set ->min_delta_ticks and ->max_delta_ticks
  score/time: Set ->min_delta_ticks and ->max_delta_ticks
  ...
Commit
174ddfd5dfbfc2d91a45332f809977050ac3fdc5
Parents
3cb66535 · b94bf594

Merge commit. Changes below are compared with the first parent: 3cb66535.

Changes

110 files changed · +2086 −861

FileStatusAddDelContent
Documentation/arm64/silicon-errata.txtmodified+1−0View file
Documentation/devicetree/bindings/timer/cortina,gemini-timer.txtdeleted+0−22View before deletion
Documentation/devicetree/bindings/timer/faraday,fttmr010.txtadded+33−0View file
Documentation/devicetree/bindings/timer/rockchip,rk-timer.txtmodified+9−3View file
MAINTAINERSmodified+1−0View file
arch/alpha/kernel/osf_sys.cmodified+3−1View file
arch/arm/boot/dts/rk3188.dtsimodified+17−0View file
arch/arm/boot/dts/rk322x.dtsimodified+1−1View file
arch/arm64/Kconfigmodified+1−0View file
arch/arm64/include/asm/arch_timer.hmodified+32−11View file
arch/arm64/include/asm/cpucaps.hmodified+2−1View file
arch/arm64/include/asm/cputype.hmodified+2−0View file
arch/arm64/include/asm/esr.hmodified+2−0View file
arch/arm64/kernel/cpu_errata.cmodified+15−0View file
arch/arm64/kernel/cpufeature.cmodified+11−2View file
arch/arm64/kernel/traps.cmodified+14−0View file
arch/blackfin/kernel/time-ts.cmodified+4−0View file
arch/c6x/platforms/timer64.cmodified+2−0View file
arch/hexagon/kernel/time.cmodified+2−0View file
arch/m68k/coldfire/pit.cmodified+2−0View file
arch/mips/alchemy/common/time.cmodified+3−1View file
arch/mips/jz4740/time.cmodified+2−0View file
arch/mips/kernel/cevt-bcm1480.cmodified+2−0View file
arch/mips/kernel/cevt-ds1287.cmodified+2−0View file
arch/mips/kernel/cevt-gt641xx.cmodified+2−0View file
arch/mips/kernel/cevt-sb1250.cmodified+2−0View file
arch/mips/kernel/cevt-txx9.cmodified+2−0View file
arch/mips/loongson32/common/time.cmodified+2−0View file
arch/mips/loongson64/common/cs5536/cs5536_mfgpt.cmodified+2−0View file
arch/mips/loongson64/loongson-3/hpet.cmodified+2−0View file
arch/mips/mti-malta/malta-time.cmodified+30−1View file
arch/mips/ralink/cevt-rt3352.cmodified+2−0View file
arch/mips/sgi-ip27/ip27-timer.cmodified+2−0View file
arch/mn10300/kernel/cevt-mn10300.cmodified+2−0View file
arch/powerpc/kernel/time.cmodified+2−0View file
arch/s390/kernel/time.cmodified+2−0View file
arch/score/kernel/time.cmodified+2−0View file
arch/sparc/kernel/time_32.cmodified+2−0View file
arch/sparc/kernel/time_64.cmodified+2−0View file
arch/tile/kernel/time.cmodified+2−0View file
arch/um/kernel/time.cmodified+3−1View file
arch/unicore32/kernel/time.cmodified+2−0View file
arch/x86/kernel/apic/apic.cmodified+4−0View file
arch/x86/lguest/boot.cmodified+2−0View file
arch/x86/platform/uv/uv_time.cmodified+2−0View file
arch/x86/xen/time.cmodified+4−0View file
drivers/acpi/arm64/Kconfigmodified+3−0View file
drivers/acpi/arm64/Makefilemodified+1−0View file
drivers/acpi/arm64/gtdt.cadded+417−0View file
drivers/char/mmtimer.cmodified+14−14View file
drivers/clocksource/Kconfigmodified+16−3View file
drivers/clocksource/Makefilemodified+1−1View file
drivers/clocksource/arc_timer.cmodified+7−7View file
drivers/clocksource/arm_arch_timer.cmodified+747−361View file
drivers/clocksource/asm9260_timer.cmodified+1−1View file
drivers/clocksource/bcm2835_timer.cmodified+3−3View file
drivers/clocksource/bcm_kona_timer.cmodified+1−1View file
drivers/clocksource/clksrc-probe.cmodified+1−1View file
drivers/clocksource/dw_apb_timer.cmodified+3−1View file
drivers/clocksource/em_sti.cmodified+26−20View file
drivers/clocksource/h8300_timer8.cmodified+0−8View file
drivers/clocksource/meson6_timer.cmodified+2−2View file
drivers/clocksource/metag_generic.cmodified+2−0View file
drivers/clocksource/mips-gic-timer.cmodified+1−14View file
drivers/clocksource/nomadik-mtu.cmodified+4−4View file
drivers/clocksource/numachip.cmodified+2−0View file
drivers/clocksource/pxa_timer.cmodified+3−3View file
drivers/clocksource/rockchip_timer.cmodified+157−61View file
drivers/clocksource/samsung_pwm_timer.cmodified+3−3View file
drivers/clocksource/sh_cmt.cmodified+27−20View file
drivers/clocksource/sh_tmu.cmodified+13−13View file
drivers/clocksource/sun4i_timer.cmodified+5−5View file
drivers/clocksource/tegra20_timer.cmodified+1−1View file
drivers/clocksource/time-armada-370-xp.cmodified+8−8View file
drivers/clocksource/time-efm32.cmodified+1−1View file
drivers/clocksource/time-orion.cmodified+28−6View file
drivers/clocksource/timer-atlas7.cmodified+2−0View file
drivers/clocksource/timer-atmel-pit.cmodified+1−1View file
drivers/clocksource/timer-digicolor.cmodified+3−3View file
drivers/clocksource/timer-gemini.c → drivers/clocksource/timer-fttmr010.crenamed+95−69View file
drivers/clocksource/timer-integrator-ap.cmodified+2−2View file
drivers/clocksource/timer-nps.cmodified+3−3View file
drivers/clocksource/timer-prima2.cmodified+5−5View file
drivers/clocksource/timer-sp804.cmodified+2−2View file
drivers/clocksource/timer-sun5i.cmodified+3−3View file
drivers/clocksource/vf_pit_timer.cmodified+1−1View file
drivers/ptp/ptp_clock.cmodified+7−11View file
include/clocksource/arm_arch_timer.hmodified+34−0View file
include/linux/acpi.hmodified+7−0View file
include/linux/clockchips.hmodified+0−1View file
include/linux/clocksource.hmodified+1−1View file
include/linux/hrtimer.hmodified+1−5View file
include/linux/irqchip/mips-gic.hmodified+0−1View file
include/linux/posix-clock.hmodified+5−5View file
include/linux/posix-timers.hmodified+10−10View file
include/linux/timekeeping.hmodified+5−15View file
kernel/compat.cmodified+6−4View file
kernel/sysctl.cmodified+2−0View file
kernel/time/alarmtimer.cmodified+14−13View file
kernel/time/clockevents.cmodified+1−1View file
kernel/time/hrtimer.cmodified+7−8View file
kernel/time/posix-clock.cmodified+5−5View file
kernel/time/posix-cpu-timers.cmodified+42−33View file
kernel/time/posix-stubs.cmodified+14−6View file
kernel/time/posix-timers.cmodified+55−42View file
kernel/time/sched_clock.cmodified+5−0View file
kernel/time/time.cmodified+2−2View file
kernel/time/timekeeping.cmodified+1−2View file
kernel/time/timer.cmodified+1−1View file
kernel/time/timer_list.cmodified+6−0View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/arm64/silicon-errata.txt

View file
diff --git a/Documentation/arm64/silicon-errata.txt b/Documentation/arm64/silicon-errata.txt
index 2f66683..10f2ddd 100644
--- a/Documentation/arm64/silicon-errata.txt
+++ b/Documentation/arm64/silicon-errata.txt
@@ -54,6 +54,7 @@ stable kernels.
| ARM | Cortex-A57 | #852523 | N/A |
| ARM | Cortex-A57 | #834220 | ARM64_ERRATUM_834220 |
| ARM | Cortex-A72 | #853709 | N/A |
+| ARM | Cortex-A73 | #858921 | ARM64_ERRATUM_858921 |
| ARM | MMU-500 | #841119,#826419 | N/A |
| | | | |
| Cavium | ThunderX ITS | #22375, #24313 | CAVIUM_ERRATUM_22375 |

Documentation/devicetree/bindings/timer/cortina,gemini-timer.txt

View before deletion
diff --git a/Documentation/devicetree/bindings/timer/cortina,gemini-timer.txt b/Documentation/devicetree/bindings/timer/cortina,gemini-timer.txt
deleted file mode 100644
index 16ea1d3..0000000
--- a/Documentation/devicetree/bindings/timer/cortina,gemini-timer.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Cortina Systems Gemini timer
-
-This timer is embedded in the Cortina Systems Gemini SoCs.
-
-Required properties:
-
-- compatible : Must be "cortina,gemini-timer"
-- reg : Should contain registers location and length
-- interrupts : Should contain the three timer interrupts with
- flags for rising edge
-- syscon : a phandle to the global Gemini system controller
-
-Example:
-
-timer@43000000 {
- compatible = "cortina,gemini-timer";
- reg = <0x43000000 0x1000>;
- interrupts = <14 IRQ_TYPE_EDGE_RISING>, /* Timer 1 */
- <15 IRQ_TYPE_EDGE_RISING>, /* Timer 2 */
- <16 IRQ_TYPE_EDGE_RISING>; /* Timer 3 */
- syscon = <&syscon>;
-};

Documentation/devicetree/bindings/timer/faraday,fttmr010.txt

View file
diff --git a/Documentation/devicetree/bindings/timer/faraday,fttmr010.txt b/Documentation/devicetree/bindings/timer/faraday,fttmr010.txt
new file mode 100644
index 0000000..b73ca6c
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/faraday,fttmr010.txt
@@ -0,0 +1,33 @@
+Faraday Technology timer
+
+This timer is a generic IP block from Faraday Technology, embedded in the
+Cortina Systems Gemini SoCs and other designs.
+
+Required properties:
+
+- compatible : Must be one of
+ "faraday,fttmr010"
+ "cortina,gemini-timer"
+- reg : Should contain registers location and length
+- interrupts : Should contain the three timer interrupts usually with
+ flags for falling edge
+
+Optionally required properties:
+
+- clocks : a clock to provide the tick rate for "faraday,fttmr010"
+- clock-names : should be "EXTCLK" and "PCLK" for the external tick timer
+ and peripheral clock respectively, for "faraday,fttmr010"
+- syscon : a phandle to the global Gemini system controller if the compatible
+ type is "cortina,gemini-timer"
+
+Example:
+
+timer@43000000 {
+ compatible = "faraday,fttmr010";
+ reg = <0x43000000 0x1000>;
+ interrupts = <14 IRQ_TYPE_EDGE_FALLING>, /* Timer 1 */
+ <15 IRQ_TYPE_EDGE_FALLING>, /* Timer 2 */
+ <16 IRQ_TYPE_EDGE_FALLING>; /* Timer 3 */
+ clocks = <&extclk>, <&pclk>;
+ clock-names = "EXTCLK", "PCLK";
+};

Documentation/devicetree/bindings/timer/rockchip,rk-timer.txt

View file
diff --git a/Documentation/devicetree/bindings/timer/rockchip,rk-timer.txt b/Documentation/devicetree/bindings/timer/rockchip,rk-timer.txt
index a41b184..16a5f45 100644
--- a/Documentation/devicetree/bindings/timer/rockchip,rk-timer.txt
+++ b/Documentation/devicetree/bindings/timer/rockchip,rk-timer.txt
@@ -1,9 +1,15 @@
Rockchip rk timer
Required properties:
-- compatible: shall be one of:
- "rockchip,rk3288-timer" - for rk3066, rk3036, rk3188, rk322x, rk3288, rk3368
- "rockchip,rk3399-timer" - for rk3399
+- compatible: should be:
+ "rockchip,rk3036-timer", "rockchip,rk3288-timer": for Rockchip RK3036
+ "rockchip,rk3066-timer", "rockchip,rk3288-timer": for Rockchip RK3066
+ "rockchip,rk3188-timer", "rockchip,rk3288-timer": for Rockchip RK3188
+ "rockchip,rk3228-timer", "rockchip,rk3288-timer": for Rockchip RK3228
+ "rockchip,rk3229-timer", "rockchip,rk3288-timer": for Rockchip RK3229
+ "rockchip,rk3288-timer": for Rockchip RK3288
+ "rockchip,rk3368-timer", "rockchip,rk3288-timer": for Rockchip RK3368
+ "rockchip,rk3399-timer": for Rockchip RK3399
- reg: base address of the timer register starting with TIMERS CONTROL register
- interrupts: should contain the interrupts for Timer0
- clocks : must contain an entry for each entry in clock-names

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index 2eefd8c..f050235 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11119,6 +11119,7 @@ F: drivers/power/supply/bq27xxx_battery_i2c.c
TIMEKEEPING, CLOCKSOURCE CORE, NTP, ALARMTIMER
M: John Stultz <[email protected]>
M: Thomas Gleixner <[email protected]>
+R: Stephen Boyd <[email protected]>
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
S: Supported

arch/alpha/kernel/osf_sys.c

View file
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 6d76e52..9ec56dc 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -1016,6 +1016,7 @@ SYSCALL_DEFINE2(osf_gettimeofday, struct timeval32 __user *, tv,
SYSCALL_DEFINE2(osf_settimeofday, struct timeval32 __user *, tv,
struct timezone __user *, tz)
{
+ struct timespec64 kts64;
struct timespec kts;
struct timezone ktz;
@@ -1023,13 +1024,14 @@ SYSCALL_DEFINE2(osf_settimeofday, struct timeval32 __user *, tv,
if (get_tv32((struct timeval *)&kts, tv))
return -EFAULT;
kts.tv_nsec *= 1000;
+ kts64 = timespec_to_timespec64(kts);
}
if (tz) {
if (copy_from_user(&ktz, tz, sizeof(*tz)))
return -EFAULT;
}
- return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
+ return do_sys_settimeofday64(tv ? &kts64 : NULL, tz ? &ktz : NULL);
}
asmlinkage long sys_ni_posix_timers(void);

arch/arm/boot/dts/rk3188.dtsi

View file
diff --git a/arch/arm/boot/dts/rk3188.dtsi b/arch/arm/boot/dts/rk3188.dtsi
index cf91254..1aff4ad 100644
--- a/arch/arm/boot/dts/rk3188.dtsi
+++ b/arch/arm/boot/dts/rk3188.dtsi
@@ -106,6 +106,22 @@
};
};
+ timer3: timer@2000e000 {
+ compatible = "rockchip,rk3188-timer", "rockchip,rk3288-timer";
+ reg = <0x2000e000 0x20>;
+ interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cru SCLK_TIMER3>, <&cru PCLK_TIMER3>;
+ clock-names = "timer", "pclk";
+ };
+
+ timer6: timer@200380a0 {
+ compatible = "rockchip,rk3188-timer", "rockchip,rk3288-timer";
+ reg = <0x200380a0 0x20>;
+ interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cru SCLK_TIMER6>, <&cru PCLK_TIMER0>;
+ clock-names = "timer", "pclk";
+ };
+
i2s0: i2s@1011a000 {
compatible = "rockchip,rk3188-i2s", "rockchip,rk3066-i2s";
reg = <0x1011a000 0x2000>;
@@ -530,6 +546,7 @@
&global_timer {
interrupts = <GIC_PPI 11 0xf04>;
+ status = "disabled";
};
&local_timer {

arch/arm/boot/dts/rk322x.dtsi

View file
diff --git a/arch/arm/boot/dts/rk322x.dtsi b/arch/arm/boot/dts/rk322x.dtsi
index 9dff822..641607d 100644
--- a/arch/arm/boot/dts/rk322x.dtsi
+++ b/arch/arm/boot/dts/rk322x.dtsi
@@ -325,7 +325,7 @@
};
timer: timer@110c0000 {
- compatible = "rockchip,rk3288-timer";
+ compatible = "rockchip,rk3228-timer", "rockchip,rk3288-timer";
reg = <0x110c0000 0x20>;
interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&xin24m>, <&cru PCLK_TIMER>;

arch/arm64/Kconfig

View file
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index b88550a..67695fa 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -2,6 +2,7 @@ config ARM64
def_bool y
select ACPI_CCA_REQUIRED if ACPI
select ACPI_GENERIC_GSI if ACPI
+ select ACPI_GTDT if ACPI
select ACPI_REDUCED_HARDWARE_ONLY if ACPI
select ACPI_MCFG if ACPI
select ACPI_SPCR_TABLE if ACPI

arch/arm64/include/asm/arch_timer.h

View file
diff --git a/arch/arm64/include/asm/arch_timer.h b/arch/arm64/include/asm/arch_timer.h
index b4b3400..74d08e4 100644
--- a/arch/arm64/include/asm/arch_timer.h
+++ b/arch/arm64/include/asm/arch_timer.h
@@ -25,6 +25,7 @@
#include <linux/bug.h>
#include <linux/init.h>
#include <linux/jump_label.h>
+#include <linux/smp.h>
#include <linux/types.h>
#include <clocksource/arm_arch_timer.h>
@@ -37,24 +38,44 @@ extern struct static_key_false arch_timer_read_ool_enabled;
#define needs_unstable_timer_counter_workaround() false
#endif
+enum arch_timer_erratum_match_type {
+ ate_match_dt,
+ ate_match_local_cap_id,
+ ate_match_acpi_oem_info,
+};
+
+struct clock_event_device;
struct arch_timer_erratum_workaround {
- const char *id; /* Indicate the Erratum ID */
+ enum arch_timer_erratum_match_type match_type;
+ const void *id;
+ const char *desc;
u32 (*read_cntp_tval_el0)(void);
u32 (*read_cntv_tval_el0)(void);
u64 (*read_cntvct_el0)(void);
+ int (*set_next_event_phys)(unsigned long, struct clock_event_device *);
+ int (*set_next_event_virt)(unsigned long, struct clock_event_device *);
};
-extern const struct arch_timer_erratum_workaround *timer_unstable_counter_workaround;
-
-#define arch_timer_reg_read_stable(reg) \
-({ \
- u64 _val; \
- if (needs_unstable_timer_counter_workaround()) \
- _val = timer_unstable_counter_workaround->read_##reg();\
- else \
- _val = read_sysreg(reg); \
- _val; \
+DECLARE_PER_CPU(const struct arch_timer_erratum_workaround *,
+ timer_unstable_counter_workaround);
+
+#define arch_timer_reg_read_stable(reg) \
+({ \
+ u64 _val; \
+ if (needs_unstable_timer_counter_workaround()) { \
+ const struct arch_timer_erratum_workaround *wa; \
+ preempt_disable(); \
+ wa = __this_cpu_read(timer_unstable_counter_workaround); \
+ if (wa && wa->read_##reg) \
+ _val = wa->read_##reg(); \
+ else \
+ _val = read_sysreg(reg); \
+ preempt_enable(); \
+ } else { \
+ _val = read_sysreg(reg); \
+ } \
+ _val; \
})
/*

arch/arm64/include/asm/cpucaps.h

View file
diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h
index fb78a5d..b3aab8a 100644
--- a/arch/arm64/include/asm/cpucaps.h
+++ b/arch/arm64/include/asm/cpucaps.h
@@ -37,7 +37,8 @@
#define ARM64_HAS_NO_FPSIMD 16
#define ARM64_WORKAROUND_REPEAT_TLBI 17
#define ARM64_WORKAROUND_QCOM_FALKOR_E1003 18
+#define ARM64_WORKAROUND_858921 19
-#define ARM64_NCAPS 19
+#define ARM64_NCAPS 20
#endif /* __ASM_CPUCAPS_H */

arch/arm64/include/asm/cputype.h

View file
diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h
index fc50271..0984d1b 100644
--- a/arch/arm64/include/asm/cputype.h
+++ b/arch/arm64/include/asm/cputype.h
@@ -80,6 +80,7 @@
#define ARM_CPU_PART_FOUNDATION 0xD00
#define ARM_CPU_PART_CORTEX_A57 0xD07
#define ARM_CPU_PART_CORTEX_A53 0xD03
+#define ARM_CPU_PART_CORTEX_A73 0xD09
#define APM_CPU_PART_POTENZA 0x000
@@ -92,6 +93,7 @@
#define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53)
#define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57)
+#define MIDR_CORTEX_A73 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A73)
#define MIDR_THUNDERX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX)
#define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX)
#define MIDR_QCOM_FALKOR_V1 MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_FALKOR_V1)

arch/arm64/include/asm/esr.h

View file
diff --git a/arch/arm64/include/asm/esr.h b/arch/arm64/include/asm/esr.h
index d14c478..ad42e79 100644
--- a/arch/arm64/include/asm/esr.h
+++ b/arch/arm64/include/asm/esr.h
@@ -175,6 +175,8 @@
#define ESR_ELx_SYS64_ISS_SYS_CTR_READ (ESR_ELx_SYS64_ISS_SYS_CTR | \
ESR_ELx_SYS64_ISS_DIR_READ)
+#define ESR_ELx_SYS64_ISS_SYS_CNTVCT (ESR_ELx_SYS64_ISS_SYS_VAL(3, 3, 2, 14, 0) | \
+ ESR_ELx_SYS64_ISS_DIR_READ)
#ifndef __ASSEMBLY__
#include <asm/types.h>

arch/arm64/kernel/cpu_errata.c

View file
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index f6cc67e..2ed2a76 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -53,6 +53,13 @@ static int cpu_enable_trap_ctr_access(void *__unused)
.midr_range_min = min, \
.midr_range_max = max
+#define MIDR_ALL_VERSIONS(model) \
+ .def_scope = SCOPE_LOCAL_CPU, \
+ .matches = is_affected_midr_range, \
+ .midr_model = model, \
+ .midr_range_min = 0, \
+ .midr_range_max = (MIDR_VARIANT_MASK | MIDR_REVISION_MASK)
+
const struct arm64_cpu_capabilities arm64_errata[] = {
#if defined(CONFIG_ARM64_ERRATUM_826319) || \
defined(CONFIG_ARM64_ERRATUM_827319) || \
@@ -151,6 +158,14 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
MIDR_CPU_VAR_REV(0, 0)),
},
#endif
+#ifdef CONFIG_ARM64_ERRATUM_858921
+ {
+ /* Cortex-A73 all versions */
+ .desc = "ARM erratum 858921",
+ .capability = ARM64_WORKAROUND_858921,
+ MIDR_ALL_VERSIONS(MIDR_CORTEX_A73),
+ },
+#endif
{
}
};

arch/arm64/kernel/cpufeature.c

View file
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index abda8e8..6eb77ae 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -1090,20 +1090,29 @@ static void __init setup_feature_capabilities(void)
* Check if the current CPU has a given feature capability.
* Should be called from non-preemptible context.
*/
-bool this_cpu_has_cap(unsigned int cap)
+static bool __this_cpu_has_cap(const struct arm64_cpu_capabilities *cap_array,
+ unsigned int cap)
{
const struct arm64_cpu_capabilities *caps;
if (WARN_ON(preemptible()))
return false;
- for (caps = arm64_features; caps->desc; caps++)
+ for (caps = cap_array; caps->desc; caps++)
if (caps->capability == cap && caps->matches)
return caps->matches(caps, SCOPE_LOCAL_CPU);
return false;
}
+extern const struct arm64_cpu_capabilities arm64_errata[];
+
+bool this_cpu_has_cap(unsigned int cap)
+{
+ return (__this_cpu_has_cap(arm64_features, cap) ||
+ __this_cpu_has_cap(arm64_errata, cap));
+}
+
void __init setup_cpu_features(void)
{
u32 cwg;

arch/arm64/kernel/traps.c

View file
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index e52be6a..1de444e 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -505,6 +505,14 @@ static void ctr_read_handler(unsigned int esr, struct pt_regs *regs)
regs->pc += 4;
}
+static void cntvct_read_handler(unsigned int esr, struct pt_regs *regs)
+{
+ int rt = (esr & ESR_ELx_SYS64_ISS_RT_MASK) >> ESR_ELx_SYS64_ISS_RT_SHIFT;
+
+ pt_regs_write_reg(regs, rt, arch_counter_get_cntvct());
+ regs->pc += 4;
+}
+
struct sys64_hook {
unsigned int esr_mask;
unsigned int esr_val;
@@ -523,6 +531,12 @@ static struct sys64_hook sys64_hooks[] = {
.esr_val = ESR_ELx_SYS64_ISS_SYS_CTR_READ,
.handler = ctr_read_handler,
},
+ {
+ /* Trap read access to CNTVCT_EL0 */
+ .esr_mask = ESR_ELx_SYS64_ISS_SYS_OP_MASK,
+ .esr_val = ESR_ELx_SYS64_ISS_SYS_CNTVCT,
+ .handler = cntvct_read_handler,
+ },
{},
};

arch/blackfin/kernel/time-ts.c

View file
diff --git a/arch/blackfin/kernel/time-ts.c b/arch/blackfin/kernel/time-ts.c
index 0e9fcf8..0135055 100644
--- a/arch/blackfin/kernel/time-ts.c
+++ b/arch/blackfin/kernel/time-ts.c
@@ -230,7 +230,9 @@ static void __init bfin_gptmr0_clockevent_init(struct clock_event_device *evt)
clock_tick = get_sclk();
evt->mult = div_sc(clock_tick, NSEC_PER_SEC, evt->shift);
evt->max_delta_ns = clockevent_delta2ns(-1, evt);
+ evt->max_delta_ticks = (unsigned long)-1;
evt->min_delta_ns = clockevent_delta2ns(100, evt);
+ evt->min_delta_ticks = 100;
evt->cpumask = cpumask_of(0);
@@ -344,7 +346,9 @@ void bfin_coretmr_clockevent_init(void)
clock_tick = get_cclk() / TIME_SCALE;
evt->mult = div_sc(clock_tick, NSEC_PER_SEC, evt->shift);
evt->max_delta_ns = clockevent_delta2ns(-1, evt);
+ evt->max_delta_ticks = (unsigned long)-1;
evt->min_delta_ns = clockevent_delta2ns(100, evt);
+ evt->min_delta_ticks = 100;
evt->cpumask = cpumask_of(cpu);

arch/c6x/platforms/timer64.c

View file
diff --git a/arch/c6x/platforms/timer64.c b/arch/c6x/platforms/timer64.c
index c19901e..0bd0452 100644
--- a/arch/c6x/platforms/timer64.c
+++ b/arch/c6x/platforms/timer64.c
@@ -234,7 +234,9 @@ void __init timer64_init(void)
clockevents_calc_mult_shift(cd, c6x_core_freq / TIMER_DIVISOR, 5);
cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd);
+ cd->max_delta_ticks = 0x7fffffff;
cd->min_delta_ns = clockevent_delta2ns(250, cd);
+ cd->min_delta_ticks = 250;
cd->cpumask = cpumask_of(smp_processor_id());

arch/hexagon/kernel/time.c

View file
diff --git a/arch/hexagon/kernel/time.c b/arch/hexagon/kernel/time.c
index ff4e9bf..29b1f57 100644
--- a/arch/hexagon/kernel/time.c
+++ b/arch/hexagon/kernel/time.c
@@ -199,7 +199,9 @@ void __init time_init_deferred(void)
clockevents_calc_mult_shift(ce_dev, sleep_clk_freq, 4);
ce_dev->max_delta_ns = clockevent_delta2ns(0x7fffffff, ce_dev);
+ ce_dev->max_delta_ticks = 0x7fffffff;
ce_dev->min_delta_ns = clockevent_delta2ns(0xf, ce_dev);
+ ce_dev->min_delta_ticks = 0xf;
#ifdef CONFIG_SMP
setup_percpu_clockdev();

arch/m68k/coldfire/pit.c

View file
diff --git a/arch/m68k/coldfire/pit.c b/arch/m68k/coldfire/pit.c
index 175553d..6c08780 100644
--- a/arch/m68k/coldfire/pit.c
+++ b/arch/m68k/coldfire/pit.c
@@ -149,8 +149,10 @@ void hw_timer_init(irq_handler_t handler)
cf_pit_clockevent.mult = div_sc(FREQ, NSEC_PER_SEC, 32);
cf_pit_clockevent.max_delta_ns =
clockevent_delta2ns(0xFFFF, &cf_pit_clockevent);
+ cf_pit_clockevent.max_delta_ticks = 0xFFFF;
cf_pit_clockevent.min_delta_ns =
clockevent_delta2ns(0x3f, &cf_pit_clockevent);
+ cf_pit_clockevent.min_delta_ticks = 0x3f;
clockevents_register_device(&cf_pit_clockevent);
setup_irq(MCF_IRQ_PIT1, &pit_irq);

arch/mips/alchemy/common/time.c

View file
diff --git a/arch/mips/alchemy/common/time.c b/arch/mips/alchemy/common/time.c
index e1bec5a..32d1333 100644
--- a/arch/mips/alchemy/common/time.c
+++ b/arch/mips/alchemy/common/time.c
@@ -138,7 +138,9 @@ static int __init alchemy_time_init(unsigned int m2int)
cd->shift = 32;
cd->mult = div_sc(32768, NSEC_PER_SEC, cd->shift);
cd->max_delta_ns = clockevent_delta2ns(0xffffffff, cd);
- cd->min_delta_ns = clockevent_delta2ns(9, cd); /* ~0.28ms */
+ cd->max_delta_ticks = 0xffffffff;
+ cd->min_delta_ns = clockevent_delta2ns(9, cd);
+ cd->min_delta_ticks = 9; /* ~0.28ms */
clockevents_register_device(cd);
setup_irq(m2int, &au1x_rtcmatch2_irqaction);

arch/mips/jz4740/time.c

View file
diff --git a/arch/mips/jz4740/time.c b/arch/mips/jz4740/time.c
index bcf8f8c..bb1ad51 100644
--- a/arch/mips/jz4740/time.c
+++ b/arch/mips/jz4740/time.c
@@ -145,7 +145,9 @@ void __init plat_time_init(void)
clockevent_set_clock(&jz4740_clockevent, clk_rate);
jz4740_clockevent.min_delta_ns = clockevent_delta2ns(100, &jz4740_clockevent);
+ jz4740_clockevent.min_delta_ticks = 100;
jz4740_clockevent.max_delta_ns = clockevent_delta2ns(0xffff, &jz4740_clockevent);
+ jz4740_clockevent.max_delta_ticks = 0xffff;
jz4740_clockevent.cpumask = cpumask_of(0);
clockevents_register_device(&jz4740_clockevent);

arch/mips/kernel/cevt-bcm1480.c

View file
diff --git a/arch/mips/kernel/cevt-bcm1480.c b/arch/mips/kernel/cevt-bcm1480.c
index 940ac00..8f9f2da 100644
--- a/arch/mips/kernel/cevt-bcm1480.c
+++ b/arch/mips/kernel/cevt-bcm1480.c
@@ -123,7 +123,9 @@ void sb1480_clockevent_init(void)
CLOCK_EVT_FEAT_ONESHOT;
clockevent_set_clock(cd, V_SCD_TIMER_FREQ);
cd->max_delta_ns = clockevent_delta2ns(0x7fffff, cd);
+ cd->max_delta_ticks = 0x7fffff;
cd->min_delta_ns = clockevent_delta2ns(2, cd);
+ cd->min_delta_ticks = 2;
cd->rating = 200;
cd->irq = irq;
cd->cpumask = cpumask_of(cpu);

arch/mips/kernel/cevt-ds1287.c

View file
diff --git a/arch/mips/kernel/cevt-ds1287.c b/arch/mips/kernel/cevt-ds1287.c
index 77a5ddf..61ad907 100644
--- a/arch/mips/kernel/cevt-ds1287.c
+++ b/arch/mips/kernel/cevt-ds1287.c
@@ -128,7 +128,9 @@ int __init ds1287_clockevent_init(int irq)
cd->irq = irq;
clockevent_set_clock(cd, 32768);
cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd);
+ cd->max_delta_ticks = 0x7fffffff;
cd->min_delta_ns = clockevent_delta2ns(0x300, cd);
+ cd->min_delta_ticks = 0x300;
cd->cpumask = cpumask_of(0);
clockevents_register_device(&ds1287_clockevent);

arch/mips/kernel/cevt-gt641xx.c

View file
diff --git a/arch/mips/kernel/cevt-gt641xx.c b/arch/mips/kernel/cevt-gt641xx.c
index 6604005..fd90c82 100644
--- a/arch/mips/kernel/cevt-gt641xx.c
+++ b/arch/mips/kernel/cevt-gt641xx.c
@@ -152,7 +152,9 @@ static int __init gt641xx_timer0_clockevent_init(void)
cd->rating = 200 + gt641xx_base_clock / 10000000;
clockevent_set_clock(cd, gt641xx_base_clock);
cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd);
+ cd->max_delta_ticks = 0x7fffffff;
cd->min_delta_ns = clockevent_delta2ns(0x300, cd);
+ cd->min_delta_ticks = 0x300;
cd->cpumask = cpumask_of(0);
clockevents_register_device(&gt641xx_timer0_clockevent);

arch/mips/kernel/cevt-sb1250.c

View file
diff --git a/arch/mips/kernel/cevt-sb1250.c b/arch/mips/kernel/cevt-sb1250.c
index 3d860ef..9d1edb5 100644
--- a/arch/mips/kernel/cevt-sb1250.c
+++ b/arch/mips/kernel/cevt-sb1250.c
@@ -123,7 +123,9 @@ void sb1250_clockevent_init(void)
CLOCK_EVT_FEAT_ONESHOT;
clockevent_set_clock(cd, V_SCD_TIMER_FREQ);
cd->max_delta_ns = clockevent_delta2ns(0x7fffff, cd);
+ cd->max_delta_ticks = 0x7fffff;
cd->min_delta_ns = clockevent_delta2ns(2, cd);
+ cd->min_delta_ticks = 2;
cd->rating = 200;
cd->irq = irq;
cd->cpumask = cpumask_of(cpu);

arch/mips/kernel/cevt-txx9.c

View file
diff --git a/arch/mips/kernel/cevt-txx9.c b/arch/mips/kernel/cevt-txx9.c
index aaca60d..7b17c8f 100644
--- a/arch/mips/kernel/cevt-txx9.c
+++ b/arch/mips/kernel/cevt-txx9.c
@@ -196,7 +196,9 @@ void __init txx9_clockevent_init(unsigned long baseaddr, int irq,
clockevent_set_clock(cd, TIMER_CLK(imbusclk));
cd->max_delta_ns =
clockevent_delta2ns(0xffffffff >> (32 - TXX9_TIMER_BITS), cd);
+ cd->max_delta_ticks = 0xffffffff >> (32 - TXX9_TIMER_BITS);
cd->min_delta_ns = clockevent_delta2ns(0xf, cd);
+ cd->min_delta_ticks = 0xf;
cd->irq = irq;
cd->cpumask = cpumask_of(0),
clockevents_register_device(cd);

arch/mips/loongson32/common/time.c

View file
diff --git a/arch/mips/loongson32/common/time.c b/arch/mips/loongson32/common/time.c
index e6f972d..1c4332a 100644
--- a/arch/mips/loongson32/common/time.c
+++ b/arch/mips/loongson32/common/time.c
@@ -199,7 +199,9 @@ static void __init ls1x_time_init(void)
clockevent_set_clock(cd, mips_hpt_frequency);
cd->max_delta_ns = clockevent_delta2ns(0xffffff, cd);
+ cd->max_delta_ticks = 0xffffff;
cd->min_delta_ns = clockevent_delta2ns(0x000300, cd);
+ cd->min_delta_ticks = 0x000300;
cd->cpumask = cpumask_of(smp_processor_id());
clockevents_register_device(cd);

arch/mips/loongson64/common/cs5536/cs5536_mfgpt.c

View file
diff --git a/arch/mips/loongson64/common/cs5536/cs5536_mfgpt.c b/arch/mips/loongson64/common/cs5536/cs5536_mfgpt.c
index b817d6d..a6adcc4 100644

This diff is incomplete. Download the complete patch.

arch/mips/loongson64/loongson-3/hpet.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/mti-malta/malta-time.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/ralink/cevt-rt3352.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/sgi-ip27/ip27-timer.c

View file

This diff is incomplete. Download the complete patch.

arch/mn10300/kernel/cevt-mn10300.c

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kernel/time.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/time.c

View file

This diff is incomplete. Download the complete patch.

arch/score/kernel/time.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/time_32.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/time_64.c

View file

This diff is incomplete. Download the complete patch.

arch/tile/kernel/time.c

View file

This diff is incomplete. Download the complete patch.

arch/um/kernel/time.c

View file

This diff is incomplete. Download the complete patch.

arch/unicore32/kernel/time.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/apic/apic.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/lguest/boot.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/platform/uv/uv_time.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/xen/time.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/arm64/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/arm64/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/arm64/gtdt.c

View file

This diff is incomplete. Download the complete patch.

drivers/char/mmtimer.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/arc_timer.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/arm_arch_timer.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/asm9260_timer.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/bcm2835_timer.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/bcm_kona_timer.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/clksrc-probe.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/dw_apb_timer.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/em_sti.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/h8300_timer8.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/meson6_timer.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/metag_generic.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/mips-gic-timer.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/nomadik-mtu.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/numachip.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/pxa_timer.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/rockchip_timer.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/samsung_pwm_timer.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/sh_cmt.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/sh_tmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/sun4i_timer.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/tegra20_timer.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/time-armada-370-xp.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/time-efm32.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/time-orion.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/timer-atlas7.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/timer-atmel-pit.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/timer-digicolor.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/timer-fttmr010.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/timer-integrator-ap.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/timer-nps.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/timer-prima2.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/timer-sp804.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/timer-sun5i.c

View file

This diff is incomplete. Download the complete patch.

drivers/clocksource/vf_pit_timer.c

View file

This diff is incomplete. Download the complete patch.

drivers/ptp/ptp_clock.c

View file

This diff is incomplete. Download the complete patch.

include/clocksource/arm_arch_timer.h

View file

This diff is incomplete. Download the complete patch.

include/linux/acpi.h

View file

This diff is incomplete. Download the complete patch.

include/linux/clockchips.h

View file

This diff is incomplete. Download the complete patch.

include/linux/clocksource.h

View file

This diff is incomplete. Download the complete patch.

include/linux/hrtimer.h

View file

This diff is incomplete. Download the complete patch.

include/linux/irqchip/mips-gic.h

View file

This diff is incomplete. Download the complete patch.

include/linux/posix-clock.h

View file

This diff is incomplete. Download the complete patch.

include/linux/posix-timers.h

View file

This diff is incomplete. Download the complete patch.

include/linux/timekeeping.h

View file

This diff is incomplete. Download the complete patch.

kernel/compat.c

View file

This diff is incomplete. Download the complete patch.

kernel/sysctl.c

View file

This diff is incomplete. Download the complete patch.

kernel/time/alarmtimer.c

View file

This diff is incomplete. Download the complete patch.

kernel/time/clockevents.c

View file

This diff is incomplete. Download the complete patch.

kernel/time/hrtimer.c

View file

This diff is incomplete. Download the complete patch.

kernel/time/posix-clock.c

View file

This diff is incomplete. Download the complete patch.

kernel/time/posix-cpu-timers.c

View file

This diff is incomplete. Download the complete patch.

kernel/time/posix-stubs.c

View file

This diff is incomplete. Download the complete patch.

kernel/time/posix-timers.c

View file

This diff is incomplete. Download the complete patch.

kernel/time/sched_clock.c

View file

This diff is incomplete. Download the complete patch.

kernel/time/time.c

View file

This diff is incomplete. Download the complete patch.

kernel/time/timekeeping.c

View file

This diff is incomplete. Download the complete patch.

kernel/time/timer.c

View file

This diff is incomplete. Download the complete patch.

kernel/time/timer_list.c

View file

This diff is incomplete. Download the complete patch.