• Sebastian Andrzej Siewior's avatar
    orinoco: Prepare stubs for in_interrupt() removal · 915fd9db
    Sebastian Andrzej Siewior authored
    ezusb_access_ltv() sends the prepared request to the USB device.
    Requests which have ->in_rid set expect an answer from the USB device
    and the function has to wait until the URB with the answer arrives.
    The function uses in_interrupt() to determine if it can simply sleep on
    the completion and be woken up once the answer arrives or if it needs to
    poll on the completion.
    
    The usage of in_interrupt() in drivers is phased out and Linus clearly
    requested that code which changes behaviour depending on context should
    either be separated or the context be conveyed in an argument passed by the
    caller, which usually knows the context.
    
    Aside of that in_interrupt() is not correct as it does not catch preempt
    disabled regions in which sleeping is also not allowed.
    
    Provide stubs which can be used as a replacement. The current default is
    the current behaviour which sleeps/polls depending on in_interrupt().
    The goal is to audit all callers and use either the poll or sleep
    version.
    Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20201113212252.2243570-3-bigeasy@linutronix.de
    915fd9db
orinoco_usb.c 45.5 KB