Merge "usb: gadget: u_data_hsic: Reduce the number of interrupts in TX data path" into msm-3.0
diff --git a/drivers/usb/gadget/u_data_hsic.c b/drivers/usb/gadget/u_data_hsic.c
index 61458ea..46109f2 100644
--- a/drivers/usb/gadget/u_data_hsic.c
+++ b/drivers/usb/gadget/u_data_hsic.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -37,6 +37,7 @@
#define GHSIC_DATA_SERIAL_RX_Q_SIZE 2
#define GHSIC_DATA_SERIAL_TX_Q_SIZE 2
#define GHSIC_DATA_RX_REQ_SIZE 2048
+#define GHSIC_DATA_TX_INTR_THRESHOLD 20
static unsigned int ghsic_data_rmnet_tx_q_size = GHSIC_DATA_RMNET_TX_Q_SIZE;
module_param(ghsic_data_rmnet_tx_q_size, uint, S_IRUGO | S_IWUSR);
@@ -53,6 +54,9 @@
static unsigned int ghsic_data_rx_req_size = GHSIC_DATA_RX_REQ_SIZE;
module_param(ghsic_data_rx_req_size, uint, S_IRUGO | S_IWUSR);
+unsigned int ghsic_data_tx_intr_thld = GHSIC_DATA_TX_INTR_THRESHOLD;
+module_param(ghsic_data_tx_intr_thld, uint, S_IRUGO | S_IWUSR);
+
/*flow ctrl*/
#define GHSIC_DATA_FLOW_CTRL_EN_THRESHOLD 500
#define GHSIC_DATA_FLOW_CTRL_DISABLE 300
@@ -109,6 +113,8 @@
/*bridge status*/
unsigned long bridge_sts;
+ unsigned int n_tx_req_queued;
+
/*counters*/
unsigned long to_modem;
unsigned long to_host;
@@ -210,6 +216,14 @@
req->buf = skb->data;
req->length = skb->len;
+ port->n_tx_req_queued++;
+ if (port->n_tx_req_queued == ghsic_data_tx_intr_thld) {
+ req->no_interrupt = 0;
+ port->n_tx_req_queued = 0;
+ } else {
+ req->no_interrupt = 1;
+ }
+
list_del(&req->list);
spin_unlock_irqrestore(&port->port_lock, flags);
@@ -698,6 +712,7 @@
port->port_usb = 0;
port->in = NULL;
port->out = NULL;
+ port->n_tx_req_queued = 0;
clear_bit(TX_THROTTLED, &port->brdg.flags);
clear_bit(RX_THROTTLED, &port->brdg.flags);
spin_unlock_irqrestore(&port->port_lock, flags);