1. 17 1月, 2017 1 次提交
  2. 25 12月, 2016 2 次提交
  3. 19 12月, 2016 1 次提交
  4. 01 12月, 2016 4 次提交
    • A
      clocksource: nps: avoid maybe-uninitialized warning · a26b0d49
      Arnd Bergmann 提交于
      We get a harmless false-positive warning with the newly added nps
      clocksource driver:
      
      drivers/clocksource/timer-nps.c: In function 'nps_setup_clocksource':
      drivers/clocksource/timer-nps.c:102:6: error: 'nps_timer1_freq' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      Gcc here fails to identify that IS_ERR() is only true if PTR_ERR()
      has a nonzero value. Using PTR_ERR_OR_ZERO() to convert the result
      first makes this obvious and shuts up the warning.
      
      Fixes: 0ee4d9922df5 ("clocksource: Add clockevent support to NPS400 driver")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      a26b0d49
    • N
      clocksource: Add clockevent support to NPS400 driver · 60263dcd
      Noam Camus 提交于
      Till now we used clockevent from generic ARC driver.
      This was enough as long as we worked with simple multicore SoC.
      When we are working with multithread SoC each HW thread can be
      scheduled to receive timer interrupt using timer mask register.
      This patch will provide a way to control clock events per HW thread.
      
      The design idea is that for each core there is dedicated register
      (TSI) serving all 16 HW threads.
      The register is a bitmask with one bit for each HW thread.
      When HW thread wants that next expiration of timer interrupt will
      hit it then the proper bit should be set in this dedicated register.
      When timer expires all HW threads within this core which their bit
      is set at the TSI register will be interrupted.
      
      Driver can be used from device tree by:
      compatible = "ezchip,nps400-timer0" <-- for clocksource
      compatible = "ezchip,nps400-timer1" <-- for clockevent
      
      Note that name convention for timer0/timer1 was taken from legacy
      ARC design. This design is our base before adding HW threads.
      For backward compatibility we keep "ezchip,nps400-timer" for clocksource
      Signed-off-by: NNoam Camus <noamca@mellanox.com>
      Acked-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Acked-by: NRob Herring <robh@kernel.org>
      60263dcd
    • N
      clocksource: update "fn" at CLOCKSOURCE_OF_DECLARE() of nps400 timer · 0465fb49
      Noam Camus 提交于
      nps_setup_clocksource() should take node as only argument as defined by
      typedef int (*of_init_fn_1_ret)(struct device_node *)
      
      Therefore need to replace:
      int __init nps_setup_clocksource(struct device_node *node, struct clk *clk)
      with
      int __init nps_setup_clocksource(struct device_node *node)
      
      This patch also serve as preparation for next patch which add support
      for clockevents to nps400.
      Specifically we add new function nps_get_timer_clk() to serve clocksource
      and later clockevent registration.
      Signed-off-by: NNoam Camus <noamca@mellanox.com>
      Acked-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      0465fb49
    • V
      clocksource: import ARC timer driver · c4c9a040
      Vineet Gupta 提交于
      This adds support for
      
       - CONFIG_ARC_TIMERS : legacy 32-bit TIMER0 and TIMER1 which count UP
         from @CNT to @LIMIT, before optionally triggering an interrupt.
         These are programmed using ARC auxiliary register interface.
         These are present in all ARC cores (ARC700 and ARC HS38)
         TIMER0 serves as clockevent for all ARC linux builds.
         TIMER1 is used for clocksource in arc700 builds.
      
       - CONFIG_ARC_TIMERS_64BIT: 64-bit counters, RTC and GFRC found in
         ARC HS38 cores. These are independnet IP blocks with different
         programming model respectively.
      
      Link: http://lkml.kernel.org/r/20161111231132.GA4186@maiAcked-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      c4c9a040
  5. 22 11月, 2016 1 次提交
  6. 21 11月, 2016 2 次提交
  7. 21 10月, 2016 2 次提交
    • C
      Revert "clocksource/drivers/timer_sun5i: Replace code by clocksource_mmio_init" · 59387683
      Chen-Yu Tsai 提交于
      struct clocksource is also used by the clk notifier callback, to
      unregister and re-register the clocksource with a different clock rate.
      clocksource_mmio_init does not pass back a pointer to the struct used,
      and the clk notifier callback assumes that the struct clocksource in
      struct sun5i_timer_clksrc is valid. This results in a kernel NULL
      pointer dereference when the hstimer clock is changed:
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000004
      [<c03a4678>] (clocksource_unbind) from [<c03a46d4>] (clocksource_unregister+0x2c/0x44)
      [<c03a46d4>] (clocksource_unregister) from [<c0a6f350>] (sun5i_rate_cb_clksrc+0x34/0x3c)
      [<c0a6f350>] (sun5i_rate_cb_clksrc) from [<c035ea50>] (notifier_call_chain+0x44/0x84)
      [<c035ea50>] (notifier_call_chain) from [<c035edc0>] (__srcu_notifier_call_chain+0x44/0x60)
      [<c035edc0>] (__srcu_notifier_call_chain) from [<c035edf4>] (srcu_notifier_call_chain+0x18/0x20)
      [<c035edf4>] (srcu_notifier_call_chain) from [<c0670174>] (__clk_notify+0x70/0x7c)
      [<c0670174>] (__clk_notify) from [<c06702c0>] (clk_propagate_rate_change+0xa4/0xc4)
      [<c06702c0>] (clk_propagate_rate_change) from [<c0670288>] (clk_propagate_rate_change+0x6c/0xc4)
      
      Revert the commit for now. clocksource_mmio_init can be made to pass back
      a pointer, but the code churn and usage of an inner struct might not be
      worth it.
      
      Fixes: 157dfade ("clocksource/drivers/timer_sun5i: Replace code by clocksource_mmio_init")
      Reported-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
      Signed-off-by: NChen-Yu Tsai <wens@csie.org>
      Cc: linux-sunxi@googlegroups.com
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/20161018054918.26855-1-wens@csie.orgSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      59387683
    • R
      clocksource: Add J-Core timer/clocksource driver · 9995f4f1
      Rich Felker 提交于
      At the hardware level, the J-Core PIT is integrated with the interrupt
      controller, but it is represented as its own device and has an
      independent programming interface. It provides a 12-bit countdown
      timer, which is not presently used, and a periodic timer. The interval
      length for the latter is programmable via a 32-bit throttle register
      whose units are determined by a bus-period register. The periodic
      timer is used to implement both periodic and oneshot clock event
      modes; in oneshot mode the interrupt handler simply disables the timer
      as soon as it fires.
      
      Despite its device tree node representing an interrupt for the PIT,
      the actual irq generated is programmable, not hard-wired. The driver
      is responsible for programming the PIT to generate the hardware irq
      number that the DT assigns to it.
      
      On SMP configurations, J-Core provides cpu-local instances of the PIT;
      no broadcast timer is needed. This driver supports the creation of the
      necessary per-cpu clock_event_device instances.
      
      A nanosecond-resolution clocksource is provided using the J-Core "RTC"
      registers, which give a 64-bit seconds count and 32-bit nanoseconds
      that wrap every second. The driver converts these to a full-range
      32-bit nanoseconds count.
      Signed-off-by: NRich Felker <dalias@libc.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: linux-sh@vger.kernel.org
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Link: http://lkml.kernel.org/r/b591ff12cc5ebf63d1edc98da26046f95a233814.1476393790.git.dalias@libc.orgSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      9995f4f1
  8. 18 10月, 2016 1 次提交
  9. 24 9月, 2016 2 次提交
  10. 22 9月, 2016 1 次提交
  11. 21 9月, 2016 2 次提交
  12. 16 9月, 2016 1 次提交
  13. 12 9月, 2016 6 次提交
  14. 09 9月, 2016 3 次提交
  15. 29 8月, 2016 1 次提交
  16. 26 8月, 2016 3 次提交
  17. 24 8月, 2016 1 次提交
  18. 17 8月, 2016 3 次提交
  19. 01 8月, 2016 1 次提交
    • M
      clocksource/arm_arch_timer: Force per-CPU interrupt to be level-triggered · f005bd7e
      Marc Zyngier 提交于
      The ARM architected timer produces level-triggered interrupts (this
      is mandated by the architecture). Unfortunately, a number of
      device-trees get this wrong, and expose an edge-triggered interrupt.
      
      Until now, this wasn't too much an issue, as the programming of the
      trigger would fail (the corresponding PPI cannot be reconfigured),
      and the kernel would be happy with this. But we're about to change
      this, and trust DT a lot if the driver doesn't provide its own
      trigger information. In that context, the timer breaks badly.
      
      While we do need to fix the DTs, there is also some userspace out
      there (kvmtool) that generates the same kind of broken DT on the
      fly, and that will completely break with newer kernels.
      
      As a safety measure, and to keep buggy software alive as well as
      buying us some time to fix DTs all over the place, let's check
      what trigger configuration has been given us by the firmware.
      If this is not a level configuration, then we know that the
      DT/ACPI configuration is bust, and we pick some defaults which
      won't be worse than the existing setup.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Liu Gang <Gang.Liu@nxp.com>
      Cc: Mark Rutland <marc.rutland@arm.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Wenbin Song <Wenbin.Song@freescale.com>
      Cc: Mingkai Hu <Mingkai.Hu@freescale.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: Jon Hunter <jonathanh@nvidia.com>
      Cc: arm@kernel.org
      Cc: bcm-kernel-feedback-list@broadcom.com
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Ray Jui <rjui@broadcom.com>
      Cc: "Hou Zhiqiang" <B48286@freescale.com>
      Cc: Tirumalesh Chalamarla <tchalamarla@cavium.com>
      Cc: linux-samsung-soc@vger.kernel.org
      Cc: Yuan Yao <yao.yuan@nxp.com>
      Cc: Jan Glauber <jglauber@cavium.com>
      Cc: Gregory Clement <gregory.clement@free-electrons.com>
      Cc: linux-amlogic@lists.infradead.org
      Cc: soren.brinkmann@xilinx.com
      Cc: Rajesh Bhagat <rajesh.bhagat@freescale.com>
      Cc: Scott Branden <sbranden@broadcom.com>
      Cc: Duc Dang <dhdang@apm.com>
      Cc: Kukjin Kim <kgene@kernel.org>
      Cc: Carlo Caione <carlo@caione.org>
      Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
      Link: http://lkml.kernel.org/r/1470045256-9032-2-git-send-email-marc.zyngier@arm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      f005bd7e
  20. 15 7月, 2016 2 次提交