r8152: adjust lpm timer
authorhayeswang <hayeswang@realtek.com>
Fri, 6 Feb 2015 03:30:46 +0000 (11:30 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 8 Feb 2015 06:46:24 +0000 (22:46 -0800)
Set LPM timer to 500us, except for RTL_VER_04 which doesn't link at
USB 3.0.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/r8152.c

index 41a1cbc6cc7f7fd2b8f850193e350ddaac32e72f..ff122fae65869ec0424f37c828af0b54307076c3 100644 (file)
@@ -3256,10 +3256,10 @@ static void r8153_init(struct r8152 *tp)
 
        ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_LPM_CTRL);
        ocp_data &= ~LPM_TIMER_MASK;
-       if (tp->udev->speed == USB_SPEED_SUPER)
-               ocp_data |= LPM_TIMER_500US;
-       else
+       if (tp->version == RTL_VER_04 && tp->udev->speed != USB_SPEED_SUPER)
                ocp_data |= LPM_TIMER_500MS;
+       else
+               ocp_data |= LPM_TIMER_500US;
        ocp_write_byte(tp, MCU_TYPE_USB, USB_LPM_CTRL, ocp_data);
 
        ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_AFE_CTRL2);