1. 18 Feb, 2015 1 commit
    • Viresh Kumar's avatar
      clockevents: Introduce mode specific callbacks · bd624d75
      Viresh Kumar authored
      It is not possible for the clockevents core to know which modes (other than
      those with a corresponding feature flag) are supported by a particular
      implementation. And drivers are expected to handle transition to all modes
      elegantly, as ->set_mode() would be issued for them unconditionally.
      
      Now, adding support for a new mode complicates things a bit if we want to use
      the legacy ->set_mode() callback. We need to closely review all clockevents
      drivers to see if they would break on addition of a new mode. And after such
      reviews, it is found that we have to do non-trivial changes to most of the
      drivers [1].
      
      Introduce mode-specific set_mode_*() callbacks, some of which the drivers may or
      may not implement. A missing callback would clearly convey the message that the
      corresponding mode isn't supported.
      
      A driver may still choose to keep supporting the legacy ->set_mode() callback,
      but ->set_mode() wouldn't be supporting any new modes beyond RESUME. If a driver
      wants to benefit from using a new mode, it would be required to migrate to
      the mode specific callbacks.
      
      The legacy ->set_mode() callback and the newly introduced mode-specific
      callbacks are mutually exclusive. Only one of them should be supported by the
      driver.
      
      Sanity check is done at the time of registration to distinguish between optional
      and required callbacks and to make error recovery and handling simpler. If the
      legacy ->set_mode() callback is provided, all mode specific ones would be
      ignored by the core but a warning is thrown if they are present.
      
      Call sites calling ->set_mode() directly are also updated to use
      __clockevents_set_mode() instead, as ->set_mode() may not be available anymore
      for few drivers.
      
       [1] https://lkml.org/lkml/2014/12/9/605
       [2] https://lkml.org/lkml/2015/1/23/255
      
      Suggested-by: Thomas Gleixner <tglx@linutronix.de> [2]
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Kevin Hilman <khilman@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
      Cc: linaro-kernel@lists.linaro.org
      Cc: linaro-networking@linaro.org
      Link: http://lkml.kernel.org/r/792d59a40423f0acffc9bb0bec9de1341a06fa02.1423788565.git.viresh.kumar@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      bd624d75
  2. 09 Feb, 2015 1 commit
  3. 29 Jan, 2015 8 commits
  4. 25 Jan, 2015 1 commit
  5. 24 Jan, 2015 10 commits
  6. 23 Jan, 2015 2 commits
    • Thomas Gleixner's avatar
      hrtimer: Prevent stale expiry time in hrtimer_interrupt() · 9bc74919
      Thomas Gleixner authored
      hrtimer_interrupt() has the following subtle issue:
      
      hrtimer_interrupt()
        lock(cpu_base);
        expires_next = KTIME_MAX;
      
        expire_timers(CLOCK_MONOTONIC);
        expires = get_next_timer(CLOCK_MONOTONIC);
        if (expires < expires_next)
          expires_next = expires;
      
        expire_timers(CLOCK_REALTIME);
          unlock(cpu_base);
          wakeup()
          hrtimer_start(CLOCK_MONOTONIC, newtimer);
          lock(cpu_base();  
        expires = get_next_timer(CLOCK_REALTIME);
        if (expires < expires_next)
          expires_next = expires;
      
      So because we already evaluated the next expiring timer of
      CLOCK_MONOTONIC we ignore that the expiry time of newtimer might be
      earlier than the overall next expiry time in hrtimer_interrupt().
      
      To solve this, remove the caching of the next expiry value from
      hrtimer_interrupt() and reevaluate all active clock bases for the next
      expiry value. To avoid another code duplication, create a shared
      evaluation function and use it for hrtimer_get_next_event(),
      hrtimer_force_reprogram() and hrtimer_interrupt().
      
      There is another subtlety in this mechanism:
      
      While hrtimer_interrupt() is running, we want to avoid to touch the
      hardware device because we will reprogram it anyway at the end of
      hrtimer_interrupt(). This works nicely for hrtimers which get rearmed
      via the HRTIMER_RESTART mechanism, because we drop out when the
      callback on that CPU is running. But that fails, if a new timer gets
      enqueued like in the example above.
      
      This has another implication: While hrtimer_interrupt() is running we
      refuse remote enqueueing of timers - see hrtimer_interrupt() and
      hrtimer_check_target().
      
      hrtimer_interrupt() tries to prevent this by setting cpu_base->expires
      to KTIME_MAX, but that fails if a new timer gets queued.
      
      Prevent both the hardware access and the remote enqueue
      explicitely. We can loosen the restriction on the remote enqueue now
      due to reevaluation of the next expiry value, but that needs a
      seperate patch.
      
      Folded in a fix from Vignesh Radhakrishnan.
      Reported-and-tested-by: default avatarStanislav Fomichev <stfomichev@yandex-team.ru>
      Based-on-patch-by: default avatarStanislav Fomichev <stfomichev@yandex-team.ru>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: vigneshr@codeaurora.org
      Cc: john.stultz@linaro.org
      Cc: viresh.kumar@linaro.org
      Cc: fweisbec@gmail.com
      Cc: cl@linux.com
      Cc: stuart.w.hayes@gmail.com
      Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1501202049190.5526@nanosSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      9bc74919
    • Chunyan Zhang's avatar
      ktime.h: Introduce ktime_ms_delta · 41fbf3b3
      Chunyan Zhang authored
      This patch adds a reusable time difference function which returns the
      difference in millisecond, as often used in some driver code, e.g.
      mtd/test, media/rc, etc.
      Signed-off-by: default avatarChunyan Zhang <zhang.chunyan@linaro.org>
      Acked-by: default avatarArnd Bergmann <arnd@linaro.org>
      Cc: zhang.lyra@gmail.com
      Cc: davem@davemloft.net
      Cc: john.stultz@linaro.org
      Cc: dborkman@redhat.com
      Link: http://lkml.kernel.org/r/1418793095-18780-1-git-send-email-zhang.chunyan@linaro.orgSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      41fbf3b3
  7. 18 Jan, 2015 4 commits
    • Linus Torvalds's avatar
      Linux 3.19-rc5 · ec6f34e5
      Linus Torvalds authored
      ec6f34e5
    • Linus Torvalds's avatar
      Merge tag 'armsoc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · d0ac5d8e
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "We've been sitting on our fixes branch for a while, so this batch is
        unfortunately on the large side.
      
        A lot of these are tweaks and fixes to device trees, fixing various
        bugs around clocks, reg ranges, etc.  There's also a few defconfig
        updates (which are on the late side, no more of those).
      
        All in all the diffstat is bigger than ideal at this time, but nothing
        in here seems particularly risky"
      
      * tag 'armsoc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (31 commits)
        reset: sunxi: fix spinlock initialization
        ARM: dts: disable CCI on exynos5420 based arndale-octa
        drivers: bus: check cci device tree node status
        ARM: rockchip: disable jtag/sdmmc autoswitching on rk3288
        ARM: nomadik: fix up leftover device tree pins
        ARM: at91: board-dt-sama5: add phy_fixup to override NAND_Tree
        ARM: at91/dt: sam9263: Add missing clocks to lcdc node
        ARM: at91: sama5d3: dt: correct the sound route
        ARM: at91/dt: sama5d4: fix the timer reg length
        ARM: exynos_defconfig: Enable LM90 driver
        ARM: exynos_defconfig: Enable options for display panel support
        arm: dts: Use pmu_system_controller phandle for dp phy
        ARM: shmobile: sh73a0 legacy: Set .control_parent for all irqpin instances
        ARM: dts: berlin: correct BG2Q's SM GPIO location.
        ARM: dts: berlin: add broken-cd and set bus width for eMMC in Marvell DMP DT
        ARM: dts: berlin: fix io clk and add missing core clk for BG2Q sdhci2 host
        ARM: dts: Revert disabling of smc91x for n900
        ARM: dts: imx51-babbage: Fix ULPI PHY reset modelling
        ARM: dts: dra7-evm: fix qspi device tree partition size
        ARM: omap2plus_defconfig: use CONFIG_CPUFREQ_DT
        ...
      d0ac5d8e
    • Linus Torvalds's avatar
      Merge tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mike.turquette/linux · 12ba8571
      Linus Torvalds authored
      Pull clock driver fixes from Mike Turquette:
       "Small number of fixes for clock drivers and a single null pointer
        dereference fix in the framework core code.
      
        The driver fixes vary from fixing section mismatch warnings to
        preventing machines from hanging (and preventing developers from
        crying)"
      
      * tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mike.turquette/linux:
        clk: fix possible null pointer dereference
        Revert "clk: ppc-corenet: Fix Section mismatch warning"
        clk: rockchip: fix deadlock possibility in cpuclk
        clk: berlin: bg2q: remove non-exist "smemc" gate clock
        clk: at91: keep slow clk enabled to prevent system hang
        clk: rockchip: fix rk3288 cpuclk core dividers
        clk: rockchip: fix rk3066 pll lock bit location
        clk: rockchip: Fix clock gate for rk3188 hclk_emem_peri
        clk: rockchip: add CLK_IGNORE_UNUSED flag to fix rk3066/rk3188 USB Host
      12ba8571
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 901b2082
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "This is one fix for a Multiqueue sleeping in invalid context problem
        and a MAINTAINER file update for Qlogic"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: ->queue_rq can't sleep
        MAINTAINERS: Update maintainer list for qla4xxx
      901b2082
  8. 17 Jan, 2015 13 commits