aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorhayeswang <hayeswang@realtek.com>2014-11-20 10:29:06 +0800
committerDavid S. Miller <davem@davemloft.net>2014-11-21 14:52:57 -0500
commit7bcf4f605b4592452fba1e421b930909f7842310 (patch)
tree7e7068970167deef51d65de96ae99c1f9f6bcee8 /drivers/net/usb
parentr8152: adjust r8152_submit_rx (diff)
downloadlinux-dev-7bcf4f605b4592452fba1e421b930909f7842310.tar.xz
linux-dev-7bcf4f605b4592452fba1e421b930909f7842310.zip
r8152: adjust rtl_start_rx
If there is a error for r8152_submit_rx(), add the remaining rx buffers to the list. Then the remaining rx buffers could be submitted later. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/r8152.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 3b89229f0737..4a9ece01def6 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -2001,6 +2001,25 @@ static int rtl_start_rx(struct r8152 *tp)
break;
}
+ if (ret && ++i < RTL8152_MAX_RX) {
+ struct list_head rx_queue;
+ unsigned long flags;
+
+ INIT_LIST_HEAD(&rx_queue);
+
+ do {
+ struct rx_agg *agg = &tp->rx_info[i++];
+ struct urb *urb = agg->urb;
+
+ urb->actual_length = 0;
+ list_add_tail(&agg->list, &rx_queue);
+ } while (i < RTL8152_MAX_RX);
+
+ spin_lock_irqsave(&tp->rx_lock, flags);
+ list_splice_tail(&rx_queue, &tp->rx_done);
+ spin_unlock_irqrestore(&tp->rx_lock, flags);
+ }
+
return ret;
}