From patchwork Wed Feb 8 09:16:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 13132667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8E5E7C05027 for ; Wed, 8 Feb 2023 09:20:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=iv6q2+V+R9UvZ1skj17SC1+WUPQU0n4bt2cMH+8E6nY=; b=Rb1QLsfi0cwf7o NHet/dhOwy2L/4M15kq4bPQFmY5vQG37PCXlrM9JIp444L0iKml2tvbrvVhXGwzEhSZz/Vd5oKHwD bVwmiMcUQg5K3QUgq9NKPT6T30LorMgFeg7OXH1kuePiwig/QUSf8xOoaVxskYROFX2UNyIxHYTC2 a6LDyLX4NjgKMSFgtHCxuswRaLVZC284vXEnt/dIiKhR98o56WbPUjCvAB6ZabYSor8MdaRFFk7kG WMTSk1iH3pAXEGWiP14bQYz02ZMNWUq5YHaOuxXPd93jE5wgrPeELPqlifH9x54Ppi23onDe4ZNzV nk4MbFcsS14d5j7APPWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPgbh-00EmMg-66; Wed, 08 Feb 2023 09:19:14 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPgae-00Elri-DA for linux-arm-kernel@lists.infradead.org; Wed, 08 Feb 2023 09:18:09 +0000 Received: by mail-ej1-x62d.google.com with SMTP id jg8so9969842ejc.6 for ; Wed, 08 Feb 2023 01:18:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=HaQvqlEgokcy6/EGaLptwrwzxlWJe//6zHxL+sHpt84=; b=B8HsohgJVuNRUV8hlLmUEqm9BN8ha4HoyBmlKDmI5c7LU54LZ048kdUiEmWwVf4GZv 8uUUqprZZ9qD2bEbWg6VGz9IX45cofm4IRVQ2bO31K9qXrJcFA9OXIKvHYy1oBCy4BRp aeFes9GhwbaGDJ4ObMwLQzKfOdHTfs8ikPK/QS0QhM2DbglSgQrxc/tHvZl+SXjmhI8T hCN4WOnROiA+gVHvy1GeWo8tFv0Tksb7CUZLrDWJM4S9BLiUgaA5EDX8A09GoXO0ZTgN 0gIKhAVN4JQF2r9eaFpTNjMRNJFpd3CmmO4xgz8xySGtdd234grIzXcLAoQV7BYiO7ek EGag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HaQvqlEgokcy6/EGaLptwrwzxlWJe//6zHxL+sHpt84=; b=L0Gh97Q7/s/xeGJjAvrZG3SWFJrN4kzflRZfiMWdsBjeXEEGn65R5GxqR4+VfqdDMO tLZz665fbEwiTC7bA3CJ9NRoJoQKg2LveLbTyYBBOJp7Oz5VyyuqHykxl+sNojRODNPL aoZsaN8+x77xYKHu99O92vlJc+WREd00Tw1lncQP5AY1cA08H6uLwxldHktLXDXySArk jI+feeMCvtQUIcyShvhv5neL9Sym2yg9OcqO+pM08Pxwf9rQOa0hbs9XjeLE7JBx5Gy1 m53vGcZeUupH/RDrkhGSutjrQ1lIP+K4pHaf/79s7MLLvFdmZyISWBjqezlfU3aEUsL8 9EPg== X-Gm-Message-State: AO0yUKVBC6Wp3g1re4/GGF7HQAcBKvJ4LXppRp25Ee+LlwIm/J/LpL4F kxfS2Ym6Ch8KNo3tdOpb++Q= X-Google-Smtp-Source: AK7set8lyYn+YdLECIJU9uwx78HYrb/I0lsDrYSsAhsuN1kPMWyqViYEKU6C2PwGqrJcDpvYq7GIeg== X-Received: by 2002:a17:906:1286:b0:886:50d:be8d with SMTP id k6-20020a170906128600b00886050dbe8dmr7610705ejb.13.1675847886135; Wed, 08 Feb 2023 01:18:06 -0800 (PST) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id d10-20020a17090692ca00b0088f8ae18b6bsm8042076ejx.189.2023.02.08.01.18.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Feb 2023 01:18:05 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , bcm-kernel-feedback-list@broadcom.com Cc: Florian Fainelli , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Jon Mason Subject: [PATCH net] net: bgmac: fix BCM5358 support by setting correct flags Date: Wed, 8 Feb 2023 10:16:37 +0100 Message-Id: <20230208091637.16291-1-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230208_011808_506188_76486B05 X-CRM114-Status: GOOD ( 13.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Rafał Miłecki 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 Signed-off-by: Rafał Miłecki Reviewed-by: Florian Fainelli --- 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: