Patch "usb: dwc3: gadget: Change condition for processing suspend event" has been added to the 6.2-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: Change condition for processing suspend event

to the 6.2-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-change-condition-for-processing-susp.patch
and it can be found in the queue-6.2 subdirectory.

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



commit f6d6f9e406bd064ffaf3055f8cc146631a6cc266
Author: Prashanth K <quic_prashk@xxxxxxxxxxx>
Date:   Fri Feb 24 11:16:58 2023 +0530

    usb: dwc3: gadget: Change condition for processing suspend event
    
    [ Upstream commit 4decf4060ecfee1f7a710999fcd421645ac0c419 ]
    
    Currently we process the suspend interrupt event only if the
    device is in configured state. Consider a case where device
    is not configured and got suspend interrupt, in that case our
    gadget will still use 100mA as composite_suspend didn't happen.
    But battery charging specification (BC1.2) expects a downstream
    device to draw less than 2.5mA when unconnected OR suspended.
    
    Fix this by removing the condition for processing suspend event,
    and thus composite_resume would set vbus draw to 2.
    
    Fixes: 72704f876f50 ("dwc3: gadget: Implement the suspend entry event handler")
    Signed-off-by: Prashanth K <quic_prashk@xxxxxxxxxxx>
    Acked-by: Thinh Nguyen <Thinh.Nguyen@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/1677217619-10261-2-git-send-email-quic_prashk@xxxxxxxxxxx
    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 743186c26e01b..3faac3244c7db 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -4262,15 +4262,8 @@ static void dwc3_gadget_interrupt(struct dwc3 *dwc,
 		break;
 	case DWC3_DEVICE_EVENT_SUSPEND:
 		/* It changed to be suspend event for version 2.30a and above */
-		if (!DWC3_VER_IS_PRIOR(DWC3, 230A)) {
-			/*
-			 * Ignore suspend event until the gadget enters into
-			 * USB_STATE_CONFIGURED state.
-			 */
-			if (dwc->gadget->state >= USB_STATE_CONFIGURED)
-				dwc3_gadget_suspend_interrupt(dwc,
-						event->event_info);
-		}
+		if (!DWC3_VER_IS_PRIOR(DWC3, 230A))
+			dwc3_gadget_suspend_interrupt(dwc, event->event_info);
 		break;
 	case DWC3_DEVICE_EVENT_SOF:
 	case DWC3_DEVICE_EVENT_ERRATIC_ERROR:



[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