openssl: fix variable reference in conffiles
[openwrt/openwrt.git] / target / linux / bcm47xx / patches-5.10 / 070-net-bgmac-fix-BCM5358-support-by-setting-correct-fla.patch
1 From d61615c366a489646a1bfe5b33455f916762d5f4 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Wed, 8 Feb 2023 10:16:37 +0100
4 Subject: [PATCH] net: bgmac: fix BCM5358 support by setting correct flags
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Code blocks handling BCMA_CHIP_ID_BCM5357 and BCMA_CHIP_ID_BCM53572 were
10 incorrectly unified. Chip package values are not unique and cannot be
11 checked independently. They are meaningful only in a context of a given
12 chip.
13
14 Packages BCM5358 and BCM47188 share the same value but then belong to
15 different chips. Code unification resulted in treating BCM5358 as
16 BCM47188 and broke its initialization.
17
18 Link: https://github.com/openwrt/openwrt/issues/8278
19 Fixes: cb1b0f90acfe ("net: ethernet: bgmac: unify code of the same family")
20 Cc: Jon Mason <jdmason@kudzu.us>
21 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
22 Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
23 Link: https://lore.kernel.org/r/20230208091637.16291-1-zajec5@gmail.com
24 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
25 ---
26 drivers/net/ethernet/broadcom/bgmac-bcma.c | 6 +++---
27 1 file changed, 3 insertions(+), 3 deletions(-)
28
29 --- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
30 +++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
31 @@ -240,12 +240,12 @@ static int bgmac_probe(struct bcma_devic
32 bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST;
33 bgmac->feature_flags |= BGMAC_FEAT_FLW_CTRL1;
34 bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_PHY;
35 - if (ci->pkg == BCMA_PKG_ID_BCM47188 ||
36 - ci->pkg == BCMA_PKG_ID_BCM47186) {
37 + if ((ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM47186) ||
38 + (ci->id == BCMA_CHIP_ID_BCM53572 && ci->pkg == BCMA_PKG_ID_BCM47188)) {
39 bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_RGMII;
40 bgmac->feature_flags |= BGMAC_FEAT_IOST_ATTACHED;
41 }
42 - if (ci->pkg == BCMA_PKG_ID_BCM5358)
43 + if (ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM5358)
44 bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_EPHYRMII;
45 break;
46 case BCMA_CHIP_ID_BCM53573: