1. 28 10月, 2015 1 次提交
    • M
      clocksource/drivers/sh_mtu2: Fix multiple shutdown call issue · fe326c5c
      Magnus Damm 提交于
      On the r7s72100 Genmai board the MTU2 driver currently triggers a common
      clock framework WARN_ON(enable_count) when disabling the clock due to
      the MTU2 driver after recent callback rework may call ->set_state_shutdown()
      multiple times. A similar issue was spotted for the TMU driver and fixed in:
      452b1324 clocksource/drivers/sh_tmu: Fix traceback spotted in -next
      
      On r7s72100 Genmai v4.3-rc7 built with shmobile_defconfig spits out the
      following during boot:
      
      sh_mtu2 fcff0000.timer: ch0: used for clock events
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:675 clk_core_disable+0x2c/0x6c()
      CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.3.0-rc7 #1
      Hardware name: Generic R7S72100 (Flattened Device Tree)
      Backtrace:
      [<c00133d4>] (dump_backtrace) from [<c0013570>] (show_stack+0x18/0x1c)
      [<c0013558>] (show_stack) from [<c01c7aac>] (dump_stack+0x74/0x90)
      [<c01c7a38>] (dump_stack) from [<c00272fc>] (warn_slowpath_common+0x88/0xb4)
      [<c0027274>] (warn_slowpath_common) from [<c0027400>] (warn_slowpath_null+0x24/0x2c)
      [<c00273dc>] (warn_slowpath_null) from [<c03a9320>] (clk_core_disable+0x2c/0x6c)
      [<c03a92f4>] (clk_core_disable) from [<c03aa0a0>] (clk_disable+0x40/0x4c)
      [<c03aa060>] (clk_disable) from [<c0395d2c>] (sh_mtu2_disable+0x24/0x50)
      [<c0395d08>] (sh_mtu2_disable) from [<c0395d6c>] (sh_mtu2_clock_event_shutdown+0x14/0x1c)
      [<c0395d58>] (sh_mtu2_clock_event_shutdown) from [<c007d7d0>] (clockevents_switch_state+0xc8/0x114)
      [<c007d708>] (clockevents_switch_state) from [<c007d834>] (clockevents_shutdown+0x18/0x28)
      [<c007d81c>] (clockevents_shutdown) from [<c007dd58>] (clockevents_exchange_device+0x70/0x78)
      [<c007dce8>] (clockevents_exchange_device) from [<c007e578>] (tick_check_new_device+0x88/0xe0)
      [<c007e4f0>] (tick_check_new_device) from [<c007daf0>] (clockevents_register_device+0xac/0x120)
      [<c007da44>] (clockevents_register_device) from [<c0395be8>] (sh_mtu2_probe+0x230/0x350)
      [<c03959b8>] (sh_mtu2_probe) from [<c028b6f0>] (platform_drv_probe+0x50/0x98)
      Reported-by: NChris Brandt <chris.brandt@renesas.com>
      Fixes: 19a9ffb3 ("clockevents/drivers/sh_mtu2: Migrate to new 'set-state' interface")
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
      Signed-off-by: NMagnus Damm <damm+renesas@opensource.se>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: NViresh Kumar <viresh.kumar@linaro.org>
      fe326c5c
  2. 27 10月, 2015 7 次提交
  3. 20 10月, 2015 1 次提交
  4. 16 10月, 2015 1 次提交
  5. 15 10月, 2015 7 次提交
  6. 29 9月, 2015 2 次提交
    • D
      clocksource/drivers/keystone: Fix bad NO_IRQ usage · bdf7344e
      Daniel Lezcano 提交于
      The current code assumes the 'irq_of_parse_and_map' will return NO_IRQ in case
      of failure. Unfortunately, the NO_IRQ is not consistent across the different
      architectures and we must not rely on it.
      
      NO_IRQ is equal to '-1' on ARM and 'irq_of_parse_and_map' returns '0' in case
      of an error. Hence, the latter won't be detected and will lead to a crash.
      
      Fix this by just checking 'irq' is different from zero.
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      bdf7344e
    • D
      clocksource/drivers/rockchip: Fix bad NO_IRQ usage · ccc42592
      Daniel Lezcano 提交于
      The current code assumes the 'irq_of_parse_and_map' will return NO_IRQ in case
      of failure. Unfortunately, the NO_IRQ is not consistent across the different
      architectures and we must not rely on it.
      
      NO_IRQ is equal to '-1' on ARM and 'irq_of_parse_and_map' returns '0' in case
      of an error. Hence, the latter won't be detected and will lead to a crash.
      
      Fix this by just checking 'irq' is different from zero.
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      ccc42592
  7. 23 9月, 2015 2 次提交
  8. 03 9月, 2015 5 次提交
  9. 20 8月, 2015 1 次提交
  10. 10 8月, 2015 13 次提交
    • V
      clockevents/drivers/h8300_timer8: Migrate to new 'set-state' interface · fc2b2f5d
      Viresh Kumar 提交于
      Migrate h8300_timer8 driver to the new 'set-state' interface provided by
      clockevents core, the earlier 'set-mode' interface is marked obsolete
      now.
      
      This also enables us to implement callbacks for new states of clockevent
      devices, for example: ONESHOT_STOPPED.
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      fc2b2f5d
    • V
      clocksource/drivers/sh_tmu: Fix traceback spotted in -next · 452b1324
      Viresh Kumar 提交于
      Traceback in -next due to commit 'clockevents/drivers/sh_tmu: Migrate to new
      'set-state' interface'.
      
      Commit ("clockevents/drivers/sh_tmu: Migrate to new 'set-state' interface")
      in -next causes the following traceback. This is seen with qemu runs for the sh
      target.
      
      ------------[ cut here ]------------
      WARNING: at drivers/clocksource/sh_tmu.c:202
      Modules linked in:
      
      CPU: 0 PID: 0 Comm: swapper Not tainted 4.2.0-rc3-next-20150720 #1
      task: 8c411ed8 ti: 8c40e000 task.ti: 8c40e000
      PC is at sh_tmu_disable+0x40/0x60
      PR is at sh_tmu_clock_event_shutdown+0x8/0x20
      PC  : 8c271220 SP  : 8c40ff10 SR  : 400081f1 TEA : 00000000
      R0  : 8c271240 R1  : 8fc08cfc R2  : 00000000 R3  : 3fffffff
      R4  : 8fc08c00 R5  : 00000001 R6  : 00000002 R7  : ffffffff
      R8  : 00000001 R9  : 8fc08c20 R10 : 00000000 R11 : 00000000
      R12 : 8c012820 R13 : 00000000 R14 : 00000000
      MACH: 3b9ac9ff MACL: 80000000 GBR : 00000000 PR  : 8c271248
      
      Call trace:
       [<8c065836>] clockevents_switch_state+0x16/0x60
       [<8c06588c>] clockevents_shutdown+0xc/0x40
       [<8c066330>] tick_check_new_device+0x90/0xc0
       [<8c065556>] clockevents_register_device+0x56/0x120
       [<8c0662a0>] tick_check_new_device+0x0/0xc0
       [<8c27167a>] sh_tmu_probe+0x29a/0x4e0
       [<8c18a994>] kasprintf+0x14/0x20
       [<8c442782>] early_platform_driver_probe+0x20e/0x2bc
       [<8c1fade0>] platform_match+0x0/0x100
       [<8c33babc>] printk+0x0/0x24
       [<8c434892>] start_kernel+0x32e/0x574
       [<8c33babc>] printk+0x0/0x24
       [<8c17d320>] strlen+0x0/0x58
       [<8c43430c>] unknown_bootoption+0x0/0x1e0
       [<8c011024>] _stext+0x24/0x30
      
      ---[ end trace cb88537fdc8fa200 ]---
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Tested-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      452b1324
    • D
    • V
      clockevents/drivers/timer-sp804: Migrate to new 'set-state' interface · daea7283
      Viresh Kumar 提交于
      Migrate timer-sp driver to the new 'set-state' interface provided by
      clockevents core, the earlier 'set-mode' interface is marked obsolete
      now.
      
      This also enables us to implement callbacks for new states of clockevent
      devices, for example: ONESHOT_STOPPED.
      
      There are few more changes worth noticing:
      
      - The clockevent device was disabled by writing: 'TIMER_CTRL_32BIT |
        TIMER_CTRL_IE' to ctrl register earlier. i.e. by un-setting the
        TIMER_CTRL_ENABLE bit. Its done by writing zero now and should have
        the same effect.
      
      - For shutdown and resume we were writing the same value twice to the
        register (to disable the timer), which is fixed now.
      
      - Switching to oneshot mode was divided into two parts earlier:
        - Firstly set_mode() was writing:
          'TIMER_CTRL_32BIT | TIMER_CTRL_IE | TIMER_CTRL_ONESHOT'
          to ctrl register (device not enabled yet)
        - Then sp804_set_next_event() was enabling the device by writing
          'readl(ctrl) | TIMER_CTRL_ENABLE' to the ctrl register. This was
          unnecessarily complicated.
        - Change this to: Stop device on set_state_oneshot and configure it in
          sp804_set_next_event().
      
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Olof Johansson <olof@lixom.net>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      daea7283
    • V
      clockevents/drivers/timer-imx-gpt: Migrate to new 'set-state' interface · 26b91f04
      Viresh Kumar 提交于
      Migrate timer-imx-gpt driver to the new 'set-state' interface provided
      by clockevents core, the earlier 'set-mode' interface is marked obsolete
      now.
      
      This also enables us to implement callbacks for new states of clockevent
      devices, for example: ONESHOT_STOPPED.
      
      Also drop:
      - 'imx_timer.cem': It was caching the last state of the clockevent
        device. The same behavior can be achieved by using clockevents state
        helpers. These helpers are only required for oneshot mode as
        shutdown/resume wouldn't be done twice by the core.
      
      - 'clock_event_mode_label': CLOCK_EVT_MODE_* shouldn't be used anymore
        by drivers. The prints are modified to print the set-state functions
        name now to debug the driver.
      
      Cc: Shawn Guo <shawn.guo@linaro.org>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      26b91f04
    • G
      clockevents/drivers/sh_cmt: Remove obsolete sh-cmt-48 platform_device_id entry · 8c436f84
      Geert Uytterhoeven 提交于
      Since the removal of the r8a7740 legacy SoC code in commit
      44d88c75 ("ARM: shmobile: Remove legacy SoC code for R-Mobile
      A1"), all former users of the "sh-cmt-48-gen2" platform device name are
      only supported in generic DT-only ARM multi-platform builds.  The driver
      doesn't need to match platform devices by name anymore, hence remove the
      corresponding platform_device_id entry.
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Acked-by: NSimon Horman <horms+renesas@verge.net.au>
      8c436f84
    • J
      clockevents/drivers/dw_apb_timer: Add dynamic irq flag to the timer · 8b5f0010
      Jisheng Zhang 提交于
      Commit d2348fb6 ("tick: Dynamically set broadcast irq affinity")
      adds one excellent feature CLOCK_EVT_FEAT_DYNIRQ to let the core set the
      interrupt affinity of the broadcast interrupt to the cpu which has the
      earliest expiry time. This patch adds CLOCK_EVT_FEAT_DYNIRQ flag to
      avoid unnecessary wakeups and IPIs when the dw_apb_timer is used as
      broadcast timer.
      
      A simple test:
      ~ # rm /tmp/test.sh
      ~ # cat > /tmp/test.sh
      cat /proc/interrupts
      for i in `seq 10` ; do sleep $i; done
      cat /proc/interrupts
      ~ # chmod +x /tmp/test.sh
      ~ # taskset 0x2 /tmp/test.sh
      
      without the patch:
      
                 CPU0       CPU1
       27:        115         36       GIC  27  arch_timer
       45:         62          0       GIC  45  mmc0
      160:         88          0  interrupt-controller   8  timer
      227:          0          0  interrupt-controller   4  f7e81400.i2c
      228:          0          0  interrupt-controller   5  f7e81800.i2c
      229:          0          0  interrupt-controller   7  dw_spi65535
      230:          0          0  interrupt-controller  21  f7e84000.i2c
      231:          0          0  interrupt-controller  20  f7e84800.i2c
      265:        445          0  interrupt-controller   8  serial
      IPI0:          0          0  CPU wakeup interrupts
      IPI1:          0         11  Timer broadcast interrupts
      IPI2:         56        104  Rescheduling interrupts
      IPI3:          0          0  Function call interrupts
      IPI4:          0          4  Single function call interrupts
      IPI5:          0          0  CPU stop interrupts
      IPI6:         25         27  IRQ work interrupts
      IPI7:          0          0  completion interrupts
      IPI8:          0          0  CPU backtrace
      Err:          0
                 CPU0       CPU1
       27:        115         38       GIC  27  arch_timer
       45:         62          0       GIC  45  mmc0
      160:        160          0  interrupt-controller   8  timer
      227:          0          0  interrupt-controller   4  f7e81400.i2c
      228:          0          0  interrupt-controller   5  f7e81800.i2c
      229:          0          0  interrupt-controller   7  dw_spi65535
      230:          0          0  interrupt-controller  21  f7e84000.i2c
      231:          0          0  interrupt-controller  20  f7e84800.i2c
      265:        514          0  interrupt-controller   8  serial
      IPI0:          0          0  CPU wakeup interrupts
      IPI1:          0         83  Timer broadcast interrupts
      IPI2:         56        104  Rescheduling interrupts
      IPI3:          0          0  Function call interrupts
      IPI4:          0          4  Single function call interrupts
      IPI5:          0          0  CPU stop interrupts
      IPI6:         25         46  IRQ work interrupts
      IPI7:          0          0  completion interrupts
      IPI8:          0          0  CPU backtrace
      Err:          0
      
      cpu0 get 160-88=72 timer interrupts, CPU1 got 83-11=72 broadcast timer
      IPIs
      So, overall system got 72+72=144 wake ups and 72 broadcast timer IPIs
      
      With the patch:
                 CPU0       CPU1
       27:        107         37       GIC  27  arch_timer
       45:         62          0       GIC  45  mmc0
      160:         66          7  interrupt-controller   8  timer
      227:          0          0  interrupt-controller   4  f7e81400.i2c
      228:          0          0  interrupt-controller   5  f7e81800.i2c
      229:          0          0  interrupt-controller   7  dw_spi65535
      230:          0          0  interrupt-controller  21  f7e84000.i2c
      231:          0          0  interrupt-controller  20  f7e84800.i2c
      265:        311          0  interrupt-controller   8  serial
      IPI0:          0          0  CPU wakeup interrupts
      IPI1:          2          4  Timer broadcast interrupts
      IPI2:         58        100  Rescheduling interrupts
      IPI3:          0          0  Function call interrupts
      IPI4:          0          4  Single function call interrupts
      IPI5:          0          0  CPU stop interrupts
      IPI6:         21         24  IRQ work interrupts
      IPI7:          0          0  completion interrupts
      IPI8:          0          0  CPU backtrace
      Err:          0
                 CPU0       CPU1
       27:        107         39       GIC  27  arch_timer
       45:         62          0       GIC  45  mmc0
      160:         69         75  interrupt-controller   8  timer
      227:          0          0  interrupt-controller   4  f7e81400.i2c
      228:          0          0  interrupt-controller   5  f7e81800.i2c
      229:          0          0  interrupt-controller   7  dw_spi65535
      230:          0          0  interrupt-controller  21  f7e84000.i2c
      231:          0          0  interrupt-controller  20  f7e84800.i2c
      265:        380          0  interrupt-controller   8  serial
      IPI0:          0          0  CPU wakeup interrupts
      IPI1:          3          6  Timer broadcast interrupts
      IPI2:         60        100  Rescheduling interrupts
      IPI3:          0          0  Function call interrupts
      IPI4:          0          4  Single function call interrupts
      IPI5:          0          0  CPU stop interrupts
      IPI6:         21         45  IRQ work interrupts
      IPI7:          0          0  completion interrupts
      IPI8:          0          0  CPU backtrace
      Err:          0
      
      cpu0 got 69-66=3, cpu1 got 75-7=68 timer interrupts. cpu0 got 3-2=1
      broadcast timer IPIs, cpu1 got 6-4=2 broadcast timer IPIs.
      So, overall system got 3+68+1+2=74 wakeups and 1+2=3 broadcast timer
      IPIs
      
      This patch removes 50% wakeups and almost 100% broadcast timer IPIs!
      Signed-off-by: NJisheng Zhang <jszhang@marvell.com>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      8b5f0010
    • V
      clockevents/drivers/exynos_mct: Migrate to new 'set-state' interface · 79e436d3
      Viresh Kumar 提交于
      Migrate exynos_mct driver to the new 'set-state' interface provided by
      clockevents core, the earlier 'set-mode' interface is marked obsolete
      now.
      
      This also enables us to implement callbacks for new states of clockevent
      devices, for example: ONESHOT_STOPPED.
      
      Cc: Kukjin Kim <kgene.kim@samsung.com>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      79e436d3
    • V
      clockevents/drivers/tcb_clksrc: Migrate to new 'set-state' interface · cf4541c1
      Viresh Kumar 提交于
      Migrate tcb_clksrc driver to the new 'set-state' interface provided by
      clockevents core, the earlier 'set-mode' interface is marked obsolete
      now.
      
      This also enables us to implement callbacks for new states of clockevent
      devices, for example: ONESHOT_STOPPED.
      
      Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      cf4541c1
    • V
      clockevents/drivers/zevio: Migrate to new 'set-state' interface · f0753793
      Viresh Kumar 提交于
      Migrate zevio driver to the new 'set-state' interface provided by
      clockevents core, the earlier 'set-mode' interface is marked obsolete
      now.
      
      This also enables us to implement callbacks for new states of clockevent
      devices, for example: ONESHOT_STOPPED.
      
      Cc: Daniel Tang <dt.tangr@gmail.com>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      f0753793
    • V
      clockevents/drivers/vt8500: Migrate to new 'set-state' interface · 214bc755
      Viresh Kumar 提交于
      Migrate vt8500 driver to the new 'set-state' interface provided by
      clockevents core, the earlier 'set-mode' interface is marked obsolete
      now.
      
      This also enables us to implement callbacks for new states of clockevent
      devices, for example: ONESHOT_STOPPED.
      
      Cc: Tony Prisk <linux@prisktech.co.nz>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      214bc755
    • V
      clockevents/drivers/vf_pit: Migrate to new 'set-state' interface · 9552a6af
      Viresh Kumar 提交于
      Migrate vf_pit driver to the new 'set-state' interface provided by
      clockevents core, the earlier 'set-mode' interface is marked obsolete
      now.
      
      This also enables us to implement callbacks for new states of clockevent
      devices, for example: ONESHOT_STOPPED.
      
      Cc: Jingchang Lu <b35083@freescale.com>
      Cc: Stefan Agner <stefan@agner.ch>
      Cc: Shawn Guo <shawn.guo@linaro.org>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Acked-by: NStefan Agner <stefan@agner.ch>
      9552a6af
    • V
      clockevents/drivers/u300: Migrate to new 'set-state' interface · 8ff8fc13
      Viresh Kumar 提交于
      Migrate u300 driver to the new 'set-state' interface provided by
      clockevents core, the earlier 'set-mode' interface is marked obsolete
      now.
      
      This also enables us to implement callbacks for new states of clockevent
      devices, for example: ONESHOT_STOPPED.
      
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      8ff8fc13