aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/generate_rust_target.rs
diff options
context:
space:
mode:
authorWeitao Wang <[email protected]>2025-08-19 12:58:43 +0000
committerGreg Kroah-Hartman <[email protected]>2025-08-19 14:12:13 +0000
commit2eb03376151bb8585caa23ed2673583107bb5193 (patch)
tree83ab088b70be1246e4efe130086bf73713716df5 /scripts/generate_rust_target.rs
parentusb: typec: fusb302: Revert incorrect threaded irq fix (diff)
downloadkernel-2eb03376151bb8585caa23ed2673583107bb5193.tar.gz
kernel-2eb03376151bb8585caa23ed2673583107bb5193.zip
usb: xhci: Fix slot_id resource race conflict
xHC controller may immediately reuse a slot_id after it's disabled, giving it to a new enumerating device before the xhci driver freed all resources related to the disabled device. In such a scenario, device-A with slot_id equal to 1 is disconnecting while device-B is enumerating, device-B will fail to enumerate in the follow sequence. 1.[device-A] send disable slot command 2.[device-B] send enable slot command 3.[device-A] disable slot command completed and wakeup waiting thread 4.[device-B] enable slot command completed with slot_id equal to 1 and wakeup waiting thread 5.[device-B] driver checks that slot_id is still in use (by device-A) in xhci_alloc_virt_device, and fail to enumerate due to this conflict 6.[device-A] xhci->devs[slot_id] set to NULL in xhci_free_virt_device To fix driver's slot_id resources conflict, clear xhci->devs[slot_id] and xhci->dcbba->dev_context_ptrs[slot_id] pointers in the interrupt context when disable slot command completes successfully. Simultaneously, adjust function xhci_free_virt_device to accurately handle device release. [minor smatch warning and commit message fix -Mathias] Cc: [email protected] Fixes: 7faac1953ed1 ("xhci: avoid race between disable slot command and host runtime suspend") Signed-off-by: Weitao Wang <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'scripts/generate_rust_target.rs')
0 files changed, 0 insertions, 0 deletions