From: hayeswang Date: Fri, 31 Jul 2015 03:23:39 +0000 (+0800) Subject: r8152: disable the capability of zero length X-Git-Tag: Ubuntu-snapdragon-4.4.0-1029.32~5986^2~251 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=e90fba8d9f6067cd511f7b855518eebda6bf2532;p=mirror_ubuntu-zesty-kernel.git r8152: disable the capability of zero length The UEFI driver would enable zero length, and the Linux driver doesn't need it. Zero length let the hw complete the transfer with length 0, when there is no received packet. It would add the load of USB host controller and reduce the performance. Signed-off-by: Hayes Wang Signed-off-by: David S. Miller --- diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 57b72ecb5455..348652a190af 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -339,6 +339,7 @@ /* USB_USB_CTRL */ #define RX_AGG_DISABLE 0x0010 +#define RX_ZERO_EN 0x0080 /* USB_U2P3_CTRL */ #define U2P3_ENABLE 0x0001 @@ -2705,7 +2706,7 @@ static void r8153_first_init(struct r8152 *tp) /* rx aggregation */ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); - ocp_data &= ~RX_AGG_DISABLE; + ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN); ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); } @@ -3227,7 +3228,7 @@ static void r8152b_init(struct r8152 *tp) /* enable rx aggregation */ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); - ocp_data &= ~RX_AGG_DISABLE; + ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN); ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); }