Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <davem@davemloft.net>

+29 -29
+29 -29
drivers/net/ethernet/realtek/r8169_main.c
··· 2210 2210 return 0; 2211 2211 } 2212 2212 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 - 2235 2213 static void rtl_init_rxcfg(struct rtl8169_private *tp) 2236 2214 { 2237 2215 switch (tp->mac_version) { ··· 2431 2453 RTL_W32(tp, MISC, RTL_R32(tp, MISC) | RXDV_GATED_EN); 2432 2454 fsleep(2000); 2433 2455 rtl_wait_txrx_fifo_empty(tp); 2456 + } 2457 + 2458 + static void rtl_wol_enable_rx(struct rtl8169_private *tp) 2459 + { 2460 + if (tp->mac_version >= RTL_GIGA_MAC_VER_25) 2461 + RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) | 2462 + AcceptBroadcast | AcceptMulticast | AcceptMyPhys); 2463 + 2464 + if (tp->mac_version >= RTL_GIGA_MAC_VER_40) 2465 + rtl_disable_rxdvgate(tp); 2466 + } 2467 + 2468 + static void rtl_prepare_power_down(struct rtl8169_private *tp) 2469 + { 2470 + if (tp->dash_type != RTL_DASH_NONE) 2471 + return; 2472 + 2473 + if (tp->mac_version == RTL_GIGA_MAC_VER_32 || 2474 + tp->mac_version == RTL_GIGA_MAC_VER_33) 2475 + rtl_ephy_write(tp, 0x19, 0xff64); 2476 + 2477 + if (device_may_wakeup(tp_to_dev(tp))) { 2478 + phy_speed_down(tp->phydev, false); 2479 + rtl_wol_enable_rx(tp); 2480 + } 2434 2481 } 2435 2482 2436 2483 static void rtl_set_tx_config_registers(struct rtl8169_private *tp) ··· 3875 3872 netdev_reset_queue(tp->dev); 3876 3873 } 3877 3874 3878 - static void rtl8169_cleanup(struct rtl8169_private *tp, bool going_down) 3875 + static void rtl8169_cleanup(struct rtl8169_private *tp) 3879 3876 { 3880 3877 napi_disable(&tp->napi); 3881 3878 ··· 3886 3883 rtl8169_irq_mask_and_ack(tp); 3887 3884 3888 3885 rtl_rx_close(tp); 3889 - 3890 - if (going_down && tp->dev->wol_enabled) 3891 - goto no_reset; 3892 3886 3893 3887 switch (tp->mac_version) { 3894 3888 case RTL_GIGA_MAC_VER_28: ··· 3907 3907 } 3908 3908 3909 3909 rtl_hw_reset(tp); 3910 - no_reset: 3910 + 3911 3911 rtl8169_tx_clear(tp); 3912 3912 rtl8169_init_ring_indexes(tp); 3913 3913 } ··· 3918 3918 3919 3919 netif_stop_queue(tp->dev); 3920 3920 3921 - rtl8169_cleanup(tp, false); 3921 + rtl8169_cleanup(tp); 3922 3922 3923 3923 for (i = 0; i < NUM_RX_DESC; i++) 3924 3924 rtl8169_mark_to_asic(tp->RxDescArray + i); ··· 4605 4605 pci_clear_master(tp->pci_dev); 4606 4606 rtl_pci_commit(tp); 4607 4607 4608 - rtl8169_cleanup(tp, true); 4608 + rtl8169_cleanup(tp); 4609 4609 rtl_disable_exit_l1(tp); 4610 4610 rtl_prepare_power_down(tp); 4611 4611 }