Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751588AbaKGJzf (ORCPT ); Fri, 7 Nov 2014 04:55:35 -0500 Received: from rtits2.realtek.com ([60.250.210.242]:55355 "EHLO rtits2.realtek.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751122AbaKGJz3 (ORCPT ); Fri, 7 Nov 2014 04:55:29 -0500 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.49 with qID sA79tPpR019432, This message is accepted by code: ctloc85258 From: Hayes Wang To: CC: , , , Hayes Wang Subject: [PATCH net-next 2/2] r8152: adjust rtl_start_rx Date: Fri, 7 Nov 2014 17:55:11 +0800 Message-ID: <1394712342-15778-90-Taiwan-albertk@realtek.com> X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <1394712342-15778-88-Taiwan-albertk@realtek.com> References: <1394712342-15778-88-Taiwan-albertk@realtek.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.71.44] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Submit all the rx buffers, even though a error occurs. Otherwise the buffers which are not submitted would be lost until next rtl_start_rx() is called. Besides, the fail buffer could be re-submitted later. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index ad62994..5e0386f 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -1993,10 +1993,16 @@ static int rtl_start_rx(struct r8152 *tp) INIT_LIST_HEAD(&tp->rx_done); for (i = 0; i < RTL8152_MAX_RX; i++) { + int rr; + INIT_LIST_HEAD(&tp->rx_info[i].list); - ret = r8152_submit_rx(tp, &tp->rx_info[i], GFP_KERNEL); - if (ret) - break; + + rr = r8152_submit_rx(tp, &tp->rx_info[i], GFP_KERNEL); + if (rr) + netif_err(tp, rx_err, tp->netdev, + "Couldn't submit rx[%d], ret = %d\n", i, rr); + if (!ret) + ret = rr; } return ret; -- 1.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/