20c42955e36d4662ac850b500095ece70c33a0a4
[openwrt/staging/blocktrron.git] /
1 From 83cb4b470c66b37b19a347a35cea01e0cbdd258d Mon Sep 17 00:00:00 2001
2 From: Heiner Kallweit <hkallweit1@gmail.com>
3 Date: Mon, 4 Nov 2024 23:16:20 +0100
4 Subject: [PATCH] r8169: remove leftover locks after reverted change
5
6 After e31a9fedc7d8 ("Revert "r8169: disable ASPM during NAPI poll"")
7 these locks aren't needed any longer.
8
9 Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
10 Link: https://patch.msgid.link/680f2606-ac7d-4ced-8694-e5033855da9b@gmail.com
11 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 ---
13 drivers/net/ethernet/realtek/r8169_main.c | 29 ++---------------------
14 1 file changed, 2 insertions(+), 27 deletions(-)
15
16 --- a/drivers/net/ethernet/realtek/r8169_main.c
17 +++ b/drivers/net/ethernet/realtek/r8169_main.c
18 @@ -663,13 +663,9 @@ struct rtl8169_private {
19 struct work_struct work;
20 } wk;
21
22 - raw_spinlock_t config25_lock;
23 raw_spinlock_t mac_ocp_lock;
24 struct mutex led_lock; /* serialize LED ctrl RMW access */
25
26 - raw_spinlock_t cfg9346_usage_lock;
27 - int cfg9346_usage_count;
28 -
29 unsigned supports_gmii:1;
30 unsigned aspm_manageable:1;
31 unsigned dash_enabled:1;
32 @@ -723,22 +719,12 @@ static inline struct device *tp_to_dev(s
33
34 static void rtl_lock_config_regs(struct rtl8169_private *tp)
35 {
36 - unsigned long flags;
37 -
38 - raw_spin_lock_irqsave(&tp->cfg9346_usage_lock, flags);
39 - if (!--tp->cfg9346_usage_count)
40 - RTL_W8(tp, Cfg9346, Cfg9346_Lock);
41 - raw_spin_unlock_irqrestore(&tp->cfg9346_usage_lock, flags);
42 + RTL_W8(tp, Cfg9346, Cfg9346_Lock);
43 }
44
45 static void rtl_unlock_config_regs(struct rtl8169_private *tp)
46 {
47 - unsigned long flags;
48 -
49 - raw_spin_lock_irqsave(&tp->cfg9346_usage_lock, flags);
50 - if (!tp->cfg9346_usage_count++)
51 - RTL_W8(tp, Cfg9346, Cfg9346_Unlock);
52 - raw_spin_unlock_irqrestore(&tp->cfg9346_usage_lock, flags);
53 + RTL_W8(tp, Cfg9346, Cfg9346_Unlock);
54 }
55
56 static void rtl_pci_commit(struct rtl8169_private *tp)
57 @@ -749,24 +735,18 @@ static void rtl_pci_commit(struct rtl816
58
59 static void rtl_mod_config2(struct rtl8169_private *tp, u8 clear, u8 set)
60 {
61 - unsigned long flags;
62 u8 val;
63
64 - raw_spin_lock_irqsave(&tp->config25_lock, flags);
65 val = RTL_R8(tp, Config2);
66 RTL_W8(tp, Config2, (val & ~clear) | set);
67 - raw_spin_unlock_irqrestore(&tp->config25_lock, flags);
68 }
69
70 static void rtl_mod_config5(struct rtl8169_private *tp, u8 clear, u8 set)
71 {
72 - unsigned long flags;
73 u8 val;
74
75 - raw_spin_lock_irqsave(&tp->config25_lock, flags);
76 val = RTL_R8(tp, Config5);
77 RTL_W8(tp, Config5, (val & ~clear) | set);
78 - raw_spin_unlock_irqrestore(&tp->config25_lock, flags);
79 }
80
81 static bool rtl_is_8125(struct rtl8169_private *tp)
82 @@ -1572,7 +1552,6 @@ static void __rtl8169_set_wol(struct rtl
83 { WAKE_MAGIC, Config3, MagicPacket }
84 };
85 unsigned int i, tmp = ARRAY_SIZE(cfg);
86 - unsigned long flags;
87 u8 options;
88
89 rtl_unlock_config_regs(tp);
90 @@ -1591,14 +1570,12 @@ static void __rtl8169_set_wol(struct rtl
91 r8168_mac_ocp_modify(tp, 0xc0b6, BIT(0), 0);
92 }
93
94 - raw_spin_lock_irqsave(&tp->config25_lock, flags);
95 for (i = 0; i < tmp; i++) {
96 options = RTL_R8(tp, cfg[i].reg) & ~cfg[i].mask;
97 if (wolopts & cfg[i].opt)
98 options |= cfg[i].mask;
99 RTL_W8(tp, cfg[i].reg, options);
100 }
101 - raw_spin_unlock_irqrestore(&tp->config25_lock, flags);
102
103 switch (tp->mac_version) {
104 case RTL_GIGA_MAC_VER_02 ... RTL_GIGA_MAC_VER_06:
105 @@ -5498,8 +5475,6 @@ static int rtl_init_one(struct pci_dev *
106 tp->supports_gmii = ent->driver_data == RTL_CFG_NO_GBIT ? 0 : 1;
107 tp->ocp_base = OCP_STD_PHY_BASE;
108
109 - raw_spin_lock_init(&tp->cfg9346_usage_lock);
110 - raw_spin_lock_init(&tp->config25_lock);
111 raw_spin_lock_init(&tp->mac_ocp_lock);
112 mutex_init(&tp->led_lock);
113