Patch "usb: dwc2: gadget: don't try to disable ep0 in dwc2_hsotg_suspend" has been added to the 5.16-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: dwc2: gadget: don't try to disable ep0 in dwc2_hsotg_suspend

to the 5.16-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-dwc2-gadget-don-t-try-to-disable-ep0-in-dwc2_hso.patch
and it can be found in the queue-5.16 subdirectory.

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



commit 1e45386389b8986ccc5f204e2ee95b65445771f1
Author: Amelie Delaunay <amelie.delaunay@xxxxxxxxxxx>
Date:   Tue Dec 7 14:01:01 2021 +0100

    usb: dwc2: gadget: don't try to disable ep0 in dwc2_hsotg_suspend
    
    [ Upstream commit ac55d163855924aa5af9f1560977da8f346963c8 ]
    
    Calling dwc2_hsotg_ep_disable on ep0 (in/out) will lead to the following
    logs before returning -EINVAL:
    dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0
    dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0
    
    To avoid these two logs while suspending, start disabling the endpoint
    from the index 1, as done in dwc2_hsotg_udc_stop:
    
            /* all endpoints should be shutdown */
            for (ep = 1; ep < hsotg->num_of_eps; ep++) {
                    if (hsotg->eps_in[ep])
                            dwc2_hsotg_ep_disable_lock(&hsotg->eps_in[ep]->ep);
                    if (hsotg->eps_out[ep])
                            dwc2_hsotg_ep_disable_lock(&hsotg->eps_out[ep]->ep);
            }
    
    Acked-by: Minas Harutyunyan <Minas.Harutyunyan@xxxxxxxxxxxx>
    Signed-off-by: Amelie Delaunay <amelie.delaunay@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20211207130101.270314-1-amelie.delaunay@xxxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 43cf49c4e5e59..da82e4140d545 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -5097,7 +5097,7 @@ int dwc2_hsotg_suspend(struct dwc2_hsotg *hsotg)
 		hsotg->gadget.speed = USB_SPEED_UNKNOWN;
 		spin_unlock_irqrestore(&hsotg->lock, flags);
 
-		for (ep = 0; ep < hsotg->num_of_eps; ep++) {
+		for (ep = 1; ep < hsotg->num_of_eps; ep++) {
 			if (hsotg->eps_in[ep])
 				dwc2_hsotg_ep_disable_lock(&hsotg->eps_in[ep]->ep);
 			if (hsotg->eps_out[ep])



[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