mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-01 11:36:49 +00:00
21549dbf7b
Update patch set for new release and add required kernel option
CONFIG_ZRAM_TRACK_ENTRY_ACTIME to generic config
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.66
Manually rebased:
bcm27xx/patches-6.6/950-0092-MMC-added-alternative-MMC-driver.patch
bcm53xx/patches-6.6/180-usb-xhci-add-support-for-performing-fake-doorbell.patch
starfive/patches-6.6/1000-serial-8250_dw-Add-starfive-jh7100-hsuart-compatible.patch
Removed upstreamed:
bcm27xx/patches-6.6/950-0029-vc4_hdmi-Avoid-log-spam-for-audio-start-failure.patch[1]
All other patches automatically rebased.
1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.66&id=e0388a95736abd1f5f5a94221dd1ac24eacbd4d7
Build system: x86/64
Build-tested: bcm27xx/bcm2712, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64
Run-tested: bcm27xx/bcm2712, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64
Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/17271
(cherry picked from commit 28f534d953
)
Link: https://github.com/openwrt/openwrt/pull/17302
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
148 lines
4.7 KiB
Diff
148 lines
4.7 KiB
Diff
From 19fa4f2a85d777a8052e869c1b892a2f7556569d Mon Sep 17 00:00:00 2001
|
|
From: Heiner Kallweit <hkallweit1@gmail.com>
|
|
Date: Mon, 8 Apr 2024 20:47:40 +0200
|
|
Subject: [PATCH] r8169: fix LED-related deadlock on module removal
|
|
|
|
Binding devm_led_classdev_register() to the netdev is problematic
|
|
because on module removal we get a RTNL-related deadlock. Fix this
|
|
by avoiding the device-managed LED functions.
|
|
|
|
Note: We can safely call led_classdev_unregister() for a LED even
|
|
if registering it failed, because led_classdev_unregister() detects
|
|
this and is a no-op in this case.
|
|
|
|
Fixes: 18764b883e15 ("r8169: add support for LED's on RTL8168/RTL8101")
|
|
Cc: stable@vger.kernel.org
|
|
Reported-by: Lukas Wunner <lukas@wunner.de>
|
|
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
|
|
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
---
|
|
drivers/net/ethernet/realtek/r8169.h | 6 ++--
|
|
drivers/net/ethernet/realtek/r8169_leds.c | 35 +++++++++++++++--------
|
|
drivers/net/ethernet/realtek/r8169_main.c | 8 ++++--
|
|
3 files changed, 33 insertions(+), 16 deletions(-)
|
|
|
|
--- a/drivers/net/ethernet/realtek/r8169.h
|
|
+++ b/drivers/net/ethernet/realtek/r8169.h
|
|
@@ -73,6 +73,7 @@ enum mac_version {
|
|
};
|
|
|
|
struct rtl8169_private;
|
|
+struct r8169_led_classdev;
|
|
|
|
void r8169_apply_firmware(struct rtl8169_private *tp);
|
|
u16 rtl8168h_2_get_adc_bias_ioffset(struct rtl8169_private *tp);
|
|
@@ -84,7 +85,8 @@ void r8169_get_led_name(struct rtl8169_p
|
|
char *buf, int buf_len);
|
|
int rtl8168_get_led_mode(struct rtl8169_private *tp);
|
|
int rtl8168_led_mod_ctrl(struct rtl8169_private *tp, u16 mask, u16 val);
|
|
-void rtl8168_init_leds(struct net_device *ndev);
|
|
+struct r8169_led_classdev *rtl8168_init_leds(struct net_device *ndev);
|
|
int rtl8125_get_led_mode(struct rtl8169_private *tp, int index);
|
|
int rtl8125_set_led_mode(struct rtl8169_private *tp, int index, u16 mode);
|
|
-void rtl8125_init_leds(struct net_device *ndev);
|
|
+struct r8169_led_classdev *rtl8125_init_leds(struct net_device *ndev);
|
|
+void r8169_remove_leds(struct r8169_led_classdev *leds);
|
|
--- a/drivers/net/ethernet/realtek/r8169_leds.c
|
|
+++ b/drivers/net/ethernet/realtek/r8169_leds.c
|
|
@@ -147,22 +147,22 @@ static void rtl8168_setup_ldev(struct r8
|
|
led_cdev->hw_control_get_device = r8169_led_hw_control_get_device;
|
|
|
|
/* ignore errors */
|
|
- devm_led_classdev_register(&ndev->dev, led_cdev);
|
|
+ led_classdev_register(&ndev->dev, led_cdev);
|
|
}
|
|
|
|
-void rtl8168_init_leds(struct net_device *ndev)
|
|
+struct r8169_led_classdev *rtl8168_init_leds(struct net_device *ndev)
|
|
{
|
|
- /* bind resource mgmt to netdev */
|
|
- struct device *dev = &ndev->dev;
|
|
struct r8169_led_classdev *leds;
|
|
int i;
|
|
|
|
- leds = devm_kcalloc(dev, RTL8168_NUM_LEDS, sizeof(*leds), GFP_KERNEL);
|
|
+ leds = kcalloc(RTL8168_NUM_LEDS + 1, sizeof(*leds), GFP_KERNEL);
|
|
if (!leds)
|
|
- return;
|
|
+ return NULL;
|
|
|
|
for (i = 0; i < RTL8168_NUM_LEDS; i++)
|
|
rtl8168_setup_ldev(leds + i, ndev, i);
|
|
+
|
|
+ return leds;
|
|
}
|
|
|
|
static int rtl8125_led_hw_control_is_supported(struct led_classdev *led_cdev,
|
|
@@ -246,20 +246,31 @@ static void rtl8125_setup_led_ldev(struc
|
|
led_cdev->hw_control_get_device = r8169_led_hw_control_get_device;
|
|
|
|
/* ignore errors */
|
|
- devm_led_classdev_register(&ndev->dev, led_cdev);
|
|
+ led_classdev_register(&ndev->dev, led_cdev);
|
|
}
|
|
|
|
-void rtl8125_init_leds(struct net_device *ndev)
|
|
+struct r8169_led_classdev *rtl8125_init_leds(struct net_device *ndev)
|
|
{
|
|
- /* bind resource mgmt to netdev */
|
|
- struct device *dev = &ndev->dev;
|
|
struct r8169_led_classdev *leds;
|
|
int i;
|
|
|
|
- leds = devm_kcalloc(dev, RTL8125_NUM_LEDS, sizeof(*leds), GFP_KERNEL);
|
|
+ leds = kcalloc(RTL8125_NUM_LEDS + 1, sizeof(*leds), GFP_KERNEL);
|
|
if (!leds)
|
|
- return;
|
|
+ return NULL;
|
|
|
|
for (i = 0; i < RTL8125_NUM_LEDS; i++)
|
|
rtl8125_setup_led_ldev(leds + i, ndev, i);
|
|
+
|
|
+ return leds;
|
|
+}
|
|
+
|
|
+void r8169_remove_leds(struct r8169_led_classdev *leds)
|
|
+{
|
|
+ if (!leds)
|
|
+ return;
|
|
+
|
|
+ for (struct r8169_led_classdev *l = leds; l->ndev; l++)
|
|
+ led_classdev_unregister(&l->led);
|
|
+
|
|
+ kfree(leds);
|
|
}
|
|
--- a/drivers/net/ethernet/realtek/r8169_main.c
|
|
+++ b/drivers/net/ethernet/realtek/r8169_main.c
|
|
@@ -674,6 +674,8 @@ struct rtl8169_private {
|
|
const char *fw_name;
|
|
struct rtl_fw *rtl_fw;
|
|
|
|
+ struct r8169_led_classdev *leds;
|
|
+
|
|
u32 ocp_base;
|
|
};
|
|
|
|
@@ -5075,6 +5077,8 @@ static void rtl_remove_one(struct pci_de
|
|
|
|
cancel_work_sync(&tp->wk.work);
|
|
|
|
+ r8169_remove_leds(tp->leds);
|
|
+
|
|
unregister_netdev(tp->dev);
|
|
|
|
if (tp->dash_type != RTL_DASH_NONE)
|
|
@@ -5533,9 +5537,9 @@ static int rtl_init_one(struct pci_dev *
|
|
|
|
if (IS_ENABLED(CONFIG_R8169_LEDS)) {
|
|
if (rtl_is_8125(tp))
|
|
- rtl8125_init_leds(dev);
|
|
+ tp->leds = rtl8125_init_leds(dev);
|
|
else if (tp->mac_version > RTL_GIGA_MAC_VER_06)
|
|
- rtl8168_init_leds(dev);
|
|
+ tp->leds = rtl8168_init_leds(dev);
|
|
}
|
|
|
|
netdev_info(dev, "%s, %pM, XID %03x, IRQ %d\n",
|