#include #include #include #include struct once_work { struct work_struct work; struct static_key *key; }; static void once_deferred(struct work_struct *w) { struct once_work *work; work = container_of(w, struct once_work, work); BUG_ON(!static_key_enabled(work->key)); static_key_slow_dec(work->key); kfree(work); } static void once_disable_jump(struct static_key *key) { struct once_work *w; w = kmalloc(sizeof(*w), GFP_ATOMIC); if (!w) return; INIT_WORK(&w->work, once_deferred); w->key = key; schedule_work(&w->work); } static DEFINE_SPINLOCK(once_lock); bool __do_once_start(bool *done, unsigned long *flags) __acquires(once_lock) { spin_lock_irqsave(&once_lock, *flags); if (*done) { spin_unlock_irqrestore(&once_lock, *flags); /* Keep sparse happy by restoring an even lock count on * this lock. In case we return here, we don't call into * __do_once_done but return early in the DO_ONCE() macro. */ __acquire(once_lock); return false; } return true; } EXPORT_SYMBOL(__do_once_start); void __do_once_done(bool *done, struct static_key *once_key, unsigned long *flags) __releases(once_lock) { *done = true; spin_unlock_irqrestore(&once_lock, *flags); once_disable_jump(once_key); } EXPORT_SYMBOL(__do_once_done); loop-back net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'include/dt-bindings/power')
/clock/imx27-clock.h?id=424414947da3dd5cb0d60e4f299f7c51e472ae77'>424414947da3dd5cb0d60e4f299f7c51e472ae77 (patch)
treea4067480c4256c80ae8f8438a3e4bb88e32050bc /include/dt-bindings/clock/imx27-clock.h
parenta3683e0c1410c5c8136a7a93b0336ce88d3b893a (diff)
parentd07830db1bdb254e4b50d366010b219286b8c937 (diff)
Merge tag 'usb-serial-4.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus
Johan writes: USB-serial fixes for v4.10-rc7 One more device ID for pl2303. Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'include/dt-bindings/clock/imx27-clock.h')