• Takashi Iwai's avatar
    ALSA: ctl: Workaround for lockdep warning wrt card->ctl_files_rwlock · 6564d0ad
    Takashi Iwai authored
    The recent change in lockdep for read lock caused the deadlock
    warnings in ALSA control code which uses the read_lock() for
    notification and else while write_lock_irqsave() is used for adding
    and removing the list entry.  Although a deadlock would practically
    never hit in a real usage (the addition and the deletion can't happen
    with the notification), it's better to fix the read_lock() usage in a
    semantically correct way.
    
    This patch replaces the read_lock() calls with read_lock_irqsave()
    version for avoiding a reported deadlock.  The notification code path
    takes the irq disablement in anyway, and other code paths are very
    short execution, hence there shouldn't be any big performance hit by
    this change.
    
    Fixes: e9181886 ("locking: More accurate annotations for read_lock()")
    Reported-by: syzbot+561a74f84100162990b2@syzkaller.appspotmail.com
    Link: https://lore.kernel.org/r/20200922084953.29018-1-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    6564d0ad
control.c 55.3 KB