Skip to content

Commit

Permalink
Merge branches 'timers-core-for-linus' and 'timers-urgent-for-linus' …
Browse files Browse the repository at this point in the history
…of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer updates - and a leftover fix - from Thomas Gleixner:
 "A rather large (commit wise) update from the timer side:

   - A bulk update to make compile tests work in the clocksource drivers

   - An overhaul of the h8300 timers

   - Some more Y2038 work

   - A few overflow prevention checks in the timekeeping/ntp code

   - The usual pile of fixes and improvements to the various
     clocksource/clockevent drivers and core code"

Also:
 "A single fix for the posix-clock poll code which did not make it into
  4.4"

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (84 commits)
  clocksource/drivers/acpi_pm: Convert to pr_* macros
  clocksource: Make clocksource validation work for all clocksources
  timekeeping: Cap adjustments so they don't exceed the maxadj value
  ntp: Fix second_overflow's input parameter type to be 64bits
  ntp: Change time_reftime to time64_t and utilize 64bit __ktime_get_real_seconds
  timekeeping: Provide internal function __ktime_get_real_seconds
  clocksource/drivers/h8300: Use ioread / iowrite
  clocksource/drivers/h8300: Initializer cleanup.
  clocksource/drivers/h8300: Simplify delta handling
  clocksource/drivers/h8300: Fix timer not overflow case
  clocksource/drivers/h8300: Change to overflow interrupt
  clocksource/drivers/lpc32: Correct pr_err() output format
  clocksource/drivers/arm_global_timer: Fix suspend resume
  clocksource/drivers/pistachio: Fix wrong calculated clocksource read value
  clockevents/drivers/arm_global_timer: Use writel_relaxed in gt_compare_set
  clocksource/drivers/dw_apb_timer: Inline apbt_readl and apbt_writel
  clocksource/drivers/dw_apb_timer: Use {readl|writel}_relaxed in critical path
  clocksource/drivers/dw_apb_timer: Fix apbt_readl return types
  clocksource/drivers/tango-xtal: Replace code by clocksource_mmio_init
  clocksource/drivers/h8300: Increase the compilation test coverage
  ...

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  posix-clock: Fix return code on the poll method's error path
  • Loading branch information
torvalds committed Jan 12, 2016
3 parents ae8a521 + 0141488 + 1b9f237 commit b4cee21
Show file tree
Hide file tree
Showing 38 changed files with 621 additions and 624 deletions.
3 changes: 2 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -9364,7 +9364,7 @@ M: Andreas Noever <[email protected]>
S: Maintained
F: drivers/thunderbolt/

TIMEKEEPING, CLOCKSOURCE CORE, NTP
TIMEKEEPING, CLOCKSOURCE CORE, NTP, ALARMTIMER
M: John Stultz <[email protected]>
M: Thomas Gleixner <[email protected]>
L: [email protected]
Expand All @@ -9377,6 +9377,7 @@ F: include/uapi/linux/time.h
F: include/uapi/linux/timex.h
F: kernel/time/clocksource.c
F: kernel/time/time*.c
F: kernel/time/alarmtimer.c
F: kernel/time/ntp.c
F: tools/testing/selftests/timers/

Expand Down
3 changes: 3 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ config ARCH_PXA
select AUTO_ZRELADDR
select COMMON_CLK
select CLKDEV_LOOKUP
select CLKSRC_PXA
select CLKSRC_MMIO
select CLKSRC_OF
select GENERIC_CLOCKEVENTS
Expand Down Expand Up @@ -650,6 +651,8 @@ config ARCH_SA1100
select ARCH_SPARSEMEM_ENABLE
select CLKDEV_LOOKUP
select CLKSRC_MMIO
select CLKSRC_PXA
select CLKSRC_OF if OF
select CPU_FREQ
select CPU_SA1100
select GENERIC_CLOCKEVENTS
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-exynos/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ menuconfig ARCH_EXYNOS
select SRAM
select THERMAL
select MFD_SYSCON
select CLKSRC_EXYNOS_MCT
help
Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5)

Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-sti/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ menuconfig ARCH_STI
select ARM_GIC
select ST_IRQCHIP
select ARM_GLOBAL_TIMER
select CLKSRC_ST_LPC
select PINCTRL
select PINCTRL_ST
select MFD_SYSCON
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-ux500/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ config UX500_SOC_DB8500
select PINCTRL_AB8540
select REGULATOR
select REGULATOR_DB8500_PRCMU
select CLKSRC_DBX500_PRCMU
select PM_GENERIC_DOMAINS if PM

config MACH_MOP500
Expand Down
1 change: 1 addition & 0 deletions arch/h8300/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ config H8300
select HAVE_MEMBLOCK
select HAVE_DMA_ATTRS
select CLKSRC_OF
select H8300_TMR8

config RWSEM_GENERIC_SPINLOCK
def_bool y
Expand Down
39 changes: 23 additions & 16 deletions arch/h8300/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,62 @@

#ifdef __KERNEL__

#include <asm-generic/io.h>

/* H8/300 internal I/O functions */
static inline unsigned char ctrl_inb(unsigned long addr)

#define __raw_readb __raw_readb
static inline u8 __raw_readb(const volatile void __iomem *addr)
{
return *(volatile unsigned char *)addr;
return *(volatile u8 *)addr;
}

static inline unsigned short ctrl_inw(unsigned long addr)
#define __raw_readw __raw_readw
static inline u16 __raw_readw(const volatile void __iomem *addr)
{
return *(volatile unsigned short *)addr;
return *(volatile u16 *)addr;
}

static inline unsigned long ctrl_inl(unsigned long addr)
#define __raw_readl __raw_readl
static inline u32 __raw_readl(const volatile void __iomem *addr)
{
return *(volatile unsigned long *)addr;
return *(volatile u32 *)addr;
}

static inline void ctrl_outb(unsigned char b, unsigned long addr)
#define __raw_writeb __raw_writeb
static inline void __raw_writeb(u8 b, const volatile void __iomem *addr)
{
*(volatile unsigned char *)addr = b;
*(volatile u8 *)addr = b;
}

static inline void ctrl_outw(unsigned short b, unsigned long addr)
#define __raw_writew __raw_writew
static inline void __raw_writew(u16 b, const volatile void __iomem *addr)
{
*(volatile unsigned short *)addr = b;
*(volatile u16 *)addr = b;
}

static inline void ctrl_outl(unsigned long b, unsigned long addr)
#define __raw_writel __raw_writel
static inline void __raw_writel(u32 b, const volatile void __iomem *addr)
{
*(volatile unsigned long *)addr = b;
*(volatile u32 *)addr = b;
}

static inline void ctrl_bclr(int b, unsigned char *addr)
static inline void ctrl_bclr(int b, void __iomem *addr)
{
if (__builtin_constant_p(b))
__asm__("bclr %1,%0" : "+WU"(*addr): "i"(b));
else
__asm__("bclr %w1,%0" : "+WU"(*addr): "r"(b));
}

static inline void ctrl_bset(int b, unsigned char *addr)
static inline void ctrl_bset(int b, void __iomem *addr)
{
if (__builtin_constant_p(b))
__asm__("bset %1,%0" : "+WU"(*addr): "i"(b));
else
__asm__("bset %w1,%0" : "+WU"(*addr): "r"(b));
}

#include <asm-generic/io.h>

#endif /* __KERNEL__ */

#endif /* _H8300_IO_H */
8 changes: 4 additions & 4 deletions arch/h8300/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,14 @@ device_initcall(device_probe);
#define get_wait(base, addr) ({ \
int baddr; \
baddr = ((addr) / 0x200000 * 2); \
w *= (ctrl_inw((unsigned long)(base) + 2) & (3 << baddr)) + 1; \
w *= (readw((base) + 2) & (3 << baddr)) + 1; \
})
#endif
#if defined(CONFIG_CPU_H8S)
#define get_wait(base, addr) ({ \
int baddr; \
baddr = ((addr) / 0x200000 * 16); \
w *= (ctrl_inl((unsigned long)(base) + 2) & (7 << baddr)) + 1; \
w *= (readl((base) + 2) & (7 << baddr)) + 1; \
})
#endif

Expand All @@ -228,8 +228,8 @@ static __init int access_timing(void)

bsc = of_find_compatible_node(NULL, NULL, "renesas,h8300-bsc");
base = of_iomap(bsc, 0);
w = (ctrl_inb((unsigned long)base + 0) & bit)?2:1;
if (ctrl_inb((unsigned long)base + 1) & bit)
w = (readb(base + 0) & bit)?2:1;
if (readb(base + 1) & bit)
w *= get_wait(base, addr);
else
w *= 2;
Expand Down
Loading

0 comments on commit b4cee21

Please sign in to comment.