Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dma-buf/sw-sync: don't enable IRQ from sync_print_obj()

Since commit a6aa8fca4d79 ("dma-buf/sw-sync: Reduce irqsave/irqrestore from
known context") by error replaced spin_unlock_irqrestore() with
spin_unlock_irq() for both sync_debugfs_show() and sync_print_obj() despite
sync_print_obj() is called from sync_debugfs_show(), lockdep complains
inconsistent lock state warning.

Use plain spin_{lock,unlock}() for sync_print_obj(), for
sync_debugfs_show() is already using spin_{lock,unlock}_irq().

Reported-by: syzbot <syzbot+a225ee3df7e7f9372dbe@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=a225ee3df7e7f9372dbe
Fixes: a6aa8fca4d79 ("dma-buf/sw-sync: Reduce irqsave/irqrestore from known context")
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/c2e46020-aaa6-4e06-bf73-f05823f913f0@I-love.SAKURA.ne.jp
Signed-off-by: Christian König <christian.koenig@amd.com>

authored by

Tetsuo Handa and committed by
Christian König
b7949189 39bc27bd

+2 -2
+2 -2
drivers/dma-buf/sync_debug.c
··· 110 110 111 111 seq_printf(s, "%s: %d\n", obj->name, obj->value); 112 112 113 - spin_lock_irq(&obj->lock); 113 + spin_lock(&obj->lock); /* Caller already disabled IRQ. */ 114 114 list_for_each(pos, &obj->pt_list) { 115 115 struct sync_pt *pt = container_of(pos, struct sync_pt, link); 116 116 sync_print_fence(s, &pt->base, false); 117 117 } 118 - spin_unlock_irq(&obj->lock); 118 + spin_unlock(&obj->lock); 119 119 } 120 120 121 121 static void sync_print_sync_file(struct seq_file *s,