Message ID | 20240401111002.3111783-1-maarten@rmail.be (mailing list archive) |
---|---|
State | Accepted |
Commit | 0a6380cb4c6b5c1d6dad226ba3130f9090f0ccea |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [v2] net: bcmgenet: Reset RBUF on first open | expand |
Hello: This patch was applied to netdev/net.git (main) by David S. Miller <davem@davemloft.net>: On Mon, 1 Apr 2024 13:09:33 +0200 you wrote: > From: Phil Elwell <phil@raspberrypi.com> > > 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. > > [...] Here is the summary with links: - [v2] net: bcmgenet: Reset RBUF on first open https://git.kernel.org/netdev/net/c/0a6380cb4c6b You are awesome, thank you!
On 4/3/2024 3:10 AM, patchwork-bot+netdevbpf@kernel.org wrote: > Hello: > > This patch was applied to netdev/net.git (main) > by David S. Miller <davem@davemloft.net>: > > On Mon, 1 Apr 2024 13:09:33 +0200 you wrote: >> From: Phil Elwell <phil@raspberrypi.com> >> >> 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. >> >> [...] > > Here is the summary with links: > - [v2] net: bcmgenet: Reset RBUF on first open > https://git.kernel.org/netdev/net/c/0a6380cb4c6b > > You are awesome, thank you! Good thing I had mentioned in v1 that we were busy with other things but that we would like to have tested that patch. I don't expect it to cause regressions, but I would have appreciated that there would be a mention or a github issue for the VPU firmware that indicated a fix was underway.
Florian Fainelli schreef op 2024-04-03 14:58: > On 4/3/2024 3:10 AM, patchwork-bot+netdevbpf@kernel.org wrote: >> Hello: >> >> This patch was applied to netdev/net.git (main) >> by David S. Miller <davem@davemloft.net>: >> >> On Mon, 1 Apr 2024 13:09:33 +0200 you wrote: >>> From: Phil Elwell <phil@raspberrypi.com> >>> >>> 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. >>> >>> [...] >> >> Here is the summary with links: >> - [v2] net: bcmgenet: Reset RBUF on first open >> https://git.kernel.org/netdev/net/c/0a6380cb4c6b >> >> You are awesome, thank you! > > Good thing I had mentioned in v1 that we were busy with other things > but that we would like to have tested that patch. I don't expect it to > cause regressions, but I would have appreciated that there would be a > mention or a github issue for the VPU firmware that indicated a fix > was underway. Eh, yeah, I had already sent an email to "David S. Miller <davem@davemloft.net>" indicating my surprise that this was committed. I had added in the v2 commit msg a link to the firmware issue I created at raspberrypi and also linked to the lore of the v1 patch. Should I have been clearer in some way or form when I posted the v2, (which was to fix the minor formatting issues and also add the firmware issues link to it)? Regards, Maarten Vanraes
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 2d7ae71287b1..855cbe349236 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -3282,7 +3282,7 @@ static void bcmgenet_get_hw_addr(struct bcmgenet_priv *priv, } /* 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; @@ -3307,6 +3307,14 @@ static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv) 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; } @@ -3370,8 +3378,8 @@ static int bcmgenet_open(struct net_device *dev) 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); @@ -4237,7 +4245,7 @@ static int bcmgenet_resume(struct device *d) 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);