Skip to content

Commit 61b0ad6

Browse files
hayesorzdavem330
authored andcommitted
r8152: fix the poor throughput for 2.5G devices
Fix the poor throughput for 2.5G devices, when changing the speed from auto mode to force mode. This patch is used to notify the MAC when the mode is changed. Fixes: 195aae3 ("r8152: support new chips") Signed-off-by: Hayes Wang <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8ceda6d commit 61b0ad6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/net/usb/r8152.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@
199199
#define OCP_EEE_AR 0xa41a
200200
#define OCP_EEE_DATA 0xa41c
201201
#define OCP_PHY_STATUS 0xa420
202+
#define OCP_INTR_EN 0xa424
202203
#define OCP_NCTL_CFG 0xa42c
203204
#define OCP_POWER_CFG 0xa430
204205
#define OCP_EEE_CFG 0xa432
@@ -620,6 +621,9 @@ enum spd_duplex {
620621
#define PHY_STAT_LAN_ON 3
621622
#define PHY_STAT_PWRDN 5
622623

624+
/* OCP_INTR_EN */
625+
#define INTR_SPEED_FORCE BIT(3)
626+
623627
/* OCP_NCTL_CFG */
624628
#define PGA_RETURN_EN BIT(1)
625629

@@ -7554,6 +7558,11 @@ static void r8156_hw_phy_cfg(struct r8152 *tp)
75547558
((swap_a & 0x1f) << 8) |
75557559
((swap_a >> 8) & 0x1f));
75567560
}
7561+
7562+
/* Notify the MAC when the speed is changed to force mode. */
7563+
data = ocp_reg_read(tp, OCP_INTR_EN);
7564+
data |= INTR_SPEED_FORCE;
7565+
ocp_reg_write(tp, OCP_INTR_EN, data);
75577566
break;
75587567
default:
75597568
break;
@@ -7949,6 +7958,11 @@ static void r8156b_hw_phy_cfg(struct r8152 *tp)
79497958
break;
79507959
}
79517960

7961+
/* Notify the MAC when the speed is changed to force mode. */
7962+
data = ocp_reg_read(tp, OCP_INTR_EN);
7963+
data |= INTR_SPEED_FORCE;
7964+
ocp_reg_write(tp, OCP_INTR_EN, data);
7965+
79527966
if (rtl_phy_patch_request(tp, true, true))
79537967
return;
79547968

0 commit comments

Comments
 (0)