Skip to content

Commit bb96eb7

Browse files
committed
r8169: fix dmar pte write access is not set error
Bugzilla: https://bugzilla.redhat.com/2159618 commit bb41c13 Author: Chunhao Lin <hau@realtek.com> Date: Mon Dec 26 20:31:53 2022 +0800 r8169: fix dmar pte write access is not set error When close device, if wol is enabled, rx will be enabled. When open device it will cause rx packet to be dma to the wrong memory address after pci_set_master() and system log will show blow messages. DMAR: DRHD: handling fault status reg 3 DMAR: [DMA Write] Request device [02:00.0] PASID ffffffff fault addr ffdd4000 [fault reason 05] PTE Write access is not set In this patch, driver disable tx/rx when close device. If wol is enabled, only enable rx filter and disable rxdv_gate(if support) to let hardware only receive packet to fifo but not to dma it. Signed-off-by: Chunhao Lin <hau@realtek.com> Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
1 parent beacabd commit bb96eb7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,6 +2472,9 @@ static void rtl_wol_enable_rx(struct rtl8169_private *tp)
24722472
if (tp->mac_version >= RTL_GIGA_MAC_VER_25)
24732473
RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) |
24742474
AcceptBroadcast | AcceptMulticast | AcceptMyPhys);
2475+
2476+
if (tp->mac_version >= RTL_GIGA_MAC_VER_40)
2477+
rtl_disable_rxdvgate(tp);
24752478
}
24762479

24772480
static void rtl_prepare_power_down(struct rtl8169_private *tp)
@@ -3992,7 +3995,7 @@ static void rtl8169_tx_clear(struct rtl8169_private *tp)
39923995
netdev_reset_queue(tp->dev);
39933996
}
39943997

3995-
static void rtl8169_cleanup(struct rtl8169_private *tp, bool going_down)
3998+
static void rtl8169_cleanup(struct rtl8169_private *tp)
39963999
{
39974000
napi_disable(&tp->napi);
39984001

@@ -4004,9 +4007,6 @@ static void rtl8169_cleanup(struct rtl8169_private *tp, bool going_down)
40044007

40054008
rtl_rx_close(tp);
40064009

4007-
if (going_down && tp->dev->wol_enabled)
4008-
goto no_reset;
4009-
40104010
switch (tp->mac_version) {
40114011
case RTL_GIGA_MAC_VER_27:
40124012
case RTL_GIGA_MAC_VER_28:
@@ -4028,7 +4028,7 @@ static void rtl8169_cleanup(struct rtl8169_private *tp, bool going_down)
40284028
}
40294029

40304030
rtl_hw_reset(tp);
4031-
no_reset:
4031+
40324032
rtl8169_tx_clear(tp);
40334033
rtl8169_init_ring_indexes(tp);
40344034
}
@@ -4039,7 +4039,7 @@ static void rtl_reset_work(struct rtl8169_private *tp)
40394039

40404040
netif_stop_queue(tp->dev);
40414041

4042-
rtl8169_cleanup(tp, false);
4042+
rtl8169_cleanup(tp);
40434043

40444044
for (i = 0; i < NUM_RX_DESC; i++)
40454045
rtl8169_mark_to_asic(tp->RxDescArray + i);
@@ -4727,7 +4727,7 @@ static void rtl8169_down(struct rtl8169_private *tp)
47274727
pci_clear_master(tp->pci_dev);
47284728
rtl_pci_commit(tp);
47294729

4730-
rtl8169_cleanup(tp, true);
4730+
rtl8169_cleanup(tp);
47314731
rtl_disable_exit_l1(tp);
47324732
rtl_prepare_power_down(tp);
47334733
}

0 commit comments

Comments
 (0)