mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 23:12:32 +00:00
228e0e1039
Removed upstreamed: 01. backport-5.15/424-v6.4-0001-mtd-core-provide-unique-name-for-nvmem-device-take-t.patch 02. backport-5.15/424-v6.4-0002-mtd-core-fix-nvmem-error-reporting.patch 03. generic-backport/424-v6.4-0003-mtd-core-fix-error-path-for-nvmem-provider.patch 04. generic-backport/828-v6.4-0001-of-Fix-modalias-string-generation.patch 05. bcm4908/patches-5.15/031-v5.17-0002-arm64-dts-broadcom-bcm4908-add-DT-for-Netgear-RAXE50.patch 06. bcm4908/patches-5.15/033-v6.0-0001-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM63158.patchgit 07. bcm4908/patches-5.15/033-v6.0-0002-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM4912.patchgita 08. bcm4908/patches-5.15/033-v6.0-0010-arm64-dts-Add-base-DTS-file-for-bcmbca-device-Asus-G.patchgit 09. bcm4908/patches-5.15/034-v6.1-0005-arm64-dts-Move-BCM4908-dts-to-bcmbca-folder.patch 10. bcm4908/patches-5.15/036-v6.4-0002-arm64-dts-broadcom-bcmbca-bcm4908-fix-NAND-interrupt.patch 11. bcm4908/patches-5.15/036-v6.4-0004-arm64-dts-broadcom-bcmbca-bcm4908-fix-procmon-nodena.patch 12. ipq806x/patches-5.15/104-v6.0-06-ARM-dts-qcom-ipq8064-reduce-pci-IO-size-to-64K.patch Manually rebased: bcm27xx/patches-5.15/950-0078-BCM2708-Add-core-Device-Tree-support.patch bcm27xx/patches-5.15/950-0547-ARM-dts-Add-Pi-Zero-2-support.patch bcm4908/patches-5.15/033-v6.0-0001-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM63158.patchgit bcm4908/patches-5.15/033-v6.0-0002-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM4912.patchgit bcm4908/patches-5.15/030-v5.16-0001-arm64-dts-broadcom-bcm4908-Fix-NAND-node-name.patch bcm4908/patches-5.15/032-v5.18-0002-arm64-dts-broadcom-bcm4908-add-pinctrl-binding.patch bcm4908/patches-5.15/032-v5.18-0003-arm64-dts-broadcom-bcm4908-add-watchdog-block.patch bcm4908/patches-5.15/032-v5.18-0004-arm64-dts-broadcom-bcm4908-add-I2C-block.patch bcm4908/patches-5.15/033-v6.0-0003-ARM64-dts-Add-DTS-files-for-bcmbca-SoC-BCM6858.patchgit bcm4908/patches-5.15/033-v6.0-0008-arm64-dts-broadcom-bcm4908-Fix-timer-node-for-BCM490.patchgit bcm4908/patches-5.15/034-v6.1-0001-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch bcm4908/patches-5.15/034-v6.1-0002-arm64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch bcm4908/patches-5.15/034-v6.1-0003-arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch bcm4908/patches-5.15/034-v6.1-0004-arm64-dts-bcmbca-update-BCM4908-board-dts-files.patch All other patches automatically rebased. Build system: x86_64 Build-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Run-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod 01. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=77112d23a671697f0f70695ab901f807e15d2093 02. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=fe07b3b5af01f42b291f5da0da09d047f50b33a6 03. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=273be36e420924237f6c9d43cdad96718c13dd52 04. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=fe8ab85ed4958e58e991bba0aa0a655b552b0273 05. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=6ae67829fa5e9e71f458f69db42f0e216225616a 06. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=1994284cb9226b65ca3a6744ce3320218b584f26 07. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=a46878476c5549a4fde15a31922ce80a50b23492 08. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=112ff0f2530549d50510f116474924f9c4fad590 09. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=7c253e98685e6d884d12e2618ef4d2ad90b4fbd7 10. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=8444b46e163aa9559a0af0381a1d230ec4146eb2 11. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=6d1af517817a760d7af3dee0fc4603645485495c 12. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=cc4f0e168a5630ad0491ac5328f1a89f3cf3d04e Signed-off-by: John Audia <therealgraysky@proton.me>
143 lines
4.3 KiB
Diff
143 lines
4.3 KiB
Diff
From f9ec5723c3dbfcede9c7b0dcdf85e401ce16316c Mon Sep 17 00:00:00 2001
|
|
From: Christian Marangi <ansuelsmth@gmail.com>
|
|
Date: Sat, 23 Jul 2022 16:29:29 +0200
|
|
Subject: [PATCH 1/5] net: ethernet: stmicro: stmmac: move queue reset to
|
|
dedicated functions
|
|
|
|
Move queue reset to dedicated functions. This aside from a simple
|
|
cleanup is also required to allocate a dma conf without resetting the tx
|
|
queue while the device is temporarily detached as now the reset is not
|
|
part of the dma init function and can be done later in the code flow.
|
|
|
|
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
---
|
|
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 59 ++++++++++---------
|
|
1 file changed, 31 insertions(+), 28 deletions(-)
|
|
|
|
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
|
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
|
@@ -130,6 +130,9 @@ static irqreturn_t stmmac_mac_interrupt(
|
|
static irqreturn_t stmmac_safety_interrupt(int irq, void *dev_id);
|
|
static irqreturn_t stmmac_msi_intr_tx(int irq, void *data);
|
|
static irqreturn_t stmmac_msi_intr_rx(int irq, void *data);
|
|
+static void stmmac_reset_rx_queue(struct stmmac_priv *priv, u32 queue);
|
|
+static void stmmac_reset_tx_queue(struct stmmac_priv *priv, u32 queue);
|
|
+static void stmmac_reset_queues_param(struct stmmac_priv *priv);
|
|
static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue);
|
|
static void stmmac_flush_tx_descriptors(struct stmmac_priv *priv, int queue);
|
|
|
|
@@ -1712,9 +1715,6 @@ static int __init_dma_rx_desc_rings(stru
|
|
return -ENOMEM;
|
|
}
|
|
|
|
- rx_q->cur_rx = 0;
|
|
- rx_q->dirty_rx = 0;
|
|
-
|
|
/* Setup the chained descriptor addresses */
|
|
if (priv->mode == STMMAC_CHAIN_MODE) {
|
|
if (priv->extend_desc)
|
|
@@ -1820,12 +1820,6 @@ static int __init_dma_tx_desc_rings(stru
|
|
tx_q->tx_skbuff[i] = NULL;
|
|
}
|
|
|
|
- tx_q->dirty_tx = 0;
|
|
- tx_q->cur_tx = 0;
|
|
- tx_q->mss = 0;
|
|
-
|
|
- netdev_tx_reset_queue(netdev_get_tx_queue(priv->dev, queue));
|
|
-
|
|
return 0;
|
|
}
|
|
|
|
@@ -2694,10 +2688,7 @@ static void stmmac_tx_err(struct stmmac_
|
|
stmmac_stop_tx_dma(priv, chan);
|
|
dma_free_tx_skbufs(priv, chan);
|
|
stmmac_clear_tx_descriptors(priv, chan);
|
|
- tx_q->dirty_tx = 0;
|
|
- tx_q->cur_tx = 0;
|
|
- tx_q->mss = 0;
|
|
- netdev_tx_reset_queue(netdev_get_tx_queue(priv->dev, chan));
|
|
+ stmmac_reset_tx_queue(priv, chan);
|
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
|
tx_q->dma_tx_phy, chan);
|
|
stmmac_start_tx_dma(priv, chan);
|
|
@@ -3781,6 +3772,8 @@ static int stmmac_open(struct net_device
|
|
}
|
|
}
|
|
|
|
+ stmmac_reset_queues_param(priv);
|
|
+
|
|
ret = stmmac_hw_setup(dev, true);
|
|
if (ret < 0) {
|
|
netdev_err(priv->dev, "%s: Hw setup failed\n", __func__);
|
|
@@ -6430,6 +6423,7 @@ void stmmac_enable_rx_queue(struct stmma
|
|
return;
|
|
}
|
|
|
|
+ stmmac_reset_rx_queue(priv, queue);
|
|
stmmac_clear_rx_descriptors(priv, queue);
|
|
|
|
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
|
@@ -6491,6 +6485,7 @@ void stmmac_enable_tx_queue(struct stmma
|
|
return;
|
|
}
|
|
|
|
+ stmmac_reset_tx_queue(priv, queue);
|
|
stmmac_clear_tx_descriptors(priv, queue);
|
|
|
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
|
@@ -7417,6 +7412,25 @@ int stmmac_suspend(struct device *dev)
|
|
}
|
|
EXPORT_SYMBOL_GPL(stmmac_suspend);
|
|
|
|
+static void stmmac_reset_rx_queue(struct stmmac_priv *priv, u32 queue)
|
|
+{
|
|
+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue];
|
|
+
|
|
+ rx_q->cur_rx = 0;
|
|
+ rx_q->dirty_rx = 0;
|
|
+}
|
|
+
|
|
+static void stmmac_reset_tx_queue(struct stmmac_priv *priv, u32 queue)
|
|
+{
|
|
+ struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue];
|
|
+
|
|
+ tx_q->cur_tx = 0;
|
|
+ tx_q->dirty_tx = 0;
|
|
+ tx_q->mss = 0;
|
|
+
|
|
+ netdev_tx_reset_queue(netdev_get_tx_queue(priv->dev, queue));
|
|
+}
|
|
+
|
|
/**
|
|
* stmmac_reset_queues_param - reset queue parameters
|
|
* @priv: device pointer
|
|
@@ -7427,22 +7441,11 @@ static void stmmac_reset_queues_param(st
|
|
u32 tx_cnt = priv->plat->tx_queues_to_use;
|
|
u32 queue;
|
|
|
|
- for (queue = 0; queue < rx_cnt; queue++) {
|
|
- struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue];
|
|
+ for (queue = 0; queue < rx_cnt; queue++)
|
|
+ stmmac_reset_rx_queue(priv, queue);
|
|
|
|
- rx_q->cur_rx = 0;
|
|
- rx_q->dirty_rx = 0;
|
|
- }
|
|
-
|
|
- for (queue = 0; queue < tx_cnt; queue++) {
|
|
- struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue];
|
|
-
|
|
- tx_q->cur_tx = 0;
|
|
- tx_q->dirty_tx = 0;
|
|
- tx_q->mss = 0;
|
|
-
|
|
- netdev_tx_reset_queue(netdev_get_tx_queue(priv->dev, queue));
|
|
- }
|
|
+ for (queue = 0; queue < tx_cnt; queue++)
|
|
+ stmmac_reset_tx_queue(priv, queue);
|
|
}
|
|
|
|
/**
|