linux-stable/include
Weitao Wang f42ec7c13c USB: HCD: Fix URB giveback issue in tasklet function
commit 26c6c2f8a9 upstream.

Usb core introduce the mechanism of giveback of URB in tasklet context to
reduce hardware interrupt handling time. On some test situation(such as
FIO with 4KB block size), when tasklet callback function called to
giveback URB, interrupt handler add URB node to the bh->head list also.
If check bh->head list again after finish all URB giveback of local_list,
then it may introduce a "dynamic balance" between giveback URB and add URB
to bh->head list. This tasklet callback function may not exit for a long
time, which will cause other tasklet function calls to be delayed. Some
real-time applications(such as KB and Mouse) will see noticeable lag.

In order to prevent the tasklet function from occupying the cpu for a long
time at a time, new URBS will not be added to the local_list even though
the bh->head list is not empty. But also need to ensure the left URB
giveback to be processed in time, so add a member high_prio for structure
giveback_urb_bh to prioritize tasklet and schelule this tasklet again if
bh->head list is not empty.

At the same time, we are able to prioritize tasklet through structure
member high_prio. So, replace the local high_prio_bh variable with this
structure member in usb_hcd_giveback_urb.

Fixes: 94dfd7edfd ("USB: HCD: support giveback of URB in tasklet context")
Cc: stable <stable@kernel.org>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Weitao Wang <WeitaoWang-oc@zhaoxin.com>
Link: https://lore.kernel.org/r/20220726074918.5114-1-WeitaoWang-oc@zhaoxin.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-17 14:40:18 +02:00
..
acpi ACPI: CPPC: Don't require _OSC if X86_FEATURE_CPPC is supported 2022-07-12 16:42:23 +02:00
asm-generic asm-generic: remove a broken and needless ifdef conditional 2022-08-03 12:05:17 +02:00
clocksource
crypto
drm drm/scheduler: Don't kill jobs in interrupt context 2022-07-29 17:27:56 +02:00
dt-bindings dt-bindings: clk: mpfs: add defines for two new clocks 2022-04-22 18:40:15 -07:00
keys
kunit
kvm
linux USB: HCD: Fix URB giveback issue in tasklet function 2022-08-17 14:40:18 +02:00
math-emu
media
memory memory: renesas-rpc-if: Fix HF/OSPI data transfer in Manual Mode 2022-04-21 17:00:24 +02:00
misc
net net: Fix data-races around sysctl_[rw]mem(_offset)?. 2022-08-03 12:05:26 +02:00
pcmcia
ras
rdma
scsi scsi: fcoe: Fix Wstringop-overflow warnings in fcoe_wwn_from_mac() 2022-06-09 10:30:26 +02:00
soc net: mscc: ocelot: mark traps with a bool instead of keeping them in a list 2022-05-05 19:15:14 -07:00
sound ASoC: cs35l41: Fix an out-of-bounds access in otp_packed_element_t 2022-06-09 10:29:55 +02:00
target
trace net: sock: tracing: Fix sock_exceed_buf_limit not to dereference stale pointer 2022-07-22 10:21:19 +02:00
uapi drm/fourcc: fix integer type usage in uapi header 2022-07-07 17:55:00 +02:00
vdso
video video: of_display_timing.h: include errno.h 2022-07-12 16:42:17 +02:00
xen