mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 06:08:08 +00:00
1343acc8cd
Deleted (upstreamed): bcm27xx/patches-5.10/950-0669-drm-vc4-hdmi-Make-sure-the-device-is-powered-with-CE.patch [1] bcm27xx/patches-5.10/950-0672-drm-vc4-hdmi-Move-initial-register-read-after-pm_run.patch [1] gemini/patches-5.10/0003-ARM-dts-gemini-NAS4220-B-fis-index-block-with-128-Ki.patch [2] Manually rebased: bcm27xx/patches-5.10/950-0675-drm-vc4-hdmi-Drop-devm-interrupt-handler-for-CEC-int.patch Manually reverted: generic/pending-5.10/860-Revert-ASoC-mediatek-Check-for-error-clk-pointer.patch [3] [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.94&id=55b10b88ac8654fc2f31518aa349a2e643b37f18 [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.94&id=958a8819d41420d7a74ed922a09cacc0ba3a4218 [3] https://lore.kernel.org/all/trinity-2a727d96-0335-4d03-8f30-e22a0e10112d-1643363480085@3c-app-gmx-bap33/ Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
71 lines
2.4 KiB
Diff
71 lines
2.4 KiB
Diff
From eccfde35476213d30a67dedb63f007e7ae8da78c Mon Sep 17 00:00:00 2001
|
|
From: Phil Elwell <phil@raspberrypi.com>
|
|
Date: Fri, 25 Sep 2020 15:07:23 +0100
|
|
Subject: [PATCH] net: bcmgenet: Reset RBUF on first open
|
|
|
|
If the RBUF logic is not reset when the kernel starts then there
|
|
may be some data left over from any network boot loader. If the
|
|
64-byte packet headers are enabled then this can be fatal.
|
|
|
|
Extend bcmgenet_dma_disable to do perform the reset, but not when
|
|
called from bcmgenet_resume in order to preserve a wake packet.
|
|
|
|
N.B. This different handling of resume is just based on a hunch -
|
|
why else wouldn't one reset the RBUF as well as the TBUF? If this
|
|
isn't the case then it's easy to change the patch to make the RBUF
|
|
reset unconditional.
|
|
|
|
See: https://github.com/raspberrypi/linux/issues/3850
|
|
|
|
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
|
---
|
|
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 16 ++++++++++++----
|
|
1 file changed, 12 insertions(+), 4 deletions(-)
|
|
|
|
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
|
|
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
|
|
@@ -3244,7 +3244,7 @@ static void bcmgenet_get_hw_addr(struct
|
|
}
|
|
|
|
/* Returns a reusable dma control register value */
|
|
-static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv)
|
|
+static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv, bool flush_rx)
|
|
{
|
|
unsigned int i;
|
|
u32 reg;
|
|
@@ -3269,6 +3269,14 @@ static u32 bcmgenet_dma_disable(struct b
|
|
udelay(10);
|
|
bcmgenet_umac_writel(priv, 0, UMAC_TX_FLUSH);
|
|
|
|
+ if (flush_rx) {
|
|
+ reg = bcmgenet_rbuf_ctrl_get(priv);
|
|
+ bcmgenet_rbuf_ctrl_set(priv, reg | BIT(0));
|
|
+ udelay(10);
|
|
+ bcmgenet_rbuf_ctrl_set(priv, reg);
|
|
+ udelay(10);
|
|
+ }
|
|
+
|
|
return dma_ctrl;
|
|
}
|
|
|
|
@@ -3332,8 +3340,8 @@ static int bcmgenet_open(struct net_devi
|
|
|
|
bcmgenet_set_hw_addr(priv, dev->dev_addr);
|
|
|
|
- /* Disable RX/TX DMA and flush TX queues */
|
|
- dma_ctrl = bcmgenet_dma_disable(priv);
|
|
+ /* Disable RX/TX DMA and flush TX and RX queues */
|
|
+ dma_ctrl = bcmgenet_dma_disable(priv, true);
|
|
|
|
/* Reinitialize TDMA and RDMA and SW housekeeping */
|
|
ret = bcmgenet_init_dma(priv);
|
|
@@ -4189,7 +4197,7 @@ static int bcmgenet_resume(struct device
|
|
bcmgenet_hfb_create_rxnfc_filter(priv, rule);
|
|
|
|
/* Disable RX/TX DMA and flush TX queues */
|
|
- dma_ctrl = bcmgenet_dma_disable(priv);
|
|
+ dma_ctrl = bcmgenet_dma_disable(priv, false);
|
|
|
|
/* Reinitialize TDMA and RDMA and SW housekeeping */
|
|
ret = bcmgenet_init_dma(priv);
|