generic: 6.12: sync r8169 patches with upstream

Upstream e2015942e90a couldn't be backported to 6.6 because the following
symbols were missing:
- disable_work
- disable_work_sync
- enable_work
See e2015942e9

Upstream 34e5ededf4b8 couldn't be backported to 6.6 because the following
symbol was missing:
- pcim_iomap_region
See 34e5ededf4

Reorganize patch numbers now that < 6.12 patches are no longer needed.

The following patches still differ from upstream:
- e340bff27e63
  phy_set_eee_broken symbol is missing in 6.12
  https://github.com/torvalds/linux/commit/e340bff27e63

The following patches can't be backported to 6.12 due to missing symbols:
- 5e7a74b6a357
  phy_disable_eee_mode symbol is missing in 6.12
  https://github.com/torvalds/linux/commit/5e7a74b6a357

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
Álvaro Fernández Rojas 2025-05-05 12:54:01 +02:00
parent 06f44f69b6
commit 94dbbe3496
33 changed files with 201 additions and 72 deletions

View file

@ -0,0 +1,94 @@
From e2015942e90a021151a5751776f35830ba063be7 Mon Sep 17 00:00:00 2001
From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Wed, 16 Oct 2024 22:06:53 +0200
Subject: [PATCH] r8169: replace custom flag with disable_work() et al
So far we use a custom flag to define when a task can be scheduled and
when not. Let's use the standard mechanism with disable_work() et al
instead.
Note that in rtl8169_close() we can remove the call to cancel_work()
because we now call disable_work_sync() in rtl8169_down() already.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
drivers/net/ethernet/realtek/r8169_main.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -617,7 +617,6 @@ struct rtl8169_tc_offsets {
};
enum rtl_flag {
- RTL_FLAG_TASK_ENABLED = 0,
RTL_FLAG_TASK_RESET_PENDING,
RTL_FLAG_TASK_RESET_NO_QUEUE_WAKE,
RTL_FLAG_TASK_TX_TIMEOUT,
@@ -2502,11 +2501,9 @@ u16 rtl8168h_2_get_adc_bias_ioffset(stru
static void rtl_schedule_task(struct rtl8169_private *tp, enum rtl_flag flag)
{
- if (!test_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags))
- return;
-
set_bit(flag, tp->wk.flags);
- schedule_work(&tp->wk.work);
+ if (!schedule_work(&tp->wk.work))
+ clear_bit(flag, tp->wk.flags);
}
static void rtl8169_init_phy(struct rtl8169_private *tp)
@@ -4800,9 +4797,6 @@ static void rtl_task(struct work_struct
container_of(work, struct rtl8169_private, wk.work);
int ret;
- if (!test_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags))
- return;
-
if (test_and_clear_bit(RTL_FLAG_TASK_TX_TIMEOUT, tp->wk.flags)) {
/* if chip isn't accessible, reset bus to revive it */
if (RTL_R32(tp, TxConfig) == ~0) {
@@ -4886,6 +4880,7 @@ static int r8169_phy_connect(struct rtl8
static void rtl8169_down(struct rtl8169_private *tp)
{
+ disable_work_sync(&tp->wk.work);
/* Clear all task flags */
bitmap_zero(tp->wk.flags, RTL_FLAG_MAX);
@@ -4914,7 +4909,7 @@ static void rtl8169_up(struct rtl8169_pr
phy_resume(tp->phydev);
rtl8169_init_phy(tp);
napi_enable(&tp->napi);
- set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);
+ enable_work(&tp->wk.work);
rtl_reset_work(tp);
phy_start(tp->phydev);
@@ -4931,8 +4926,6 @@ static int rtl8169_close(struct net_devi
rtl8169_down(tp);
rtl8169_rx_clear(tp);
- cancel_work(&tp->wk.work);
-
free_irq(tp->irq, tp);
phy_disconnect(tp->phydev);
@@ -5165,7 +5158,7 @@ static void rtl_remove_one(struct pci_de
if (pci_dev_run_wake(pdev))
pm_runtime_get_noresume(&pdev->dev);
- cancel_work_sync(&tp->wk.work);
+ disable_work_sync(&tp->wk.work);
if (IS_ENABLED(CONFIG_R8169_LEDS))
r8169_remove_leds(tp->leds);
@@ -5542,6 +5535,7 @@ static int rtl_init_one(struct pci_dev *
tp->irq = pci_irq_vector(pdev, 0);
INIT_WORK(&tp->wk.work, rtl_task);
+ disable_work(&tp->wk.work);
rtl_init_mac_address(tp);

View file

@ -15,7 +15,7 @@ Signed-off-by: Andrew Lunn <andrew@lunn.ch>
--- a/drivers/net/ethernet/realtek/r8169_main.c --- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -1346,40 +1346,19 @@ static void rtl8168ep_stop_cmac(struct r @@ -1345,40 +1345,19 @@ static void rtl8168ep_stop_cmac(struct r
RTL_W8(tp, IBCR0, RTL_R8(tp, IBCR0) & ~0x01); RTL_W8(tp, IBCR0, RTL_R8(tp, IBCR0) & ~0x01);
} }
@ -60,7 +60,7 @@ Signed-off-by: Andrew Lunn <andrew@lunn.ch>
} }
static void rtl8168_driver_start(struct rtl8169_private *tp) static void rtl8168_driver_start(struct rtl8169_private *tp)
@@ -1393,7 +1372,8 @@ static void rtl8168_driver_start(struct @@ -1392,7 +1371,8 @@ static void rtl8168_driver_start(struct
static void rtl8168dp_driver_stop(struct rtl8169_private *tp) static void rtl8168dp_driver_stop(struct rtl8169_private *tp)
{ {
r8168dp_oob_notify(tp, OOB_CMD_DRIVER_STOP); r8168dp_oob_notify(tp, OOB_CMD_DRIVER_STOP);
@ -70,7 +70,7 @@ Signed-off-by: Andrew Lunn <andrew@lunn.ch>
} }
static void rtl8168ep_driver_stop(struct rtl8169_private *tp) static void rtl8168ep_driver_stop(struct rtl8169_private *tp)
@@ -1401,7 +1381,8 @@ static void rtl8168ep_driver_stop(struct @@ -1400,7 +1380,8 @@ static void rtl8168ep_driver_stop(struct
rtl8168ep_stop_cmac(tp); rtl8168ep_stop_cmac(tp);
r8168ep_ocp_write(tp, 0x01, 0x180, OOB_CMD_DRIVER_STOP); r8168ep_ocp_write(tp, 0x01, 0x180, OOB_CMD_DRIVER_STOP);
r8168ep_ocp_write(tp, 0x01, 0x30, r8168ep_ocp_read(tp, 0x30) | 0x01); r8168ep_ocp_write(tp, 0x01, 0x30, r8168ep_ocp_read(tp, 0x30) | 0x01);

View file

@ -45,7 +45,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[RTL_GIGA_MAC_VER_65] = {"RTL8126A", FIRMWARE_8126A_2}, [RTL_GIGA_MAC_VER_65] = {"RTL8126A", FIRMWARE_8126A_2},
[RTL_GIGA_MAC_VER_66] = {"RTL8126A", FIRMWARE_8126A_3}, [RTL_GIGA_MAC_VER_66] = {"RTL8126A", FIRMWARE_8126A_3},
}; };
@@ -707,6 +709,7 @@ MODULE_FIRMWARE(FIRMWARE_8168FP_3); @@ -706,6 +708,7 @@ MODULE_FIRMWARE(FIRMWARE_8168FP_3);
MODULE_FIRMWARE(FIRMWARE_8107E_2); MODULE_FIRMWARE(FIRMWARE_8107E_2);
MODULE_FIRMWARE(FIRMWARE_8125A_3); MODULE_FIRMWARE(FIRMWARE_8125A_3);
MODULE_FIRMWARE(FIRMWARE_8125B_2); MODULE_FIRMWARE(FIRMWARE_8125B_2);
@ -53,7 +53,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
MODULE_FIRMWARE(FIRMWARE_8126A_2); MODULE_FIRMWARE(FIRMWARE_8126A_2);
MODULE_FIRMWARE(FIRMWARE_8126A_3); MODULE_FIRMWARE(FIRMWARE_8126A_3);
@@ -2079,10 +2082,7 @@ static void rtl_set_eee_txidle_timer(str @@ -2078,10 +2081,7 @@ static void rtl_set_eee_txidle_timer(str
tp->tx_lpi_timer = timer_val; tp->tx_lpi_timer = timer_val;
r8168_mac_ocp_write(tp, 0xe048, timer_val); r8168_mac_ocp_write(tp, 0xe048, timer_val);
break; break;
@ -65,7 +65,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tp->tx_lpi_timer = timer_val; tp->tx_lpi_timer = timer_val;
RTL_W16(tp, EEE_TXIDLE_TIMER_8125, timer_val); RTL_W16(tp, EEE_TXIDLE_TIMER_8125, timer_val);
break; break;
@@ -2293,6 +2293,9 @@ static enum mac_version rtl8169_get_mac_ @@ -2292,6 +2292,9 @@ static enum mac_version rtl8169_get_mac_
{ 0x7cf, 0x64a, RTL_GIGA_MAC_VER_66 }, { 0x7cf, 0x64a, RTL_GIGA_MAC_VER_66 },
{ 0x7cf, 0x649, RTL_GIGA_MAC_VER_65 }, { 0x7cf, 0x649, RTL_GIGA_MAC_VER_65 },
@ -75,7 +75,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* 8125B family. */ /* 8125B family. */
{ 0x7cf, 0x641, RTL_GIGA_MAC_VER_63 }, { 0x7cf, 0x641, RTL_GIGA_MAC_VER_63 },
@@ -2560,9 +2563,7 @@ static void rtl_init_rxcfg(struct rtl816 @@ -2557,9 +2560,7 @@ static void rtl_init_rxcfg(struct rtl816
case RTL_GIGA_MAC_VER_61: case RTL_GIGA_MAC_VER_61:
RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST); RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST);
break; break;
@ -86,7 +86,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST | RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST |
RX_PAUSE_SLOT_ON); RX_PAUSE_SLOT_ON);
break; break;
@@ -3874,6 +3875,12 @@ static void rtl_hw_start_8125b(struct rt @@ -3871,6 +3872,12 @@ static void rtl_hw_start_8125b(struct rt
rtl_hw_start_8125_common(tp); rtl_hw_start_8125_common(tp);
} }
@ -99,7 +99,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static void rtl_hw_start_8126a(struct rtl8169_private *tp) static void rtl_hw_start_8126a(struct rtl8169_private *tp)
{ {
rtl_set_def_aspm_entry_latency(tp); rtl_set_def_aspm_entry_latency(tp);
@@ -3922,6 +3929,7 @@ static void rtl_hw_config(struct rtl8169 @@ -3919,6 +3926,7 @@ static void rtl_hw_config(struct rtl8169
[RTL_GIGA_MAC_VER_53] = rtl_hw_start_8117, [RTL_GIGA_MAC_VER_53] = rtl_hw_start_8117,
[RTL_GIGA_MAC_VER_61] = rtl_hw_start_8125a_2, [RTL_GIGA_MAC_VER_61] = rtl_hw_start_8125a_2,
[RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b, [RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b,
@ -107,7 +107,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[RTL_GIGA_MAC_VER_65] = rtl_hw_start_8126a, [RTL_GIGA_MAC_VER_65] = rtl_hw_start_8126a,
[RTL_GIGA_MAC_VER_66] = rtl_hw_start_8126a, [RTL_GIGA_MAC_VER_66] = rtl_hw_start_8126a,
}; };
@@ -3939,6 +3947,7 @@ static void rtl_hw_start_8125(struct rtl @@ -3936,6 +3944,7 @@ static void rtl_hw_start_8125(struct rtl
/* disable interrupt coalescing */ /* disable interrupt coalescing */
switch (tp->mac_version) { switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_61: case RTL_GIGA_MAC_VER_61:

View file

@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/realtek/r8169_main.c --- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -2225,7 +2225,7 @@ static void rtl8169_get_eth_mac_stats(st @@ -2224,7 +2224,7 @@ static void rtl8169_get_eth_mac_stats(st
le64_to_cpu(tp->counters->tx_broadcast64); le64_to_cpu(tp->counters->tx_broadcast64);
mac_stats->MulticastFramesReceivedOK = mac_stats->MulticastFramesReceivedOK =
le64_to_cpu(tp->counters->rx_multicast64); le64_to_cpu(tp->counters->rx_multicast64);

View file

@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
EEE_TXIDLE_TIMER_8125 = 0x6048, EEE_TXIDLE_TIMER_8125 = 0x6048,
}; };
@@ -3768,8 +3770,8 @@ static void rtl_hw_start_8125_common(str @@ -3765,8 +3767,8 @@ static void rtl_hw_start_8125_common(str
rtl_pcie_state_l2l3_disable(tp); rtl_pcie_state_l2l3_disable(tp);
RTL_W16(tp, 0x382, 0x221b); RTL_W16(tp, 0x382, 0x221b);

View file

@ -15,7 +15,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/realtek/r8169_main.c --- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -662,13 +662,9 @@ struct rtl8169_private { @@ -661,13 +661,9 @@ struct rtl8169_private {
struct work_struct work; struct work_struct work;
} wk; } wk;
@ -29,7 +29,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
unsigned supports_gmii:1; unsigned supports_gmii:1;
unsigned aspm_manageable:1; unsigned aspm_manageable:1;
unsigned dash_enabled:1; unsigned dash_enabled:1;
@@ -722,22 +718,12 @@ static inline struct device *tp_to_dev(s @@ -721,22 +717,12 @@ static inline struct device *tp_to_dev(s
static void rtl_lock_config_regs(struct rtl8169_private *tp) static void rtl_lock_config_regs(struct rtl8169_private *tp)
{ {
@ -54,7 +54,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
} }
static void rtl_pci_commit(struct rtl8169_private *tp) static void rtl_pci_commit(struct rtl8169_private *tp)
@@ -748,24 +734,18 @@ static void rtl_pci_commit(struct rtl816 @@ -747,24 +733,18 @@ static void rtl_pci_commit(struct rtl816
static void rtl_mod_config2(struct rtl8169_private *tp, u8 clear, u8 set) static void rtl_mod_config2(struct rtl8169_private *tp, u8 clear, u8 set)
{ {
@ -79,7 +79,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
} }
static bool rtl_is_8125(struct rtl8169_private *tp) static bool rtl_is_8125(struct rtl8169_private *tp)
@@ -1571,7 +1551,6 @@ static void __rtl8169_set_wol(struct rtl @@ -1570,7 +1550,6 @@ static void __rtl8169_set_wol(struct rtl
{ WAKE_MAGIC, Config3, MagicPacket } { WAKE_MAGIC, Config3, MagicPacket }
}; };
unsigned int i, tmp = ARRAY_SIZE(cfg); unsigned int i, tmp = ARRAY_SIZE(cfg);
@ -87,7 +87,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
u8 options; u8 options;
rtl_unlock_config_regs(tp); rtl_unlock_config_regs(tp);
@@ -1590,14 +1569,12 @@ static void __rtl8169_set_wol(struct rtl @@ -1589,14 +1568,12 @@ static void __rtl8169_set_wol(struct rtl
r8168_mac_ocp_modify(tp, 0xc0b6, BIT(0), 0); r8168_mac_ocp_modify(tp, 0xc0b6, BIT(0), 0);
} }
@ -102,7 +102,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
switch (tp->mac_version) { switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_02 ... RTL_GIGA_MAC_VER_06: case RTL_GIGA_MAC_VER_02 ... RTL_GIGA_MAC_VER_06:
@@ -5458,8 +5435,6 @@ static int rtl_init_one(struct pci_dev * @@ -5451,8 +5428,6 @@ static int rtl_init_one(struct pci_dev *
tp->supports_gmii = ent->driver_data == RTL_CFG_NO_GBIT ? 0 : 1; tp->supports_gmii = ent->driver_data == RTL_CFG_NO_GBIT ? 0 : 1;
tp->ocp_base = OCP_STD_PHY_BASE; tp->ocp_base = OCP_STD_PHY_BASE;

View file

@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/realtek/r8169_main.c --- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -748,6 +748,20 @@ static void rtl_mod_config5(struct rtl81 @@ -747,6 +747,20 @@ static void rtl_mod_config5(struct rtl81
RTL_W8(tp, Config5, (val & ~clear) | set); RTL_W8(tp, Config5, (val & ~clear) | set);
} }
@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static bool rtl_is_8125(struct rtl8169_private *tp) static bool rtl_is_8125(struct rtl8169_private *tp)
{ {
return tp->mac_version >= RTL_GIGA_MAC_VER_61; return tp->mac_version >= RTL_GIGA_MAC_VER_61;
@@ -1538,58 +1552,37 @@ static void rtl8169_get_wol(struct net_d @@ -1537,58 +1551,37 @@ static void rtl8169_get_wol(struct net_d
static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts) static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts)
{ {

View file

@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/realtek/r8169_main.c --- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -1431,19 +1431,11 @@ static enum rtl_dash_type rtl_get_dash_t @@ -1430,19 +1430,11 @@ static enum rtl_dash_type rtl_get_dash_t
static void rtl_set_d3_pll_down(struct rtl8169_private *tp, bool enable) static void rtl_set_d3_pll_down(struct rtl8169_private *tp, bool enable)
{ {

View file

@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/realtek/r8169_main.c --- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -1562,6 +1562,9 @@ static void __rtl8169_set_wol(struct rtl @@ -1561,6 +1561,9 @@ static void __rtl8169_set_wol(struct rtl
} }
r8169_mod_reg8_cond(tp, Config3, LinkUp, wolopts & WAKE_PHY); r8169_mod_reg8_cond(tp, Config3, LinkUp, wolopts & WAKE_PHY);

View file

@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/realtek/r8169_main.c --- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -2545,86 +2545,31 @@ static void rtl8169_init_ring_indexes(st @@ -2542,86 +2542,31 @@ static void rtl8169_init_ring_indexes(st
tp->dirty_tx = tp->cur_tx = tp->cur_rx = 0; tp->dirty_tx = tp->cur_tx = tp->cur_rx = 0;
} }

View file

@ -22,7 +22,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/realtek/r8169_main.c --- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5234,6 +5234,11 @@ static int r8169_mdio_register(struct rt @@ -5227,6 +5227,11 @@ static int r8169_mdio_register(struct rt
phy_support_eee(tp->phydev); phy_support_eee(tp->phydev);
phy_support_asym_pause(tp->phydev); phy_support_asym_pause(tp->phydev);

View file

@ -16,15 +16,15 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/realtek/r8169_main.c --- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -623,7 +623,6 @@ struct rtl8169_tc_offsets { @@ -622,7 +622,6 @@ struct rtl8169_tc_offsets {
enum rtl_flag { enum rtl_flag {
RTL_FLAG_TASK_ENABLED = 0,
RTL_FLAG_TASK_RESET_PENDING, RTL_FLAG_TASK_RESET_PENDING,
- RTL_FLAG_TASK_RESET_NO_QUEUE_WAKE, - RTL_FLAG_TASK_RESET_NO_QUEUE_WAKE,
RTL_FLAG_TASK_TX_TIMEOUT, RTL_FLAG_TASK_TX_TIMEOUT,
RTL_FLAG_MAX RTL_FLAG_MAX
}; };
@@ -4728,8 +4727,6 @@ static void rtl_task(struct work_struct @@ -4722,8 +4721,6 @@ static void rtl_task(struct work_struct
reset: reset:
rtl_reset_work(tp); rtl_reset_work(tp);
netif_wake_queue(tp->dev); netif_wake_queue(tp->dev);

View file

@ -38,7 +38,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[RTL_GIGA_MAC_VER_14] = {"RTL8401" }, [RTL_GIGA_MAC_VER_14] = {"RTL8401" },
[RTL_GIGA_MAC_VER_17] = {"RTL8168b/8111b" }, [RTL_GIGA_MAC_VER_17] = {"RTL8168b/8111b" },
[RTL_GIGA_MAC_VER_18] = {"RTL8168cp/8111cp" }, [RTL_GIGA_MAC_VER_18] = {"RTL8168cp/8111cp" },
@@ -2335,7 +2334,7 @@ static enum mac_version rtl8169_get_mac_ @@ -2334,7 +2333,7 @@ static enum mac_version rtl8169_get_mac_
/* 8168B family. */ /* 8168B family. */
{ 0x7c8, 0x380, RTL_GIGA_MAC_VER_17 }, { 0x7c8, 0x380, RTL_GIGA_MAC_VER_17 },
@ -47,7 +47,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
* { 0x7c8, 0x300, RTL_GIGA_MAC_VER_11 }, * { 0x7c8, 0x300, RTL_GIGA_MAC_VER_11 },
*/ */
@@ -3805,7 +3804,6 @@ static void rtl_hw_config(struct rtl8169 @@ -3802,7 +3801,6 @@ static void rtl_hw_config(struct rtl8169
[RTL_GIGA_MAC_VER_08] = rtl_hw_start_8102e_3, [RTL_GIGA_MAC_VER_08] = rtl_hw_start_8102e_3,
[RTL_GIGA_MAC_VER_09] = rtl_hw_start_8102e_2, [RTL_GIGA_MAC_VER_09] = rtl_hw_start_8102e_2,
[RTL_GIGA_MAC_VER_10] = NULL, [RTL_GIGA_MAC_VER_10] = NULL,
@ -55,7 +55,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[RTL_GIGA_MAC_VER_14] = rtl_hw_start_8401, [RTL_GIGA_MAC_VER_14] = rtl_hw_start_8401,
[RTL_GIGA_MAC_VER_17] = rtl_hw_start_8168b, [RTL_GIGA_MAC_VER_17] = rtl_hw_start_8168b,
[RTL_GIGA_MAC_VER_18] = rtl_hw_start_8168cp_1, [RTL_GIGA_MAC_VER_18] = rtl_hw_start_8168cp_1,
@@ -4681,12 +4679,6 @@ static irqreturn_t rtl8169_interrupt(int @@ -4678,12 +4676,6 @@ static irqreturn_t rtl8169_interrupt(int
if (status & LinkChg) if (status & LinkChg)
phy_mac_interrupt(tp->phydev); phy_mac_interrupt(tp->phydev);
@ -68,7 +68,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
rtl_irq_disable(tp); rtl_irq_disable(tp);
napi_schedule(&tp->napi); napi_schedule(&tp->napi);
out: out:
@@ -5106,9 +5098,6 @@ static void rtl_set_irq_mask(struct rtl8 @@ -5099,9 +5091,6 @@ static void rtl_set_irq_mask(struct rtl8
if (tp->mac_version <= RTL_GIGA_MAC_VER_06) if (tp->mac_version <= RTL_GIGA_MAC_VER_06)
tp->irq_mask |= SYSErr | RxFIFOOver; tp->irq_mask |= SYSErr | RxFIFOOver;
@ -78,7 +78,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
} }
static int rtl_alloc_irq(struct rtl8169_private *tp) static int rtl_alloc_irq(struct rtl8169_private *tp)
@@ -5302,7 +5291,6 @@ static int rtl_jumbo_max(struct rtl8169_ @@ -5295,7 +5284,6 @@ static int rtl_jumbo_max(struct rtl8169_
case RTL_GIGA_MAC_VER_02 ... RTL_GIGA_MAC_VER_06: case RTL_GIGA_MAC_VER_02 ... RTL_GIGA_MAC_VER_06:
return JUMBO_7K; return JUMBO_7K;
/* RTL8168b */ /* RTL8168b */

View file

@ -42,7 +42,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}; };
static const struct pci_device_id rtl8169_pci_tbl[] = { static const struct pci_device_id rtl8169_pci_tbl[] = {
@@ -1228,7 +1228,7 @@ static void rtl_writephy(struct rtl8169_ @@ -1227,7 +1227,7 @@ static void rtl_writephy(struct rtl8169_
case RTL_GIGA_MAC_VER_31: case RTL_GIGA_MAC_VER_31:
r8168dp_2_mdio_write(tp, location, val); r8168dp_2_mdio_write(tp, location, val);
break; break;
@ -51,7 +51,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8168g_mdio_write(tp, location, val); r8168g_mdio_write(tp, location, val);
break; break;
default: default:
@@ -1243,7 +1243,7 @@ static int rtl_readphy(struct rtl8169_pr @@ -1242,7 +1242,7 @@ static int rtl_readphy(struct rtl8169_pr
case RTL_GIGA_MAC_VER_28: case RTL_GIGA_MAC_VER_28:
case RTL_GIGA_MAC_VER_31: case RTL_GIGA_MAC_VER_31:
return r8168dp_2_mdio_read(tp, location); return r8168dp_2_mdio_read(tp, location);
@ -60,7 +60,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
return r8168g_mdio_read(tp, location); return r8168g_mdio_read(tp, location);
default: default:
return r8169_mdio_read(tp, location); return r8169_mdio_read(tp, location);
@@ -1574,7 +1574,7 @@ static void __rtl8169_set_wol(struct rtl @@ -1573,7 +1573,7 @@ static void __rtl8169_set_wol(struct rtl
break; break;
case RTL_GIGA_MAC_VER_34: case RTL_GIGA_MAC_VER_34:
case RTL_GIGA_MAC_VER_37: case RTL_GIGA_MAC_VER_37:
@ -69,7 +69,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8169_mod_reg8_cond(tp, Config2, PME_SIGNAL, wolopts); r8169_mod_reg8_cond(tp, Config2, PME_SIGNAL, wolopts);
break; break;
default: default:
@@ -2047,7 +2047,7 @@ static void rtl_set_eee_txidle_timer(str @@ -2046,7 +2046,7 @@ static void rtl_set_eee_txidle_timer(str
tp->tx_lpi_timer = timer_val; tp->tx_lpi_timer = timer_val;
r8168_mac_ocp_write(tp, 0xe048, timer_val); r8168_mac_ocp_write(tp, 0xe048, timer_val);
break; break;
@ -78,7 +78,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tp->tx_lpi_timer = timer_val; tp->tx_lpi_timer = timer_val;
RTL_W16(tp, EEE_TXIDLE_TIMER_8125, timer_val); RTL_W16(tp, EEE_TXIDLE_TIMER_8125, timer_val);
break; break;
@@ -2255,8 +2255,8 @@ static enum mac_version rtl8169_get_mac_ @@ -2254,8 +2254,8 @@ static enum mac_version rtl8169_get_mac_
enum mac_version ver; enum mac_version ver;
} mac_info[] = { } mac_info[] = {
/* 8126A family. */ /* 8126A family. */
@ -89,7 +89,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* 8125D family. */ /* 8125D family. */
{ 0x7cf, 0x688, RTL_GIGA_MAC_VER_64 }, { 0x7cf, 0x688, RTL_GIGA_MAC_VER_64 },
@@ -2528,7 +2528,7 @@ static void rtl_init_rxcfg(struct rtl816 @@ -2525,7 +2525,7 @@ static void rtl_init_rxcfg(struct rtl816
case RTL_GIGA_MAC_VER_61: case RTL_GIGA_MAC_VER_61:
RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST); RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST);
break; break;
@ -98,7 +98,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST | RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST |
RX_PAUSE_SLOT_ON); RX_PAUSE_SLOT_ON);
break; break;
@@ -2660,7 +2660,7 @@ static void rtl_wait_txrx_fifo_empty(str @@ -2657,7 +2657,7 @@ static void rtl_wait_txrx_fifo_empty(str
case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_61: case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_61:
rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond, 100, 42); rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond, 100, 42);
break; break;
@ -107,7 +107,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
RTL_W8(tp, ChipCmd, RTL_R8(tp, ChipCmd) | StopReq); RTL_W8(tp, ChipCmd, RTL_R8(tp, ChipCmd) | StopReq);
rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond, 100, 42); rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond, 100, 42);
rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond_2, 100, 42); rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond_2, 100, 42);
@@ -2903,7 +2903,7 @@ static void rtl_enable_exit_l1(struct rt @@ -2900,7 +2900,7 @@ static void rtl_enable_exit_l1(struct rt
case RTL_GIGA_MAC_VER_37 ... RTL_GIGA_MAC_VER_38: case RTL_GIGA_MAC_VER_37 ... RTL_GIGA_MAC_VER_38:
rtl_eri_set_bits(tp, 0xd4, 0x0c00); rtl_eri_set_bits(tp, 0xd4, 0x0c00);
break; break;
@ -116,7 +116,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8168_mac_ocp_modify(tp, 0xc0ac, 0, 0x1f80); r8168_mac_ocp_modify(tp, 0xc0ac, 0, 0x1f80);
break; break;
default: default:
@@ -2917,7 +2917,7 @@ static void rtl_disable_exit_l1(struct r @@ -2914,7 +2914,7 @@ static void rtl_disable_exit_l1(struct r
case RTL_GIGA_MAC_VER_34 ... RTL_GIGA_MAC_VER_38: case RTL_GIGA_MAC_VER_34 ... RTL_GIGA_MAC_VER_38:
rtl_eri_clear_bits(tp, 0xd4, 0x1f00); rtl_eri_clear_bits(tp, 0xd4, 0x1f00);
break; break;
@ -125,7 +125,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8168_mac_ocp_modify(tp, 0xc0ac, 0x1f80, 0); r8168_mac_ocp_modify(tp, 0xc0ac, 0x1f80, 0);
break; break;
default: default:
@@ -2943,8 +2943,8 @@ static void rtl_hw_aspm_clkreq_enable(st @@ -2940,8 +2940,8 @@ static void rtl_hw_aspm_clkreq_enable(st
rtl_mod_config5(tp, 0, ASPM_en); rtl_mod_config5(tp, 0, ASPM_en);
switch (tp->mac_version) { switch (tp->mac_version) {
@ -136,7 +136,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
val8 = RTL_R8(tp, INT_CFG0_8125) | INT_CFG0_CLKREQEN; val8 = RTL_R8(tp, INT_CFG0_8125) | INT_CFG0_CLKREQEN;
RTL_W8(tp, INT_CFG0_8125, val8); RTL_W8(tp, INT_CFG0_8125, val8);
break; break;
@@ -2955,7 +2955,7 @@ static void rtl_hw_aspm_clkreq_enable(st @@ -2952,7 +2952,7 @@ static void rtl_hw_aspm_clkreq_enable(st
switch (tp->mac_version) { switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_46 ... RTL_GIGA_MAC_VER_48: case RTL_GIGA_MAC_VER_46 ... RTL_GIGA_MAC_VER_48:
@ -145,7 +145,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* reset ephy tx/rx disable timer */ /* reset ephy tx/rx disable timer */
r8168_mac_ocp_modify(tp, 0xe094, 0xff00, 0); r8168_mac_ocp_modify(tp, 0xe094, 0xff00, 0);
/* chip can trigger L1.2 */ /* chip can trigger L1.2 */
@@ -2967,7 +2967,7 @@ static void rtl_hw_aspm_clkreq_enable(st @@ -2964,7 +2964,7 @@ static void rtl_hw_aspm_clkreq_enable(st
} else { } else {
switch (tp->mac_version) { switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_46 ... RTL_GIGA_MAC_VER_48: case RTL_GIGA_MAC_VER_46 ... RTL_GIGA_MAC_VER_48:
@ -154,7 +154,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8168_mac_ocp_modify(tp, 0xe092, 0x00ff, 0); r8168_mac_ocp_modify(tp, 0xe092, 0x00ff, 0);
break; break;
default: default:
@@ -2975,8 +2975,8 @@ static void rtl_hw_aspm_clkreq_enable(st @@ -2972,8 +2972,8 @@ static void rtl_hw_aspm_clkreq_enable(st
} }
switch (tp->mac_version) { switch (tp->mac_version) {
@ -165,7 +165,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
val8 = RTL_R8(tp, INT_CFG0_8125) & ~INT_CFG0_CLKREQEN; val8 = RTL_R8(tp, INT_CFG0_8125) & ~INT_CFG0_CLKREQEN;
RTL_W8(tp, INT_CFG0_8125, val8); RTL_W8(tp, INT_CFG0_8125, val8);
break; break;
@@ -3696,12 +3696,12 @@ static void rtl_hw_start_8125_common(str @@ -3693,12 +3693,12 @@ static void rtl_hw_start_8125_common(str
/* disable new tx descriptor format */ /* disable new tx descriptor format */
r8168_mac_ocp_modify(tp, 0xeb58, 0x0001, 0x0000); r8168_mac_ocp_modify(tp, 0xeb58, 0x0001, 0x0000);
@ -182,7 +182,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0400); r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0400);
else if (tp->mac_version == RTL_GIGA_MAC_VER_63) else if (tp->mac_version == RTL_GIGA_MAC_VER_63)
r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0200); r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0200);
@@ -3719,8 +3719,8 @@ static void rtl_hw_start_8125_common(str @@ -3716,8 +3716,8 @@ static void rtl_hw_start_8125_common(str
r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0030); r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0030);
r8168_mac_ocp_modify(tp, 0xe040, 0x1000, 0x0000); r8168_mac_ocp_modify(tp, 0xe040, 0x1000, 0x0000);
r8168_mac_ocp_modify(tp, 0xea1c, 0x0003, 0x0001); r8168_mac_ocp_modify(tp, 0xea1c, 0x0003, 0x0001);
@ -193,7 +193,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8168_mac_ocp_modify(tp, 0xea1c, 0x0300, 0x0000); r8168_mac_ocp_modify(tp, 0xea1c, 0x0300, 0x0000);
else else
r8168_mac_ocp_modify(tp, 0xea1c, 0x0004, 0x0000); r8168_mac_ocp_modify(tp, 0xea1c, 0x0004, 0x0000);
@@ -3839,8 +3839,8 @@ static void rtl_hw_config(struct rtl8169 @@ -3836,8 +3836,8 @@ static void rtl_hw_config(struct rtl8169
[RTL_GIGA_MAC_VER_61] = rtl_hw_start_8125a_2, [RTL_GIGA_MAC_VER_61] = rtl_hw_start_8125a_2,
[RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b, [RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b,
[RTL_GIGA_MAC_VER_64] = rtl_hw_start_8125d, [RTL_GIGA_MAC_VER_64] = rtl_hw_start_8125d,
@ -204,7 +204,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}; };
if (hw_configs[tp->mac_version]) if (hw_configs[tp->mac_version])
@@ -3861,8 +3861,8 @@ static void rtl_hw_start_8125(struct rtl @@ -3858,8 +3858,8 @@ static void rtl_hw_start_8125(struct rtl
RTL_W32(tp, i, 0); RTL_W32(tp, i, 0);
break; break;
case RTL_GIGA_MAC_VER_63: case RTL_GIGA_MAC_VER_63:
@ -215,7 +215,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
for (i = 0xa00; i < 0xa80; i += 4) for (i = 0xa00; i < 0xa80; i += 4)
RTL_W32(tp, i, 0); RTL_W32(tp, i, 0);
RTL_W16(tp, INT_CFG1_8125, 0x0000); RTL_W16(tp, INT_CFG1_8125, 0x0000);
@@ -4094,7 +4094,7 @@ static void rtl8169_cleanup(struct rtl81 @@ -4091,7 +4091,7 @@ static void rtl8169_cleanup(struct rtl81
RTL_W8(tp, ChipCmd, RTL_R8(tp, ChipCmd) | StopReq); RTL_W8(tp, ChipCmd, RTL_R8(tp, ChipCmd) | StopReq);
rtl_loop_wait_high(tp, &rtl_txcfg_empty_cond, 100, 666); rtl_loop_wait_high(tp, &rtl_txcfg_empty_cond, 100, 666);
break; break;
@ -224,7 +224,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
rtl_enable_rxdvgate(tp); rtl_enable_rxdvgate(tp);
fsleep(2000); fsleep(2000);
break; break;
@@ -4251,7 +4251,7 @@ static unsigned int rtl_quirk_packet_pad @@ -4248,7 +4248,7 @@ static unsigned int rtl_quirk_packet_pad
switch (tp->mac_version) { switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_34: case RTL_GIGA_MAC_VER_34:
@ -233,7 +233,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
padto = max_t(unsigned int, padto, ETH_ZLEN); padto = max_t(unsigned int, padto, ETH_ZLEN);
break; break;
default: default:
@@ -5272,7 +5272,7 @@ static void rtl_hw_initialize(struct rtl @@ -5265,7 +5265,7 @@ static void rtl_hw_initialize(struct rtl
case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_48: case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_48:
rtl_hw_init_8168g(tp); rtl_hw_init_8168g(tp);
break; break;

View file

@ -46,7 +46,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[RTL_GIGA_MAC_VER_70] = {"RTL8126A", FIRMWARE_8126A_2}, [RTL_GIGA_MAC_VER_70] = {"RTL8126A", FIRMWARE_8126A_2},
[RTL_GIGA_MAC_VER_71] = {"RTL8126A", FIRMWARE_8126A_3}, [RTL_GIGA_MAC_VER_71] = {"RTL8126A", FIRMWARE_8126A_3},
}; };
@@ -706,6 +708,7 @@ MODULE_FIRMWARE(FIRMWARE_8107E_2); @@ -705,6 +707,7 @@ MODULE_FIRMWARE(FIRMWARE_8107E_2);
MODULE_FIRMWARE(FIRMWARE_8125A_3); MODULE_FIRMWARE(FIRMWARE_8125A_3);
MODULE_FIRMWARE(FIRMWARE_8125B_2); MODULE_FIRMWARE(FIRMWARE_8125B_2);
MODULE_FIRMWARE(FIRMWARE_8125D_1); MODULE_FIRMWARE(FIRMWARE_8125D_1);
@ -54,7 +54,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
MODULE_FIRMWARE(FIRMWARE_8126A_2); MODULE_FIRMWARE(FIRMWARE_8126A_2);
MODULE_FIRMWARE(FIRMWARE_8126A_3); MODULE_FIRMWARE(FIRMWARE_8126A_3);
@@ -2259,6 +2262,7 @@ static enum mac_version rtl8169_get_mac_ @@ -2258,6 +2261,7 @@ static enum mac_version rtl8169_get_mac_
{ 0x7cf, 0x649, RTL_GIGA_MAC_VER_70 }, { 0x7cf, 0x649, RTL_GIGA_MAC_VER_70 },
/* 8125D family. */ /* 8125D family. */
@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
{ 0x7cf, 0x688, RTL_GIGA_MAC_VER_64 }, { 0x7cf, 0x688, RTL_GIGA_MAC_VER_64 },
/* 8125B family. */ /* 8125B family. */
@@ -3839,6 +3843,7 @@ static void rtl_hw_config(struct rtl8169 @@ -3836,6 +3840,7 @@ static void rtl_hw_config(struct rtl8169
[RTL_GIGA_MAC_VER_61] = rtl_hw_start_8125a_2, [RTL_GIGA_MAC_VER_61] = rtl_hw_start_8125a_2,
[RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b, [RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b,
[RTL_GIGA_MAC_VER_64] = rtl_hw_start_8125d, [RTL_GIGA_MAC_VER_64] = rtl_hw_start_8125d,
@ -70,7 +70,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[RTL_GIGA_MAC_VER_70] = rtl_hw_start_8126a, [RTL_GIGA_MAC_VER_70] = rtl_hw_start_8126a,
[RTL_GIGA_MAC_VER_71] = rtl_hw_start_8126a, [RTL_GIGA_MAC_VER_71] = rtl_hw_start_8126a,
}; };
@@ -3857,6 +3862,7 @@ static void rtl_hw_start_8125(struct rtl @@ -3854,6 +3859,7 @@ static void rtl_hw_start_8125(struct rtl
switch (tp->mac_version) { switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_61: case RTL_GIGA_MAC_VER_61:
case RTL_GIGA_MAC_VER_64: case RTL_GIGA_MAC_VER_64:

View file

@ -44,7 +44,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[RTL_GIGA_MAC_VER_70] = {"RTL8126A", FIRMWARE_8126A_2}, [RTL_GIGA_MAC_VER_70] = {"RTL8126A", FIRMWARE_8126A_2},
[RTL_GIGA_MAC_VER_71] = {"RTL8126A", FIRMWARE_8126A_3}, [RTL_GIGA_MAC_VER_71] = {"RTL8126A", FIRMWARE_8126A_3},
}; };
@@ -632,6 +634,7 @@ enum rtl_dash_type { @@ -631,6 +633,7 @@ enum rtl_dash_type {
RTL_DASH_NONE, RTL_DASH_NONE,
RTL_DASH_DP, RTL_DASH_DP,
RTL_DASH_EP, RTL_DASH_EP,
@ -52,7 +52,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}; };
struct rtl8169_private { struct rtl8169_private {
@@ -709,6 +712,7 @@ MODULE_FIRMWARE(FIRMWARE_8125A_3); @@ -708,6 +711,7 @@ MODULE_FIRMWARE(FIRMWARE_8125A_3);
MODULE_FIRMWARE(FIRMWARE_8125B_2); MODULE_FIRMWARE(FIRMWARE_8125B_2);
MODULE_FIRMWARE(FIRMWARE_8125D_1); MODULE_FIRMWARE(FIRMWARE_8125D_1);
MODULE_FIRMWARE(FIRMWARE_8125D_2); MODULE_FIRMWARE(FIRMWARE_8125D_2);
@ -60,7 +60,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
MODULE_FIRMWARE(FIRMWARE_8126A_2); MODULE_FIRMWARE(FIRMWARE_8126A_2);
MODULE_FIRMWARE(FIRMWARE_8126A_3); MODULE_FIRMWARE(FIRMWARE_8126A_3);
@@ -1361,10 +1365,19 @@ static void rtl8168ep_driver_start(struc @@ -1360,10 +1364,19 @@ static void rtl8168ep_driver_start(struc
rtl_loop_wait_high(tp, &rtl_ep_ocp_read_cond, 10000, 30); rtl_loop_wait_high(tp, &rtl_ep_ocp_read_cond, 10000, 30);
} }
@ -80,7 +80,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
else else
rtl8168ep_driver_start(tp); rtl8168ep_driver_start(tp);
} }
@@ -1385,10 +1398,19 @@ static void rtl8168ep_driver_stop(struct @@ -1384,10 +1397,19 @@ static void rtl8168ep_driver_stop(struct
rtl_loop_wait_low(tp, &rtl_ep_ocp_read_cond, 10000, 10); rtl_loop_wait_low(tp, &rtl_ep_ocp_read_cond, 10000, 10);
} }
@ -100,7 +100,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
else else
rtl8168ep_driver_stop(tp); rtl8168ep_driver_stop(tp);
} }
@@ -1411,6 +1433,7 @@ static bool rtl_dash_is_enabled(struct r @@ -1410,6 +1432,7 @@ static bool rtl_dash_is_enabled(struct r
case RTL_DASH_DP: case RTL_DASH_DP:
return r8168dp_check_dash(tp); return r8168dp_check_dash(tp);
case RTL_DASH_EP: case RTL_DASH_EP:
@ -108,7 +108,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return r8168ep_check_dash(tp); return r8168ep_check_dash(tp);
default: default:
return false; return false;
@@ -1425,6 +1448,8 @@ static enum rtl_dash_type rtl_get_dash_t @@ -1424,6 +1447,8 @@ static enum rtl_dash_type rtl_get_dash_t
return RTL_DASH_DP; return RTL_DASH_DP;
case RTL_GIGA_MAC_VER_51 ... RTL_GIGA_MAC_VER_53: case RTL_GIGA_MAC_VER_51 ... RTL_GIGA_MAC_VER_53:
return RTL_DASH_EP; return RTL_DASH_EP;
@ -117,7 +117,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
default: default:
return RTL_DASH_NONE; return RTL_DASH_NONE;
} }
@@ -2261,6 +2286,9 @@ static enum mac_version rtl8169_get_mac_ @@ -2260,6 +2285,9 @@ static enum mac_version rtl8169_get_mac_
{ 0x7cf, 0x64a, RTL_GIGA_MAC_VER_71 }, { 0x7cf, 0x64a, RTL_GIGA_MAC_VER_71 },
{ 0x7cf, 0x649, RTL_GIGA_MAC_VER_70 }, { 0x7cf, 0x649, RTL_GIGA_MAC_VER_70 },
@ -127,7 +127,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* 8125D family. */ /* 8125D family. */
{ 0x7cf, 0x689, RTL_GIGA_MAC_VER_65 }, { 0x7cf, 0x689, RTL_GIGA_MAC_VER_65 },
{ 0x7cf, 0x688, RTL_GIGA_MAC_VER_64 }, { 0x7cf, 0x688, RTL_GIGA_MAC_VER_64 },
@@ -3844,6 +3872,7 @@ static void rtl_hw_config(struct rtl8169 @@ -3841,6 +3869,7 @@ static void rtl_hw_config(struct rtl8169
[RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b, [RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b,
[RTL_GIGA_MAC_VER_64] = rtl_hw_start_8125d, [RTL_GIGA_MAC_VER_64] = rtl_hw_start_8125d,
[RTL_GIGA_MAC_VER_65] = rtl_hw_start_8125d, [RTL_GIGA_MAC_VER_65] = rtl_hw_start_8125d,
@ -135,7 +135,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[RTL_GIGA_MAC_VER_70] = rtl_hw_start_8126a, [RTL_GIGA_MAC_VER_70] = rtl_hw_start_8126a,
[RTL_GIGA_MAC_VER_71] = rtl_hw_start_8126a, [RTL_GIGA_MAC_VER_71] = rtl_hw_start_8126a,
}; };
@@ -3863,6 +3892,7 @@ static void rtl_hw_start_8125(struct rtl @@ -3860,6 +3889,7 @@ static void rtl_hw_start_8125(struct rtl
case RTL_GIGA_MAC_VER_61: case RTL_GIGA_MAC_VER_61:
case RTL_GIGA_MAC_VER_64: case RTL_GIGA_MAC_VER_64:
case RTL_GIGA_MAC_VER_65: case RTL_GIGA_MAC_VER_65:

View file

@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/realtek/r8169_main.c --- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5229,6 +5229,7 @@ static int r8169_mdio_register(struct rt @@ -5222,6 +5222,7 @@ static int r8169_mdio_register(struct rt
new_bus->priv = tp; new_bus->priv = tp;
new_bus->parent = &pdev->dev; new_bus->parent = &pdev->dev;
new_bus->irq[0] = PHY_MAC_INTERRUPT; new_bus->irq[0] = PHY_MAC_INTERRUPT;

View file

@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/realtek/r8169_main.c --- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5207,6 +5207,33 @@ static int r8169_mdio_write_reg(struct m @@ -5200,6 +5200,33 @@ static int r8169_mdio_write_reg(struct m
return 0; return 0;
} }
@ -53,7 +53,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static int r8169_mdio_register(struct rtl8169_private *tp) static int r8169_mdio_register(struct rtl8169_private *tp)
{ {
struct pci_dev *pdev = tp->pci_dev; struct pci_dev *pdev = tp->pci_dev;
@@ -5237,6 +5264,11 @@ static int r8169_mdio_register(struct rt @@ -5230,6 +5257,11 @@ static int r8169_mdio_register(struct rt
new_bus->read = r8169_mdio_read_reg; new_bus->read = r8169_mdio_read_reg;
new_bus->write = r8169_mdio_write_reg; new_bus->write = r8169_mdio_write_reg;

View file

@ -28,7 +28,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static const struct { static const struct {
const char *name; const char *name;
@@ -5366,6 +5367,9 @@ static int rtl_jumbo_max(struct rtl8169_ @@ -5359,6 +5360,9 @@ static int rtl_jumbo_max(struct rtl8169_
/* RTL8168c */ /* RTL8168c */
case RTL_GIGA_MAC_VER_18 ... RTL_GIGA_MAC_VER_24: case RTL_GIGA_MAC_VER_18 ... RTL_GIGA_MAC_VER_24:
return JUMBO_6K; return JUMBO_6K;

View file

@ -0,0 +1,35 @@
From 34e5ededf4b8ad4c9e58f0cab8596e26c8fa59a2 Mon Sep 17 00:00:00 2001
From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Wed, 12 Mar 2025 20:21:42 +0100
Subject: [PATCH] r8169: switch away from deprecated pcim_iomap_table
Avoid using deprecated pcim_iomap_table by switching to
pcim_iomap_region.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/a36b4cf3-c792-40fa-8164-5dc9d5f14dd0@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
drivers/net/ethernet/realtek/r8169_main.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5446,11 +5446,10 @@ static int rtl_init_one(struct pci_dev *
if (region < 0)
return dev_err_probe(&pdev->dev, -ENODEV, "no MMIO resource found\n");
- rc = pcim_iomap_regions(pdev, BIT(region), KBUILD_MODNAME);
- if (rc < 0)
- return dev_err_probe(&pdev->dev, rc, "cannot remap MMIO, aborting\n");
-
- tp->mmio_addr = pcim_iomap_table(pdev)[region];
+ tp->mmio_addr = pcim_iomap_region(pdev, region, KBUILD_MODNAME);
+ if (IS_ERR(tp->mmio_addr))
+ return dev_err_probe(&pdev->dev, PTR_ERR(tp->mmio_addr),
+ "cannot remap MMIO, aborting\n");
txconfig = RTL_R32(tp, TxConfig);
if (txconfig == ~0U)

View file

@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/realtek/r8169_main.c --- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5404,7 +5404,7 @@ done: @@ -5397,7 +5397,7 @@ done:
/* register is set if system vendor successfully tested ASPM 1.2 */ /* register is set if system vendor successfully tested ASPM 1.2 */
static bool rtl_aspm_is_safe(struct rtl8169_private *tp) static bool rtl_aspm_is_safe(struct rtl8169_private *tp)
{ {

View file

@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/realtek/r8169_main.c --- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -2855,6 +2855,32 @@ static u32 rtl_csi_read(struct rtl8169_p @@ -2852,6 +2852,32 @@ static u32 rtl_csi_read(struct rtl8169_p
RTL_R32(tp, CSIDR) : ~0; RTL_R32(tp, CSIDR) : ~0;
} }
@ -50,7 +50,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static void rtl_set_aspm_entry_latency(struct rtl8169_private *tp, u8 val) static void rtl_set_aspm_entry_latency(struct rtl8169_private *tp, u8 val)
{ {
struct pci_dev *pdev = tp->pci_dev; struct pci_dev *pdev = tp->pci_dev;
@@ -3827,6 +3853,7 @@ static void rtl_hw_start_8125d(struct rt @@ -3824,6 +3850,7 @@ static void rtl_hw_start_8125d(struct rt
static void rtl_hw_start_8126a(struct rtl8169_private *tp) static void rtl_hw_start_8126a(struct rtl8169_private *tp)
{ {