Skip to content

Commit 0e3d183

Browse files
committed
Merge branch 'r8169-fixes'
Chunhao Lin says: ==================== r8169: fix dmar pte write access is not set error This series fixes dmar pte write access is not set error. Chunhao Lin (2): r8169: move rtl_wol_enable_rx() and rtl_prepare_power_down() r8169: fix dmar pte write access is not set error v2: -update commit message -adjust the code according to current kernel code v3: -update title and commit message -split the patch ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents e71460d + bb41c13 commit 0e3d183

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2210,28 +2210,6 @@ static int rtl_set_mac_address(struct net_device *dev, void *p)
22102210
return 0;
22112211
}
22122212

2213-
static void rtl_wol_enable_rx(struct rtl8169_private *tp)
2214-
{
2215-
if (tp->mac_version >= RTL_GIGA_MAC_VER_25)
2216-
RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) |
2217-
AcceptBroadcast | AcceptMulticast | AcceptMyPhys);
2218-
}
2219-
2220-
static void rtl_prepare_power_down(struct rtl8169_private *tp)
2221-
{
2222-
if (tp->dash_type != RTL_DASH_NONE)
2223-
return;
2224-
2225-
if (tp->mac_version == RTL_GIGA_MAC_VER_32 ||
2226-
tp->mac_version == RTL_GIGA_MAC_VER_33)
2227-
rtl_ephy_write(tp, 0x19, 0xff64);
2228-
2229-
if (device_may_wakeup(tp_to_dev(tp))) {
2230-
phy_speed_down(tp->phydev, false);
2231-
rtl_wol_enable_rx(tp);
2232-
}
2233-
}
2234-
22352213
static void rtl_init_rxcfg(struct rtl8169_private *tp)
22362214
{
22372215
switch (tp->mac_version) {
@@ -2455,6 +2433,31 @@ static void rtl_enable_rxdvgate(struct rtl8169_private *tp)
24552433
rtl_wait_txrx_fifo_empty(tp);
24562434
}
24572435

2436+
static void rtl_wol_enable_rx(struct rtl8169_private *tp)
2437+
{
2438+
if (tp->mac_version >= RTL_GIGA_MAC_VER_25)
2439+
RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) |
2440+
AcceptBroadcast | AcceptMulticast | AcceptMyPhys);
2441+
2442+
if (tp->mac_version >= RTL_GIGA_MAC_VER_40)
2443+
rtl_disable_rxdvgate(tp);
2444+
}
2445+
2446+
static void rtl_prepare_power_down(struct rtl8169_private *tp)
2447+
{
2448+
if (tp->dash_type != RTL_DASH_NONE)
2449+
return;
2450+
2451+
if (tp->mac_version == RTL_GIGA_MAC_VER_32 ||
2452+
tp->mac_version == RTL_GIGA_MAC_VER_33)
2453+
rtl_ephy_write(tp, 0x19, 0xff64);
2454+
2455+
if (device_may_wakeup(tp_to_dev(tp))) {
2456+
phy_speed_down(tp->phydev, false);
2457+
rtl_wol_enable_rx(tp);
2458+
}
2459+
}
2460+
24582461
static void rtl_set_tx_config_registers(struct rtl8169_private *tp)
24592462
{
24602463
u32 val = TX_DMA_BURST << TxDMAShift |
@@ -3872,7 +3875,7 @@ static void rtl8169_tx_clear(struct rtl8169_private *tp)
38723875
netdev_reset_queue(tp->dev);
38733876
}
38743877

3875-
static void rtl8169_cleanup(struct rtl8169_private *tp, bool going_down)
3878+
static void rtl8169_cleanup(struct rtl8169_private *tp)
38763879
{
38773880
napi_disable(&tp->napi);
38783881

@@ -3884,9 +3887,6 @@ static void rtl8169_cleanup(struct rtl8169_private *tp, bool going_down)
38843887

38853888
rtl_rx_close(tp);
38863889

3887-
if (going_down && tp->dev->wol_enabled)
3888-
goto no_reset;
3889-
38903890
switch (tp->mac_version) {
38913891
case RTL_GIGA_MAC_VER_28:
38923892
case RTL_GIGA_MAC_VER_31:
@@ -3907,7 +3907,7 @@ static void rtl8169_cleanup(struct rtl8169_private *tp, bool going_down)
39073907
}
39083908

39093909
rtl_hw_reset(tp);
3910-
no_reset:
3910+
39113911
rtl8169_tx_clear(tp);
39123912
rtl8169_init_ring_indexes(tp);
39133913
}
@@ -3918,7 +3918,7 @@ static void rtl_reset_work(struct rtl8169_private *tp)
39183918

39193919
netif_stop_queue(tp->dev);
39203920

3921-
rtl8169_cleanup(tp, false);
3921+
rtl8169_cleanup(tp);
39223922

39233923
for (i = 0; i < NUM_RX_DESC; i++)
39243924
rtl8169_mark_to_asic(tp->RxDescArray + i);
@@ -4605,7 +4605,7 @@ static void rtl8169_down(struct rtl8169_private *tp)
46054605
pci_clear_master(tp->pci_dev);
46064606
rtl_pci_commit(tp);
46074607

4608-
rtl8169_cleanup(tp, true);
4608+
rtl8169_cleanup(tp);
46094609
rtl_disable_exit_l1(tp);
46104610
rtl_prepare_power_down(tp);
46114611
}

0 commit comments

Comments
 (0)