]> Git Repo - linux.git/commitdiff
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <[email protected]>
Tue, 12 Nov 2013 01:36:00 +0000 (10:36 +0900)
committerLinus Torvalds <[email protected]>
Tue, 12 Nov 2013 01:36:00 +0000 (10:36 +0900)
Pull timer changes from Ingo Molnar:
 "Main changes in this cycle were:

   - Updated full dynticks support.

   - Event stream support for architected (ARM) timers.

   - ARM clocksource driver updates.

   - Move arm64 to using the generic sched_clock framework & resulting
     cleanup in the generic sched_clock code.

   - Misc fixes and cleanups"

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (50 commits)
  x86/time: Honor ACPI FADT flag indicating absence of a CMOS RTC
  clocksource: sun4i: remove IRQF_DISABLED
  clocksource: sun4i: Report the minimum tick that we can program
  clocksource: sun4i: Select CLKSRC_MMIO
  clocksource: Provide timekeeping for efm32 SoCs
  clocksource: em_sti: convert to clk_prepare/unprepare
  time: Fix signedness bug in sysfs_get_uname() and its callers
  timekeeping: Fix some trivial typos in comments
  alarmtimer: return EINVAL instead of ENOTSUPP if rtcdev doesn't exist
  clocksource: arch_timer: Do not register arch_sys_counter twice
  timer stats: Add a 'Collection: active/inactive' line to timer usage statistics
  sched_clock: Remove sched_clock_func() hook
  arch_timer: Move to generic sched_clock framework
  clocksource: tcb_clksrc: Remove IRQF_DISABLED
  clocksource: tcb_clksrc: Improve driver robustness
  clocksource: tcb_clksrc: Replace clk_enable/disable with clk_prepare_enable/disable_unprepare
  clocksource: arm_arch_timer: Use clocksource for suspend timekeeping
  clocksource: dw_apb_timer_of: Mark a few more functions as __init
  clocksource: Put nodes passed to CLOCKSOURCE_OF_DECLARE callbacks centrally
  arm: zynq: Enable arm_global_timer
  ...

1  2 
arch/Kconfig
arch/arm/Kconfig
arch/arm64/Kconfig
arch/arm64/kernel/setup.c
init/Kconfig
kernel/time/clockevents.c

diff --combined arch/Kconfig
index ad95133f8faedd283906798781eeae14b8cc4042,185f8b0076436d75fb6896855cd2c4df0d1ed73c..ded747c7b74c32e66fa681d7e710528c23421f9e
@@@ -353,6 -353,18 +353,18 @@@ config HAVE_CONTEXT_TRACKIN
  config HAVE_VIRT_CPU_ACCOUNTING
        bool
  
+ config HAVE_VIRT_CPU_ACCOUNTING_GEN
+       bool
+       default y if 64BIT
+       help
+         With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
+         Before enabling this option, arch code must be audited
+         to ensure there are no races in concurrent read/write of
+         cputime_t. For example, reading/writing 64-bit cputime_t on
+         some 32-bit arches may require multiple accesses, so proper
+         locking is needed to protect against concurrent accesses.
  config HAVE_IRQ_TIME_ACCOUNTING
        bool
        help
@@@ -390,16 -402,6 +402,16 @@@ config HAVE_UNDERSCORE_SYMBOL_PREFI
          Some architectures generate an _ in front of C symbols; things like
          module loading and assembly files need to know about this.
  
 +config HAVE_IRQ_EXIT_ON_IRQ_STACK
 +      bool
 +      help
 +        Architecture doesn't only execute the irq handler on the irq stack
 +        but also irq_exit(). This way we can process softirqs on this irq
 +        stack instead of switching to a new one when we call __do_softirq()
 +        in the end of an hardirq.
 +        This spares a stack switch and improves cache usage on softirq
 +        processing.
 +
  #
  # ABI hall of shame
  #
diff --combined arch/arm/Kconfig
index 04163fece49fea0662fcd338814aab1177842732,323baf07fdcedfe2866819ca95dc225b05743ac3..aa8300333bc5c6046f07b634f3fb4d2e2f138b04
@@@ -54,6 -54,7 +54,7 @@@ config AR
        select HAVE_REGS_AND_STACK_ACCESS_API
        select HAVE_SYSCALL_TRACEPOINTS
        select HAVE_UID16
+       select HAVE_VIRT_CPU_ACCOUNTING_GEN
        select IRQ_FORCED_THREADING
        select KTIME_SCALAR
        select MODULES_USE_ELF_REL
@@@ -317,7 -318,6 +318,7 @@@ config ARCH_INTEGRATO
        select NEED_MACH_MEMORY_H
        select PLAT_VERSATILE
        select SPARSE_IRQ
 +      select USE_OF
        select VERSATILE_FPGA_IRQ
        help
          Support for ARM's Integrator platform.
@@@ -359,6 -359,7 +360,6 @@@ config ARCH_AT9
        bool "Atmel AT91"
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
 -      select HAVE_CLK
        select IRQ_DOMAIN
        select NEED_MACH_GPIO_H
        select NEED_MACH_IO_H if PCCARD
@@@ -372,6 -373,7 +373,6 @@@ config ARCH_CLPS711
        bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
        select ARCH_REQUIRE_GPIOLIB
        select AUTO_ZRELADDR
 -      select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select COMMON_CLK
        select CPU_ARM720T
  config ARCH_GEMINI
        bool "Cortina Systems Gemini"
        select ARCH_REQUIRE_GPIOLIB
 -      select ARCH_USES_GETTIMEOFFSET
 +      select CLKSRC_MMIO
        select CPU_FA526
 +      select GENERIC_CLOCKEVENTS
        select NEED_MACH_GPIO_H
        help
          Support for the Cortina Systems Gemini family SoCs
@@@ -631,6 -632,7 +632,6 @@@ config ARCH_PX
  config ARCH_MSM
        bool "Qualcomm MSM"
        select ARCH_REQUIRE_GPIOLIB
 -      select CLKDEV_LOOKUP
        select CLKSRC_OF if OF
        select COMMON_CLK
        select GENERIC_CLOCKEVENTS
@@@ -648,6 -650,7 +649,6 @@@ config ARCH_SHMOBIL
        select GENERIC_CLOCKEVENTS
        select HAVE_ARM_SCU if SMP
        select HAVE_ARM_TWD if SMP
 -      select HAVE_CLK
        select HAVE_MACH_CLKDEV
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
@@@ -704,6 -707,7 +705,6 @@@ config ARCH_S3C24X
        select CLKSRC_SAMSUNG_PWM
        select GENERIC_CLOCKEVENTS
        select GPIO_SAMSUNG
 -      select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
        select HAVE_S3C_RTC if RTC_CLASS
@@@ -724,22 -728,21 +725,22 @@@ config ARCH_S3C64X
        select ARM_VIC
        select CLKDEV_LOOKUP
        select CLKSRC_SAMSUNG_PWM
 +      select COMMON_CLK
        select CPU_V6
        select GENERIC_CLOCKEVENTS
        select GPIO_SAMSUNG
 -      select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
        select HAVE_TCM
        select NEED_MACH_GPIO_H
        select NO_IOPORT
        select PLAT_SAMSUNG
 +      select PM_GENERIC_DOMAINS
        select S3C_DEV_NAND
        select S3C_GPIO_TRACK
        select SAMSUNG_ATAGS
 -      select SAMSUNG_CLKSRC
        select SAMSUNG_GPIOLIB_4BIT
 +      select SAMSUNG_WAKEMASK
        select SAMSUNG_WDT_RESET
        select USB_ARCH_HAS_OHCI
        help
@@@ -752,6 -755,7 +753,6 @@@ config ARCH_S5P64X
        select CPU_V6
        select GENERIC_CLOCKEVENTS
        select GPIO_SAMSUNG
 -      select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
        select HAVE_S3C_RTC if RTC_CLASS
@@@ -770,6 -774,7 +771,6 @@@ config ARCH_S5PC10
        select CPU_V7
        select GENERIC_CLOCKEVENTS
        select GPIO_SAMSUNG
 -      select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
        select HAVE_S3C_RTC if RTC_CLASS
@@@ -789,6 -794,7 +790,6 @@@ config ARCH_S5PV21
        select CPU_V7
        select GENERIC_CLOCKEVENTS
        select GPIO_SAMSUNG
 -      select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
        select HAVE_S3C_RTC if RTC_CLASS
@@@ -805,9 -811,11 +806,9 @@@ config ARCH_EXYNO
        select ARCH_REQUIRE_GPIOLIB
        select ARCH_SPARSEMEM_ENABLE
        select ARM_GIC
 -      select CLKDEV_LOOKUP
        select COMMON_CLK
        select CPU_V7
        select GENERIC_CLOCKEVENTS
 -      select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
        select HAVE_S3C_RTC if RTC_CLASS
        help
          Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5)
  
 -config ARCH_SHARK
 -      bool "Shark"
 -      select ARCH_USES_GETTIMEOFFSET
 -      select CPU_SA110
 -      select ISA
 -      select ISA_DMA
 -      select NEED_MACH_MEMORY_H
 -      select PCI
 -      select VIRT_TO_BUS
 -      select ZONE_DMA
 -      help
 -        Support for the StrongARM based Digital DNARD machine, also known
 -        as "Shark" (<http://www.shark-linux.de/shark.html>).
 -
  config ARCH_DAVINCI
        bool "TI DaVinci"
        select ARCH_HAS_HOLES_MEMORYMODEL
        select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_CHIP
        select HAVE_IDE
 -      select NEED_MACH_GPIO_H
        select TI_PRIV_EDMA
        select USE_OF
        select ZONE_DMA
@@@ -843,6 -866,7 +844,6 @@@ config ARCH_OMAP
        select CLKSRC_MMIO
        select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_CHIP
 -      select HAVE_CLK
        select HAVE_IDE
        select IRQ_DOMAIN
        select NEED_MACH_IO_H if PCCARD
@@@ -986,7 -1010,9 +987,7 @@@ source "arch/arm/mach-sti/Kconfig
  
  source "arch/arm/mach-s3c24xx/Kconfig"
  
 -if ARCH_S3C64XX
  source "arch/arm/mach-s3c64xx/Kconfig"
 -endif
  
  source "arch/arm/mach-s5p64x0/Kconfig"
  
@@@ -1406,6 -1432,12 +1407,6 @@@ config PCI_NANOENGIN
  config PCI_SYSCALL
        def_bool PCI
  
 -# Select the host bridge type
 -config PCI_HOST_VIA82C505
 -      bool
 -      depends on PCI && ARCH_SHARK
 -      default y
 -
  config PCI_HOST_ITE8152
        bool
        depends on PCI && MACH_ARMCORE
diff --combined arch/arm64/Kconfig
index ce6ae94974921b267b75a71a07345c2d9318016c,35fd0eb572703c23c627f56e6597aec81438a041..bb0bf1bfc05dd6868bf58d7cf4fac276c143db43
@@@ -1,7 -1,6 +1,7 @@@
  config ARM64
        def_bool y
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
 +      select ARCH_USE_CMPXCHG_LOCKREF
        select ARCH_WANT_OPTIONAL_GPIOLIB
        select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
        select ARCH_WANT_FRAME_POINTERS
@@@ -15,6 -14,7 +15,7 @@@
        select GENERIC_IOMAP
        select GENERIC_IRQ_PROBE
        select GENERIC_IRQ_SHOW
+       select GENERIC_SCHED_CLOCK
        select GENERIC_SMP_IDLE_THREAD
        select GENERIC_TIME_VSYSCALL
        select HARDIRQS_SW_RESEND
@@@ -62,6 -62,10 +63,6 @@@ config LOCKDEP_SUPPOR
  config TRACE_IRQFLAGS_SUPPORT
        def_bool y
  
 -config GENERIC_LOCKBREAK
 -      def_bool y
 -      depends on SMP && PREEMPT
 -
  config RWSEM_GENERIC_SPINLOCK
        def_bool y
  
@@@ -135,11 -139,6 +136,11 @@@ config ARM64_64K_PAGE
          look-up. AArch32 emulation is not available when this feature
          is enabled.
  
 +config CPU_BIG_ENDIAN
 +       bool "Build big-endian kernel"
 +       help
 +         Say Y if you plan on running a kernel in big-endian mode.
 +
  config SMP
        bool "Symmetric Multi-Processing"
        select USE_GENERIC_SMP_HELPERS
@@@ -162,13 -161,6 +163,13 @@@ config NR_CPU
        default "8" if ARCH_XGENE
        default "4"
  
 +config HOTPLUG_CPU
 +      bool "Support for hot-pluggable CPUs"
 +      depends on SMP
 +      help
 +        Say Y here to experiment with turning CPUs off and on.  CPUs
 +        can be controlled through /sys/devices/system/cpu.
 +
  source kernel/Kconfig.preempt
  
  config HZ
index 9cf30f49610d4cc29ff0d728cb7ec8c8a50336f4,d355b7b9710bcd067b136a36e7523a3fb3fd85cf..47905598d79060fc34b04408e17afa25d2e1b480
@@@ -45,7 -45,6 +45,7 @@@
  #include <asm/cputype.h>
  #include <asm/elf.h>
  #include <asm/cputable.h>
 +#include <asm/cpu_ops.h>
  #include <asm/sections.h>
  #include <asm/setup.h>
  #include <asm/smp_plat.h>
@@@ -61,6 -60,16 +61,16 @@@ EXPORT_SYMBOL(processor_id)
  unsigned long elf_hwcap __read_mostly;
  EXPORT_SYMBOL_GPL(elf_hwcap);
  
+ #ifdef CONFIG_COMPAT
+ #define COMPAT_ELF_HWCAP_DEFAULT      \
+                               (COMPAT_HWCAP_HALF|COMPAT_HWCAP_THUMB|\
+                                COMPAT_HWCAP_FAST_MULT|COMPAT_HWCAP_EDSP|\
+                                COMPAT_HWCAP_TLS|COMPAT_HWCAP_VFP|\
+                                COMPAT_HWCAP_VFPv3|COMPAT_HWCAP_VFPv4|\
+                                COMPAT_HWCAP_NEON|COMPAT_HWCAP_IDIV)
+ unsigned int compat_elf_hwcap __read_mostly = COMPAT_ELF_HWCAP_DEFAULT;
+ #endif
  static const char *cpu_name;
  static const char *machine_name;
  phys_addr_t __fdt_pointer __initdata;
@@@ -98,11 -107,6 +108,11 @@@ void __init early_print(const char *str
        printk("%s", buf);
  }
  
 +bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
 +{
 +      return phys_id == cpu_logical_map(cpu);
 +}
 +
  static void __init setup_processor(void)
  {
        struct cpu_info *cpu_info;
        printk("CPU: %s [%08x] revision %d\n",
               cpu_name, read_cpuid_id(), read_cpuid_id() & 15);
  
 -      sprintf(init_utsname()->machine, "aarch64");
 +      sprintf(init_utsname()->machine, ELF_PLATFORM);
        elf_hwcap = 0;
  }
  
@@@ -270,7 -274,6 +280,7 @@@ void __init setup_arch(char **cmdline_p
        psci_init();
  
        cpu_logical_map(0) = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
 +      cpu_read_bootcpu_ops();
  #ifdef CONFIG_SMP
        smp_init_cpus();
  #endif
@@@ -311,6 -314,7 +321,7 @@@ subsys_initcall(topology_init)
  static const char *hwcap_str[] = {
        "fp",
        "asimd",
+       "evtstrm",
        NULL
  };
  
diff --combined init/Kconfig
index d9887456007a83b212eb41dabf95f7d8c781c6b4,841e79cb8bb363fd37aa55222ca7ccb09b303021..bc8911fab28e3e541d201dfe1296b933a494837b
@@@ -284,7 -284,7 +284,7 @@@ config AUDI
  
  config AUDITSYSCALL
        bool "Enable system-call auditing support"
 -      depends on AUDIT && (X86 || PPC || S390 || IA64 || UML || SPARC64 || SUPERH || (ARM && AEABI && !OABI_COMPAT))
 +      depends on AUDIT && (X86 || PARISC || PPC || S390 || IA64 || UML || SPARC64 || SUPERH || (ARM && AEABI && !OABI_COMPAT))
        default y if SECURITY_SELINUX
        help
          Enable low-overhead system-call auditing infrastructure that
@@@ -354,7 -354,8 +354,8 @@@ config VIRT_CPU_ACCOUNTING_NATIV
  
  config VIRT_CPU_ACCOUNTING_GEN
        bool "Full dynticks CPU time accounting"
-       depends on HAVE_CONTEXT_TRACKING && 64BIT
+       depends on HAVE_CONTEXT_TRACKING
+       depends on HAVE_VIRT_CPU_ACCOUNTING_GEN
        select VIRT_CPU_ACCOUNTING
        select CONTEXT_TRACKING
        help
index 662c5798a685d77904fcc1080596e4e4bd5d34b3,30554b9fb1f7af1e83bc5f4c31073d566a74c2c3..086ad6043bcbde85bcb1755e7fa17979d696a46a
@@@ -33,64 -33,29 +33,64 @@@ struct ce_unbind 
        int res;
  };
  
 -/**
 - * clockevents_delta2ns - Convert a latch value (device ticks) to nanoseconds
 - * @latch:    value to convert
 - * @evt:      pointer to clock event device descriptor
 - *
 - * Math helper, returns latch value converted to nanoseconds (bound checked)
 - */
 -u64 clockevent_delta2ns(unsigned long latch, struct clock_event_device *evt)
 +static u64 cev_delta2ns(unsigned long latch, struct clock_event_device *evt,
 +                      bool ismax)
  {
        u64 clc = (u64) latch << evt->shift;
 +      u64 rnd;
  
        if (unlikely(!evt->mult)) {
                evt->mult = 1;
                WARN_ON(1);
        }
 +      rnd = (u64) evt->mult - 1;
 +
 +      /*
 +       * Upper bound sanity check. If the backwards conversion is
 +       * not equal latch, we know that the above shift overflowed.
 +       */
 +      if ((clc >> evt->shift) != (u64)latch)
 +              clc = ~0ULL;
 +
 +      /*
 +       * Scaled math oddities:
 +       *
 +       * For mult <= (1 << shift) we can safely add mult - 1 to
 +       * prevent integer rounding loss. So the backwards conversion
 +       * from nsec to device ticks will be correct.
 +       *
 +       * For mult > (1 << shift), i.e. device frequency is > 1GHz we
 +       * need to be careful. Adding mult - 1 will result in a value
 +       * which when converted back to device ticks can be larger
 +       * than latch by up to (mult - 1) >> shift. For the min_delta
 +       * calculation we still want to apply this in order to stay
 +       * above the minimum device ticks limit. For the upper limit
 +       * we would end up with a latch value larger than the upper
 +       * limit of the device, so we omit the add to stay below the
 +       * device upper boundary.
 +       *
 +       * Also omit the add if it would overflow the u64 boundary.
 +       */
 +      if ((~0ULL - clc > rnd) &&
 +          (!ismax || evt->mult <= (1U << evt->shift)))
 +              clc += rnd;
  
        do_div(clc, evt->mult);
 -      if (clc < 1000)
 -              clc = 1000;
 -      if (clc > KTIME_MAX)
 -              clc = KTIME_MAX;
  
 -      return clc;
 +      /* Deltas less than 1usec are pointless noise */
 +      return clc > 1000 ? clc : 1000;
 +}
 +
 +/**
 + * clockevents_delta2ns - Convert a latch value (device ticks) to nanoseconds
 + * @latch:    value to convert
 + * @evt:      pointer to clock event device descriptor
 + *
 + * Math helper, returns latch value converted to nanoseconds (bound checked)
 + */
 +u64 clockevent_delta2ns(unsigned long latch, struct clock_event_device *evt)
 +{
 +      return cev_delta2ns(latch, evt, false);
  }
  EXPORT_SYMBOL_GPL(clockevent_delta2ns);
  
@@@ -415,8 -380,8 +415,8 @@@ void clockevents_config(struct clock_ev
                sec = 600;
  
        clockevents_calc_mult_shift(dev, freq, sec);
 -      dev->min_delta_ns = clockevent_delta2ns(dev->min_delta_ticks, dev);
 -      dev->max_delta_ns = clockevent_delta2ns(dev->max_delta_ticks, dev);
 +      dev->min_delta_ns = cev_delta2ns(dev->min_delta_ticks, dev, false);
 +      dev->max_delta_ns = cev_delta2ns(dev->max_delta_ticks, dev, true);
  }
  
  /**
@@@ -619,7 -584,7 +619,7 @@@ static ssize_t sysfs_unbind_tick_dev(st
                                     const char *buf, size_t count)
  {
        char name[CS_NAME_LEN];
-       size_t ret = sysfs_get_uname(buf, name, count);
+       ssize_t ret = sysfs_get_uname(buf, name, count);
        struct clock_event_device *ce;
  
        if (ret < 0)
This page took 0.095739 seconds and 4 git commands to generate.