lkml.org 
[lkml]   [2015]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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.
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2015-07-16 21:21    [W:4.367 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site