Skip to content

Commit ad06fde

Browse files
agnersthierryreding
authored andcommitted
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>
1 parent f55532a commit ad06fde

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pwm/pwm-fsl-ftm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ static const struct regmap_config fsl_pwm_regmap_config = {
392392

393393
.max_register = FTM_PWMLOAD,
394394
.volatile_reg = fsl_pwm_volatile_reg,
395-
.cache_type = REGCACHE_RBTREE,
395+
.cache_type = REGCACHE_FLAT,
396396
};
397397

398398
static int fsl_pwm_probe(struct platform_device *pdev)

0 commit comments

Comments
 (0)