mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 23:12:32 +00:00
7efec0acca
Manually rebased:
bcm4908/patches-5.15/071-v6.1-0001-net-broadcom-bcm4908_enet-handle-EPROBE_DEFER-when-g.patch
bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch
ipq40xx/patches-5.15/902-dts-ipq4019-ap-dk04.1.patch[*]
bcm27xx/patches-5.15/950-0600-xhci-quirks-add-link-TRB-quirk-for-VL805.patch
bcm27xx/patches-5.15/950-0606-usb-xhci-add-VLI_TRB_CACHE_BUG-quirk.patch
bcm27xx/patches-5.15/950-0717-usb-xhci-add-a-quirk-for-Superspeed-bulk-OUT-transfe.patch
Removed upstreamed:
backport-5.15/735-v6.5-net-bgmac-postpone-turning-IRQs-off-to-avoid-SoC-han.patch[1]
backport-5.15/817-v6.5-01-leds-trigger-netdev-Recheck-NETDEV_LED_MODE_LINKUP-o.patch[2]
pending-5.15/143-jffs2-reduce-stack-usage-in-jffs2_build_xattr_subsys.patch[3]
pending-5.15/160-workqueue-fix-enum-type-for-gcc-13.patch[4]
bcm53xx/patches-5.15/036-v6.5-0003-ARM-dts-BCM5301X-Drop-clock-names-from-the-SPI-node.patch[5]
bcm53xx/patches-5.15/036-v6.5-0015-ARM-dts-BCM5301X-fix-duplex-full-full-duplex.patch[6]
ipq807x/patches-5.15/0048-v6.1-clk-qcom-reset-Allow-specifying-custom-reset-delay.patch[7]
ipq807x/patches-5.15/0049-v6.2-clk-qcom-reset-support-resetting-multiple-bits.patch[8]
All other patches automatically rebased.
1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=02474292a44205c1eb5a03634ead155a3c9134f4
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=86b93cbfe104e99fd3d25a49748b99fb88101573
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=79b9ab357b6f5675007f4c02ff8765cbd8dc06a2
4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=d528faa9e828b9fc46dfb684a2a9fd8c2e860ed8
5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=5899bc4058e89d5110a23797ff94439c53b77c25
6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=95afd2c7c7d26087730dc938709e025a303e5499
7. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=40844343a8853a08b049d50c967e2a1e28f0ece6
8. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=6ad5ded420f5d96f7c65b68135f5787a1c7e58d7
Build system: x86/64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3
Co-authored-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John Audia <therealgraysky@proton.me>
[rebased ipq40xx/patches-5.15/902-dts-ipq4019-ap-dk04.1.patch ]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 8590531048
)
[Refreshed on top of openwrt-23.05]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
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,
|
|
@@ -7411,6 +7406,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
|
|
@@ -7421,22 +7435,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);
|
|
}
|
|
|
|
/**
|