Patch "usb: cdns3: fix incorrect calculation of ep_buf_size when more than one config" has been added to the 5.10-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: cdns3: fix incorrect calculation of ep_buf_size when more than one config

to the 5.10-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-cdns3-fix-incorrect-calculation-of-ep_buf_size-w.patch
and it can be found in the queue-5.10 subdirectory.

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



commit aead52baf21e5a4b42540c9de395cb055f177f97
Author: Frank Li <Frank.Li@xxxxxxx>
Date:   Fri Jul 7 19:00:15 2023 -0400

    usb: cdns3: fix incorrect calculation of ep_buf_size when more than one config
    
    [ Upstream commit 2627335a1329a0d39d8d277994678571c4f21800 ]
    
    Previously, the cdns3_gadget_check_config() function in the cdns3 driver
    mistakenly calculated the ep_buf_size by considering only one
    configuration's endpoint information because "claimed" will be clear after
    call usb_gadget_check_config().
    
    The fix involves checking the private flags EP_CLAIMED instead of relying
    on the "claimed" flag.
    
    Fixes: dce49449e04f ("usb: cdns3: allocate TX FIFO size according to composite EP number")
    Cc: stable <stable@xxxxxxxxxx>
    Reported-by: Ravi Gunasekaran <r-gunasekaran@xxxxxx>
    Signed-off-by: Frank Li <Frank.Li@xxxxxxx>
    Acked-by: Peter Chen <peter.chen@xxxxxxxxxx>
    Tested-by: Ravi Gunasekaran <r-gunasekaran@xxxxxx>
    Link: https://lore.kernel.org/r/20230707230015.494999-2-Frank.Li@xxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Stable-dep-of: 92f02efa1d86 ("usb: cdns3: fix iso transfer error when mult is not zero")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
index 575180a59ad4..ee64c4ab8dd2 100644
--- a/drivers/usb/cdns3/gadget.c
+++ b/drivers/usb/cdns3/gadget.c
@@ -3030,12 +3030,14 @@ static int cdns3_gadget_udc_stop(struct usb_gadget *gadget)
 static int cdns3_gadget_check_config(struct usb_gadget *gadget)
 {
 	struct cdns3_device *priv_dev = gadget_to_cdns3_device(gadget);
+	struct cdns3_endpoint *priv_ep;
 	struct usb_ep *ep;
 	int n_in = 0;
 	int total;
 
 	list_for_each_entry(ep, &gadget->ep_list, ep_list) {
-		if (ep->claimed && (ep->address & USB_DIR_IN))
+		priv_ep = ep_to_cdns3_ep(ep);
+		if ((priv_ep->flags & EP_CLAIMED) && (ep->address & USB_DIR_IN))
 			n_in++;
 	}
 




[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