android_kernel_xiaomi_sm7250/drivers/usb
Mathias Nyman cebbc8d335 xhci: Remove device endpoints from bandwidth list when freeing the device
commit 5aed5b7c2430ce318a8e62f752f181e66f0d1053 upstream.

Endpoints are normally deleted from the bandwidth list when they are
dropped, before the virt device is freed.

If xHC host is dying or being removed then the endpoints aren't dropped
cleanly due to functions returning early to avoid interacting with a
non-accessible host controller.

So check and delete endpoints that are still on the bandwidth list when
freeing the virt device.

Solves a list_del corruption kernel crash when unbinding xhci-pci,
caused by xhci_mem_cleanup() when it later tried to delete already freed
endpoints from the bandwidth list.

This only affects hosts that use software bandwidth checking, which
currenty is only the xHC in intel Panther Point PCH (Ivy Bridge)

Cc: stable@vger.kernel.org
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20221024142720.4122053-5-mathias.nyman@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-11-03 23:52:28 +09:00
..
atm
c67x00
chipidea usb: chipidea: udc: check request status before setting device address 2022-07-02 16:27:34 +02:00
class USB: cdc-acm: Add Icom PMR F3400 support (0c26:0020) 2022-09-15 12:17:04 +02:00
common usb: ulpi: Call of_node_put correctly 2022-02-16 12:51:46 +01:00
core USB: add RESET_RESUME quirk for NVIDIA Jetson devices in RCM 2022-11-03 23:52:27 +09:00
dwc2 usb: dwc2: fix wrong order of phy_power_on and phy_init 2022-09-15 12:17:04 +02:00
dwc3 usb: dwc3: gadget: Don't set IMI for no_interrupt 2022-11-03 23:52:28 +09:00
early
gadget usb: bdc: change state when port disconnected 2022-11-03 23:52:28 +09:00
host xhci: Remove device endpoints from bandwidth list when freeing the device 2022-11-03 23:52:28 +09:00
image
isp1760
misc usb: idmouse: fix an uninit-value in idmouse_open 2022-10-26 13:19:41 +02:00
mon usb: mon: make mmapped memory read only 2022-10-26 13:19:17 +02:00
mtu3 usb: mtu3: fix USB 3.0 dual-role-switch from device to host 2022-05-12 12:20:18 +02:00
musb usb: musb: Fix musb_gadget.c rxstate overflow bug 2022-10-26 13:19:41 +02:00
phy
renesas_usbhs usb: renesas: Fix refcount leak bug 2022-08-25 11:15:43 +02:00
roles
serial USB: serial: qcserial: add new usb-id for Dell branded EM7455 2022-10-26 13:19:18 +02:00
storage Revert "usb: storage: Add quirk for Samsung Fit flash" 2022-10-26 13:19:41 +02:00
typec usb: typec: altmodes/displayport: correct pin assignment for UFP receptacles 2022-09-15 12:17:04 +02:00
usbip usb: usbip: add missing device lock on tweak configuration cmd 2022-06-14 16:59:31 +02:00
wusbcore
Kconfig Partially revert "usb: Kconfig: using select for USB_COMMON dependency" 2021-10-13 10:10:50 +02:00
Makefile
README
usb-skeleton.c

To understand all the Linux-USB framework, you'll use these resources:

    * This source code.  This is necessarily an evolving work, and
      includes kerneldoc that should help you get a current overview.
      ("make pdfdocs", and then look at "usb.pdf" for host side and
      "gadget.pdf" for peripheral side.)  Also, Documentation/usb has
      more information.

    * The USB 2.0 specification (from www.usb.org), with supplements
      such as those for USB OTG and the various device classes.
      The USB specification has a good overview chapter, and USB
      peripherals conform to the widely known "Chapter 9".

    * Chip specifications for USB controllers.  Examples include
      host controllers (on PCs, servers, and more); peripheral
      controllers (in devices with Linux firmware, like printers or
      cell phones); and hard-wired peripherals like Ethernet adapters.

    * Specifications for other protocols implemented by USB peripheral
      functions.  Some are vendor-specific; others are vendor-neutral
      but just standardized outside of the www.usb.org team.

Here is a list of what each subdirectory here is, and what is contained in
them.

core/		- This is for the core USB host code, including the
		  usbfs files and the hub class driver ("hub_wq").

host/		- This is for USB host controller drivers.  This
		  includes UHCI, OHCI, EHCI, and others that might
		  be used with more specialized "embedded" systems.

gadget/		- This is for USB peripheral controller drivers and
		  the various gadget drivers which talk to them.


Individual USB driver directories.  A new driver should be added to the
first subdirectory in the list below that it fits into.

image/		- This is for still image drivers, like scanners or
		  digital cameras.
../input/	- This is for any driver that uses the input subsystem,
		  like keyboard, mice, touchscreens, tablets, etc.
../media/	- This is for multimedia drivers, like video cameras,
		  radios, and any other drivers that talk to the v4l
		  subsystem.
../net/		- This is for network drivers.
serial/		- This is for USB to serial drivers.
storage/	- This is for USB mass-storage drivers.
class/		- This is for all USB device drivers that do not fit
		  into any of the above categories, and work for a range
		  of USB Class specified devices. 
misc/		- This is for all USB device drivers that do not fit
		  into any of the above categories.