[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150716190657.GA11162@sirena.org.uk>
Date: Thu, 16 Jul 2015 20:06:57 +0100
From: Mark Brown <broonie@...nel.org>
To: Alexander Stein <alexander.stein@...tec-electronic.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] regmap: regcache-rbtree: Use GFP_ATOMIC when using
spinlocks
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.
Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)
Powered by blists - more mailing lists