Since iocg_lock() and iocg_unlock() both use conditional locking, annotate both with __no_context_analysis and use token_context_lock() to introduce a new lock context. Signed-off-by: Bart Van Assche --- block/blk-iocost.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 353c165c5cd4..3bb8ce50af42 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -727,7 +727,11 @@ static void iocg_commit_bio(struct ioc_gq *iocg, struct bio *bio, put_cpu_ptr(gcs); } +token_context_lock(ioc_lock); + static void iocg_lock(struct ioc_gq *iocg, bool lock_ioc, unsigned long *flags) + __acquires(ioc_lock) + __context_unsafe(conditional locking) { if (lock_ioc) { spin_lock_irqsave(&iocg->ioc->lock, *flags); @@ -738,6 +742,8 @@ static void iocg_lock(struct ioc_gq *iocg, bool lock_ioc, unsigned long *flags) } static void iocg_unlock(struct ioc_gq *iocg, bool unlock_ioc, unsigned long *flags) + __releases(ioc_lock) + __context_unsafe(conditional locking) { if (unlock_ioc) { spin_unlock(&iocg->waitq.lock);