OSDN Git Service

usb: gadget: Iterate over all IN EPs for allocation of TX FIFOs
authorDevdutt Patnaik <dpatnaik@codeaurora.org>
Thu, 19 May 2016 21:22:37 +0000 (14:22 -0700)
committerKyle Yan <kyan@codeaurora.org>
Wed, 25 May 2016 00:55:14 +0000 (17:55 -0700)
GSI EPs are assigned to the last 2 IN EPs. While allocating
the TX FIFO sizes we need to iterate over all IN EPs to correctly
allocate larger TX FIFOs for GSI accelerated endpoints.
Update the logic from using min_t(int, dwc->num_in_eps,
cdev->config->num_ineps_used + 1) to just use dwc->num_in_eps.
The EPs that are not enabled will be given the default TX FIFO
size while the ones that are enabled are given TX FIFO sizes
based on the burst size configured for that EP.

Change-Id: Ie9a21544966fb54cf9920e9c719309cc66157846
Signed-off-by: Devdutt Patnaik <dpatnaik@codeaurora.org>
drivers/usb/dwc3/gadget.c

index f5554d7..506a1a5 100644 (file)
@@ -186,9 +186,7 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc)
        if (!(cdev && cdev->config) || !dwc->needs_fifo_resize)
                return 0;
 
-       /* gadget.num_eps never be greater than dwc->num_in_eps */
-       num_eps = min_t(int, dwc->num_in_eps,
-                       cdev->config->num_ineps_used + 1);
+       num_eps = dwc->num_in_eps;
        ram1_depth = DWC3_RAM1_DEPTH(dwc->hwparams.hwparams7);
        mdwidth = DWC3_MDWIDTH(dwc->hwparams.hwparams0);
 
@@ -206,7 +204,7 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc)
                int             tmp;
 
                if (!(dep->flags & DWC3_EP_ENABLED)) {
-                       dev_warn(dwc->dev, "ep%dIn not enabled", num);
+                       dev_dbg(dwc->dev, "ep%dIn not enabled", num);
                        tmp = max_packet + mdwidth;
                        goto resize_fifo;
                }