Merge branch 'linus' into timers/urgent, to pick up fixes
authorIngo Molnar <mingo@kernel.org>
Wed, 10 Aug 2016 12:36:23 +0000 (14:36 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 10 Aug 2016 12:36:23 +0000 (14:36 +0200)
Signed-off-by: Ingo Molnar <mingo@kernel.org>
1  2 
arch/x86/kernel/apic/apic.c
arch/x86/kernel/tsc.c

index 0fd3d659f13c4a048ac35b3cf049aab754222b17,20abd912f0e4a6bbaa364dd97b388d0dc3da136a..cea4fc19e8447d14fd6dcba5df94aa91f7a2332d
@@@ -23,7 -23,7 +23,7 @@@
  #include <linux/bootmem.h>
  #include <linux/ftrace.h>
  #include <linux/ioport.h>
- #include <linux/module.h>
+ #include <linux/export.h>
  #include <linux/syscore_ops.h>
  #include <linux/delay.h>
  #include <linux/timex.h>
@@@ -147,7 -147,7 +147,7 @@@ static int force_enable_local_apic __in
   */
  static int __init parse_lapic(char *arg)
  {
-       if (config_enabled(CONFIG_X86_32) && !arg)
+       if (IS_ENABLED(CONFIG_X86_32) && !arg)
                force_enable_local_apic = 1;
        else if (arg && !strncmp(arg, "notscdeadline", 13))
                setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER);
@@@ -313,7 -313,7 +313,7 @@@ int lapic_get_maxlvt(void
  
  /* Clock divisor */
  #define APIC_DIVISOR 16
 -#define TSC_DIVISOR  32
 +#define TSC_DIVISOR  8
  
  /*
   * This function sets up the local APIC timer, with a timeout of
@@@ -565,36 -565,12 +565,36 @@@ static void setup_APIC_timer(void
                                    CLOCK_EVT_FEAT_DUMMY);
                levt->set_next_event = lapic_next_deadline;
                clockevents_config_and_register(levt,
 -                                              (tsc_khz / TSC_DIVISOR) * 1000,
 +                                              tsc_khz * (1000 / TSC_DIVISOR),
                                                0xF, ~0UL);
        } else
                clockevents_register_device(levt);
  }
  
 +/*
 + * Install the updated TSC frequency from recalibration at the TSC
 + * deadline clockevent devices.
 + */
 +static void __lapic_update_tsc_freq(void *info)
 +{
 +      struct clock_event_device *levt = this_cpu_ptr(&lapic_events);
 +
 +      if (!this_cpu_has(X86_FEATURE_TSC_DEADLINE_TIMER))
 +              return;
 +
 +      clockevents_update_freq(levt, tsc_khz * (1000 / TSC_DIVISOR));
 +}
 +
 +void lapic_update_tsc_freq(void)
 +{
 +      /*
 +       * The clockevent device's ->mult and ->shift can both be
 +       * changed. In order to avoid races, schedule the frequency
 +       * update code on each CPU.
 +       */
 +      on_each_cpu(__lapic_update_tsc_freq, NULL, 0);
 +}
 +
  /*
   * In this functions we calibrate APIC bus clocks to the external timer.
   *
diff --combined arch/x86/kernel/tsc.c
index 8fb4b6abac0e75d61518581d1926d6fb18ec6475,1ef87e887051e950071aa746f68ca9736f3c7e4a..78b9cb5a26af31559625f3a4e40e62fdc7d53512
@@@ -3,7 -3,7 +3,7 @@@
  #include <linux/kernel.h>
  #include <linux/sched.h>
  #include <linux/init.h>
- #include <linux/module.h>
+ #include <linux/export.h>
  #include <linux/timer.h>
  #include <linux/acpi_pmtmr.h>
  #include <linux/cpufreq.h>
@@@ -22,7 -22,6 +22,7 @@@
  #include <asm/nmi.h>
  #include <asm/x86_init.h>
  #include <asm/geode.h>
 +#include <asm/apic.h>
  
  unsigned int __read_mostly cpu_khz;   /* TSC clocks / usec, not used here */
  EXPORT_SYMBOL(cpu_khz);
@@@ -1250,9 -1249,6 +1250,9 @@@ static void tsc_refine_calibration_work
                (unsigned long)tsc_khz / 1000,
                (unsigned long)tsc_khz % 1000);
  
 +      /* Inform the TSC deadline clockevent devices about the recalibration */
 +      lapic_update_tsc_freq();
 +
  out:
        if (boot_cpu_has(X86_FEATURE_ART))
                art_related_clocksource = &clocksource_tsc;
This page took 0.109909 seconds and 5 git commands to generate.