]> git.baikalelectronics.ru Git - kernel.git/commit
pwm: fsl-ftm: Use flat regmap cache
authorStefan Agner <stefan@agner.ch>
Thu, 21 Jan 2016 02:56:22 +0000 (18:56 -0800)
committerThierry Reding <thierry.reding@gmail.com>
Thu, 14 Apr 2016 14:54:00 +0000 (16:54 +0200)
commite546c9fc6daf6c0a2d213f875ba06a3e26c00079
tree239ee3af6e3fc2543aba4c614401456be91a7b1a
parent3039f62d3fccb077513a4ffae4d1ef4609c1b724
pwm: fsl-ftm: Use flat regmap cache

Use flat regmap cache to avoid lockdep warning at probe:

[    0.697285] WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:2755 lockdep_trace_alloc+0x15c/0x160()
[    0.697449] DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))

The RB-tree regmap cache needs to allocate new space on first writes.
However, allocations in an atomic context (e.g. when a spinlock is held)
are not allowed. The function regmap_write calls map->lock, which
acquires a spinlock in the fast_io case. Since the pwm-fsl-ftm driver
uses MMIO, the regmap bus of type regmap_mmio is being used which has
fast_io set to true.

The MMIO space of the pwm-fsl-ftm driver is reasonable condense, hence
using the much faster flat regmap cache is anyway the better choice.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-fsl-ftm.c