orinoco: Prepare stubs for in_interrupt() removal
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 13 Nov 2020 21:22:44 +0000 (22:22 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 24 Nov 2020 15:01:08 +0000 (17:01 +0200)
commit915fd9db418f3f99c002dcca8a089923c96ec80a
treeee387ccb1106fe0b1c2278337dd882aef863879b
parenta31eb615646a63370aa1da1053c45439c7653d83
orinoco: Prepare stubs for in_interrupt() removal

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: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201113212252.2243570-3-bigeasy@linutronix.de
drivers/net/wireless/intersil/orinoco/orinoco_usb.c