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


Groups > linux.kernel > #1309776

Re: Lockdep warning when using REGCACHE_RBTREE

From Mark Brown <broonie@kernel.org>
Newsgroups linux.kernel
Subject Re: Lockdep warning when using REGCACHE_RBTREE
Date 2016-01-15 01:10 +0100
Message-ID <qR07M-6ou-9@gated-at.bofh.it> (permalink)
References <qQYIG-5f6-19@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, Jan 14, 2016 at 02:30:50PM -0800, Stefan Agner wrote:

> I currently work on the DCU DRM driver (drivers/gpu/drm/fsl-dcu/) on a
> Linux 4.4 kernel. With CONFIG_LOCKDEP enabled I get the following
> warning on startup:

Please don't paste entire stack dumps into e-mail, they're completely
unedifying and obscure the actual content in your e-mail.  Edit down
relevant pieces of information.

> [    1.327284] ------------[ cut here ]------------
> [    1.332010] WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:2755
> lockdep_trace_alloc+0x120/0x124()
> [    1.341358] DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))

> I do use REGCACHE_RBTREE along with regmap_write from within the probe
> code path of the driver. This ultimately leads to an allocation.
> However, what I don't understand is why the allocation is leading to
> that error. The actual allocation happens in regcache_rbtree_node_alloc
> and seems to be a rather common kzalloc with GFP_KERNEL...

> The comment in __lockdep_trace_alloc says:
> "Oi! Can't be having __GFP_FS allocations with IRQs disabled.".

That appears to match with the warning printed.  Either this is a false
positive from lockdep or you are actually trying to cache a new register
in atomic context which is not and has never been supported, are any of
the functions in the backtrace taking relevant locks?

> Not sure if this is a Linux 4.4 issue, Fabio Estevam reported a similar
> issue just recently, not sure if that is related:
> https://lkml.org/lkml/2016/1/11/284

Nothing has changed here in lockdep, doing allocations in atomic context
has never been supported.

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


Thread

Lockdep warning when using REGCACHE_RBTREE Stefan Agner <stefan@agner.ch> - 2016-01-14 23:40 +0100
  Re: Lockdep warning when using REGCACHE_RBTREE Mark Brown <broonie@kernel.org> - 2016-01-15 01:10 +0100
    Re: Lockdep warning when using REGCACHE_RBTREE Stefan Agner <stefan@agner.ch> - 2016-01-15 02:20 +0100
      Re: Lockdep warning when using REGCACHE_RBTREE Mark Brown <broonie@kernel.org> - 2016-01-15 17:30 +0100
        Re: Lockdep warning when using REGCACHE_RBTREE Stefan Agner <stefan@agner.ch> - 2016-01-15 20:20 +0100
  Re: Lockdep warning when using REGCACHE_RBTREE Peter Zijlstra <peterz@infradead.org> - 2016-01-15 10:50 +0100
    Re: Lockdep warning when using REGCACHE_RBTREE Mark Brown <broonie@kernel.org> - 2016-01-15 13:00 +0100

csiph-web