linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: bgmac: fix BCM5358 support by setting correct flags
@ 2023-02-08  9:16 Rafał Miłecki
  2023-02-08 18:40 ` Florian Fainelli
  2023-02-10  6:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Rafał Miłecki @ 2023-02-08  9:16 UTC (permalink / raw)
  To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	bcm-kernel-feedback-list
  Cc: Florian Fainelli, netdev, linux-arm-kernel,
	Rafał Miłecki, Jon Mason

From: Rafał Miłecki <rafal@milecki.pl>

Code blocks handling BCMA_CHIP_ID_BCM5357 and BCMA_CHIP_ID_BCM53572 were
incorrectly unified. Chip package values are not unique and cannot be
checked independently. They are meaningful only in a context of a given
chip.

Packages BCM5358 and BCM47188 share the same value but then belong to
different chips. Code unification resulted in treating BCM5358 as
BCM47188 and broke its initialization.

Link: https://github.com/openwrt/openwrt/issues/8278
Fixes: cb1b0f90acfe ("net: ethernet: bgmac: unify code of the same family")
Cc: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 drivers/net/ethernet/broadcom/bgmac-bcma.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bgmac-bcma.c b/drivers/net/ethernet/broadcom/bgmac-bcma.c
index 02bd3cf9a260..6e4f36aaf5db 100644
--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
+++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
@@ -240,12 +240,12 @@ static int bgmac_probe(struct bcma_device *core)
 		bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST;
 		bgmac->feature_flags |= BGMAC_FEAT_FLW_CTRL1;
 		bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_PHY;
-		if (ci->pkg == BCMA_PKG_ID_BCM47188 ||
-		    ci->pkg == BCMA_PKG_ID_BCM47186) {
+		if ((ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM47186) ||
+		    (ci->id == BCMA_CHIP_ID_BCM53572 && ci->pkg == BCMA_PKG_ID_BCM47188)) {
 			bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_RGMII;
 			bgmac->feature_flags |= BGMAC_FEAT_IOST_ATTACHED;
 		}
-		if (ci->pkg == BCMA_PKG_ID_BCM5358)
+		if (ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM5358)
 			bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_EPHYRMII;
 		break;
 	case BCMA_CHIP_ID_BCM53573:
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: bgmac: fix BCM5358 support by setting correct flags
  2023-02-08  9:16 [PATCH net] net: bgmac: fix BCM5358 support by setting correct flags Rafał Miłecki
@ 2023-02-08 18:40 ` Florian Fainelli
  2023-02-10  6:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2023-02-08 18:40 UTC (permalink / raw)
  To: Rafał Miłecki, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, bcm-kernel-feedback-list
  Cc: Florian Fainelli, netdev, linux-arm-kernel,
	Rafał Miłecki, Jon Mason

On 2/8/23 01:16, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Code blocks handling BCMA_CHIP_ID_BCM5357 and BCMA_CHIP_ID_BCM53572 were
> incorrectly unified. Chip package values are not unique and cannot be
> checked independently. They are meaningful only in a context of a given
> chip.
> 
> Packages BCM5358 and BCM47188 share the same value but then belong to
> different chips. Code unification resulted in treating BCM5358 as
> BCM47188 and broke its initialization.
> 
> Link: https://github.com/openwrt/openwrt/issues/8278
> Fixes: cb1b0f90acfe ("net: ethernet: bgmac: unify code of the same family")
> Cc: Jon Mason <jdmason@kudzu.us>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: bgmac: fix BCM5358 support by setting correct flags
  2023-02-08  9:16 [PATCH net] net: bgmac: fix BCM5358 support by setting correct flags Rafał Miłecki
  2023-02-08 18:40 ` Florian Fainelli
@ 2023-02-10  6:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-02-10  6:40 UTC (permalink / raw)
  To: =?utf-8?b?UmFmYcWCIE1pxYJlY2tpIDx6YWplYzVAZ21haWwuY29tPg==?=
  Cc: davem, edumazet, kuba, pabeni, bcm-kernel-feedback-list,
	f.fainelli, netdev, linux-arm-kernel, rafal, jdmason

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Wed,  8 Feb 2023 10:16:37 +0100 you wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Code blocks handling BCMA_CHIP_ID_BCM5357 and BCMA_CHIP_ID_BCM53572 were
> incorrectly unified. Chip package values are not unique and cannot be
> checked independently. They are meaningful only in a context of a given
> chip.
> 
> [...]

Here is the summary with links:
  - [net] net: bgmac: fix BCM5358 support by setting correct flags
    https://git.kernel.org/netdev/net/c/d61615c366a4

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



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-10  6:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-08  9:16 [PATCH net] net: bgmac: fix BCM5358 support by setting correct flags Rafał Miłecki
2023-02-08 18:40 ` Florian Fainelli
2023-02-10  6:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).