mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 00:00:00 -04:00
usb: xhci: Replace HCD_RH_RUNNING() check in xhci_stop_endpoint
This function can be called to stop an endpoint handled by the secondary execution environment just after the HCD is removed (e.g. Type-C cable removal), after which the QMI sound driver proceeds to unmap transfer ring buffers from DMA. However, although the RH state indicates it is not running, the controller may not yet be fully halted and may continue to access now unmapped memory. Replace the HCD_RH_RUNNING(hcd) check with xhci_check_args() which includes a check for XHCI_STATE_HALTED, so that a Stop command can still be issued. Change-Id: Ie17882cdcfeea13fbdf7b1cd1353296d5966c798 Signed-off-by: Jack Pham <jackp@codeaurora.org>
This commit is contained in:
parent
197f1cc98f
commit
e336888c91
1 changed files with 3 additions and 2 deletions
|
|
@ -5399,8 +5399,9 @@ int xhci_stop_endpoint(struct usb_device *udev, struct usb_host_endpoint *ep)
|
|||
unsigned long flags;
|
||||
int ret = 0;
|
||||
|
||||
if (!HCD_RH_RUNNING(hcd))
|
||||
return 0;
|
||||
ret = xhci_check_args(hcd, udev, ep, 1, true, __func__);
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
|
||||
cmd = xhci_alloc_command(xhci, true, GFP_NOIO);
|
||||
if (!cmd)
|
||||
|
|
|
|||
Loading…
Reference in a new issue