On Thu, Jul 16, 2015 at 05:48:52PM +0200, Alexander Stein wrote:

> When regmap locking is done using spinlocks (e.g. using
> devm_regmap_init_mmio_clk) access is protected using spin_lock_irqsave.
> So when calling regmap_write the first time and a node is about to be
> inserted kzalloc must not be called with GFP_KERNEL. At this point

The expectation here is that we should either be using no or a flat
cache here or (if we're using rbtree) providing register defaults to
ensure that we never do allocations in the spinlock.  The rbtree code is
written on the assumption that we only have to be faster than reading
from a serial bus so I'd be worried about it not behaving at all nicely
in a spinlock even ignoring this issue.

Why are you using a dynamically allocated rbtree for a device like this?

> interrupts are disabled. This fixes the following warning:
> [    8.605433] WARNING: CPU: 0 PID: 130 at kernel/lockdep.c:2740 
> lockdep_trace_alloc+0x124/0x128()
> [    8.614096] DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))

Please don't paste entire backtraces into commit messages, they're
enormous and don't add any value.  If you feel a backtrace is useful
edit down the relevant context.

Attachment: signature.asc
Description: Digital signature

Reply via email to