Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1186194

Re: [PATCH 1/1] regmap: regcache-rbtree: Use GFP_ATOMIC when using spinlocks

From Mark Brown <broonie@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1] regmap: regcache-rbtree: Use GFP_ATOMIC when using spinlocks
Date 2015-07-16 21:10 +0200
Message-ID <pMWHE-7fR-9@gated-at.bofh.it> (permalink)
References <pMTA6-2Br-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/1] regmap: regcache-rbtree: Use GFP_ATOMIC when using spinlocks Alexander Stein <alexander.stein@systec-electronic.com> - 2015-07-16 17:50 +0200
  Re: [PATCH 1/1] regmap: regcache-rbtree: Use GFP_ATOMIC when using  spinlocks Mark Brown <broonie@kernel.org> - 2015-07-16 21:10 +0200
    Re: [PATCH 1/1] regmap: regcache-rbtree: Use GFP_ATOMIC when using  spinlocks Mark Brown <broonie@kernel.org> - 2015-07-20 19:30 +0200
      Re: [PATCH 1/1] regmap: regcache-rbtree: Use GFP_ATOMIC when using spinlocks Alexander Stein <alexander.stein@systec-electronic.com> - 2015-07-21 08:20 +0200

csiph-web