Skip to content

Commit d61615c

Browse files
Rafał Miłeckikuba-moo
authored andcommitted
net: bgmac: fix BCM5358 support by setting correct flags
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: openwrt/openwrt#8278 Fixes: cb1b0f9 ("net: ethernet: bgmac: unify code of the same family") Cc: Jon Mason <[email protected]> Signed-off-by: Rafał Miłecki <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 35674e7 commit d61615c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/ethernet/broadcom/bgmac-bcma.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,12 @@ static int bgmac_probe(struct bcma_device *core)
240240
bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST;
241241
bgmac->feature_flags |= BGMAC_FEAT_FLW_CTRL1;
242242
bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_PHY;
243-
if (ci->pkg == BCMA_PKG_ID_BCM47188 ||
244-
ci->pkg == BCMA_PKG_ID_BCM47186) {
243+
if ((ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM47186) ||
244+
(ci->id == BCMA_CHIP_ID_BCM53572 && ci->pkg == BCMA_PKG_ID_BCM47188)) {
245245
bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_RGMII;
246246
bgmac->feature_flags |= BGMAC_FEAT_IOST_ATTACHED;
247247
}
248-
if (ci->pkg == BCMA_PKG_ID_BCM5358)
248+
if (ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM5358)
249249
bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_EPHYRMII;
250250
break;
251251
case BCMA_CHIP_ID_BCM53573:

0 commit comments

Comments
 (0)