gadget:tegra decrease uFrame count for interrupt latency
Philip Rakity [Sat, 9 Mar 2013 01:50:15 +0000 (17:50 -0800)]
The usb command register defines the minimum time
that the usb controller can interrupt the cpu. This
is set (by default) to 1ms (8 uFrames). This value
was set in the standard a LONG time ago. Reduce the
interrupt time to 125uS as tegra is able to handle
interrupts at this rate. This change improves the
adb throughtput.

This change improves the adb throughtput from 1.2 MB/sec
to 5.5-5.9 MB/Sec.

Bug 1216801

Change-Id: I43957cf23247846e8cab11eea7a9a0d4e4def2e1
Signed-off-by: Philip Rakity <prakity@nvidia.com>
(cherry picked from commit c38b808fd744bbdab760a7e601f0624571838d1c)
Reviewed-on: http://git-master/r/210013
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Rakesh Bodla <rbodla@nvidia.com>
Tested-by: Rakesh Bodla <rbodla@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>

drivers/usb/gadget/tegra_udc.c

index 0266790..7b51ed1 100644 (file)
@@ -380,8 +380,11 @@ static void dr_controller_run(struct tegra_udc *udc)
                udc_writel(udc, temp, VBUS_SENSOR_REG_OFFSET);
        }
 
+       /* set interrupt latency to 125 uS (1 uFrame) */
        /* Set controller to Run */
        temp = udc_readl(udc, USB_CMD_REG_OFFSET);
+       temp &= ~USB_CMD_ITC;
+       temp |= USB_CMD_ITC_1_MICRO_FRM;
        if (can_pullup(udc))
                temp |= USB_CMD_RUN_STOP;
        else
@@ -1472,7 +1475,10 @@ static int tegra_pullup(struct usb_gadget *gadget, int is_on)
                        OTG_STATE_B_PERIPHERAL)
                        return 0;
 
+       /* set interrupt latency to 125 uS (1 uFrame) */
        tmp = udc_readl(udc, USB_CMD_REG_OFFSET);
+       tmp &= ~USB_CMD_ITC;
+       tmp |= USB_CMD_ITC_1_MICRO_FRM;
        if (can_pullup(udc))
                udc_writel(udc, tmp | USB_CMD_RUN_STOP,
                                USB_CMD_REG_OFFSET);