mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2025-07-03 17:07:31 +00:00
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.31 Remove upstreamed patches: backport-6.12/780-27-v6.15-r8169-don-t-scan-PHY-addresses-0.patch [1] backport-6.12/780-33-v6.15-r8169-disable-RTL8126-ZRX-DC-timeout.patch [2] bcm27xx/patches-6.12/950-0315-media-i2c-imx219-Correct-the-minimum-vblanking-value.patch [3] bcm27xx/patches-6.12/950-0857-drm-v3d-Add-clock-handling.patch [4] bcm27xx/patches-6.12/950-0874-PCI-brcmstb-Expand-inbound-window-size-up-to-64GB.patch [5] bcm27xx/patches-6.12/950-0877-PCI-brcmstb-Adding-a-softdep-to-MIP-MSI-X-driver.patch [6] bcm27xx/patches-6.12/950-0960-media-imx335-Set-vblank-immediately.patch [7] Manually rebased patches: d1/patches-6.12/0009-ASoC-sunxi-sun4i-codec-add-basic-support-for-D1-audi.patch [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=ba59747562c49974cbace989d76b94a8331da442 [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=2780aa8394415df0a69e3b908d6dd8c79e1d1bcc [3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=9a981079097bee6a0583877798de0b240717bdde [4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=bbd6dc1fb6c56267ad1d58810d92287fcd5b0058 [5] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=3ffaa2e999380477774e76680ff4cef247451168 [6] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=12153e3948c596737853c3ec4ff7e4e3f4a9f9a6 [7] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=8d7e13c31c52690655883dff604238b0760a3644 Signed-off-by: Shiji Yang <yangshiji66@outlook.com> Link: https://github.com/openwrt/openwrt/pull/18953 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
95 lines
2.9 KiB
Diff
95 lines
2.9 KiB
Diff
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)
|
|
@@ -4827,9 +4824,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) {
|
|
@@ -4913,6 +4907,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);
|
|
|
|
@@ -4941,7 +4936,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);
|
|
@@ -4958,8 +4953,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);
|
|
@@ -5192,7 +5185,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);
|
|
@@ -5570,6 +5563,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);
|
|
|