Patch "usb: dwc3: gadget: Ignore EP queue requests during bus reset" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    usb: dwc3: gadget: Ignore EP queue requests during bus reset

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-dwc3-gadget-ignore-ep-queue-requests-during-bus-.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b4bfe41929d063947b0bc5268e08714be4dcb54d
Author: Wesley Cheng <wcheng@xxxxxxxxxxxxxx>
Date:   Fri Mar 19 02:31:25 2021 -0700

    usb: dwc3: gadget: Ignore EP queue requests during bus reset
    
    [ Upstream commit 71ca43f30df9c642970f9dc9b2d6f463f4967e7b ]
    
    The current dwc3_gadget_reset_interrupt() will stop any active
    transfers, but only addresses blocking of EP queuing for while we are
    coming from a disconnected scenario, i.e. after receiving the disconnect
    event.  If the host decides to issue a bus reset on the device, the
    connected parameter will still be set to true, allowing for EP queuing
    to continue while we are disabling the functions.  To avoid this, set the
    connected flag to false until the stop active transfers is complete.
    
    Signed-off-by: Wesley Cheng <wcheng@xxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/1616146285-19149-3-git-send-email-wcheng@xxxxxxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 904b0043011c..aa520c343367 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2986,6 +2986,15 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc)
 
 	dwc->connected = true;
 
+	/*
+	 * Ideally, dwc3_reset_gadget() would trigger the function
+	 * drivers to stop any active transfers through ep disable.
+	 * However, for functions which defer ep disable, such as mass
+	 * storage, we will need to rely on the call to stop active
+	 * transfers here, and avoid allowing of request queuing.
+	 */
+	dwc->connected = false;
+
 	/*
 	 * WORKAROUND: DWC3 revisions <1.88a have an issue which
 	 * would cause a missing Disconnect Event if there's a



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux