2022-04-13 00:08:40

by Jeremy Linton

[permalink] [raw]
Subject: [PATCH] net: bcmgenet: Revert "Use stronger register read/writes to assure ordering"

It turns out after digging deeper into this bug, that it was being
triggered by GCC12 failing to call the bcmgenet_enable_dma()
routine. Given that a gcc12 fix has been merged [1] and the genet
driver now works properly when built with gcc12, this commit should
be reverted.

[1]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105160
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=aabb9a261ef060cf24fd626713f1d7d9df81aa57

Fixes: 8d3ea3d402db ("net: bcmgenet: "Use stronger register read/writes to assure ordering")
Signed-off-by: Jeremy Linton <[email protected]>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 2dd79af9411b..9a41145dadfc 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -76,7 +76,7 @@ static inline void bcmgenet_writel(u32 value, void __iomem *offset)
if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
__raw_writel(value, offset);
else
- writel(value, offset);
+ writel_relaxed(value, offset);
}

static inline u32 bcmgenet_readl(void __iomem *offset)
@@ -84,7 +84,7 @@ static inline u32 bcmgenet_readl(void __iomem *offset)
if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
return __raw_readl(offset);
else
- return readl(offset);
+ return readl_relaxed(offset);
}

static inline void dmadesc_set_length_status(struct bcmgenet_priv *priv,
--
2.34.1


2022-04-14 15:32:22

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH] net: bcmgenet: Revert "Use stronger register read/writes to assure ordering"

Hello:

This patch was applied to netdev/net.git (master)
by Paolo Abeni <[email protected]>:

On Tue, 12 Apr 2022 16:04:20 -0500 you wrote:
> It turns out after digging deeper into this bug, that it was being
> triggered by GCC12 failing to call the bcmgenet_enable_dma()
> routine. Given that a gcc12 fix has been merged [1] and the genet
> driver now works properly when built with gcc12, this commit should
> be reverted.
>
> [1]
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105160
> https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=aabb9a261ef060cf24fd626713f1d7d9df81aa57
>
> [...]

Here is the summary with links:
- net: bcmgenet: Revert "Use stronger register read/writes to assure ordering"
https://git.kernel.org/netdev/net/c/2df3fc4a84e9

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html


2022-04-15 09:19:53

by Paolo Abeni

[permalink] [raw]
Subject: Re: [PATCH] net: bcmgenet: Revert "Use stronger register read/writes to assure ordering"

On Wed, 2022-04-13 at 10:00 -0700, Florian Fainelli wrote:
>
> On 4/12/2022 2:04 PM, Jeremy Linton wrote:
> > It turns out after digging deeper into this bug, that it was being
> > triggered by GCC12 failing to call the bcmgenet_enable_dma()
> > routine. Given that a gcc12 fix has been merged [1] and the genet
> > driver now works properly when built with gcc12, this commit should
> > be reverted.
> >
> > [1]
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105160
> > https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=aabb9a261ef060cf24fd626713f1d7d9df81aa57
> >
> > Fixes: 8d3ea3d402db ("net: bcmgenet: "Use stronger register read/writes to assure ordering")

For the records, there is a small typo in the above tag, I'll fix it
while applying the patch. No need to repost it.

Cheers,

Paolo

2022-04-16 01:57:36

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH] net: bcmgenet: Revert "Use stronger register read/writes to assure ordering"



On 4/12/2022 2:04 PM, Jeremy Linton wrote:
> It turns out after digging deeper into this bug, that it was being
> triggered by GCC12 failing to call the bcmgenet_enable_dma()
> routine. Given that a gcc12 fix has been merged [1] and the genet
> driver now works properly when built with gcc12, this commit should
> be reverted.
>
> [1]
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105160
> https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=aabb9a261ef060cf24fd626713f1d7d9df81aa57
>
> Fixes: 8d3ea3d402db ("net: bcmgenet: "Use stronger register read/writes to assure ordering")
> Signed-off-by: Jeremy Linton <[email protected]>

Acked-by: Florian Fainelli <[email protected]>
--
Florian