From nobody Mon Jun 29 06:32:58 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 090C2C433F5 for ; Sun, 13 Feb 2022 18:52:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237876AbiBMSwN (ORCPT ); Sun, 13 Feb 2022 13:52:13 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:53366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234294AbiBMSwL (ORCPT ); Sun, 13 Feb 2022 13:52:11 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BEC457B3C for ; Sun, 13 Feb 2022 10:52:05 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id h6so23543379wrb.9 for ; Sun, 13 Feb 2022 10:52:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=waldekranz-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version:organization :content-transfer-encoding; bh=5b6T59mtoBLg2aHTqbBo/r+mo6q1zaT8htW2r31opOo=; b=jkcJuibzzNnKOpzhPiGpqn62fKaL16PjFsJa9ECq+C+9uKDFnGlijB7gW+8kO7w+HY JTcmBFp3EXWo8QZxjaYvYNZmWqtKY53glpL8tsHmTXry7U0lPDGb0TWpinKA5mPeGL14 kDUW1Ri44IFGs5CQt4gY1kJHP3LLzsCHOzrL4MFDt2iS0ahGKDxBtEqHdiKsXO6wREoz zgKTBZX068Vk/n8xLuTiT/ydSusfeWg8P2AgGIYZU0B2/wTqzDMOkjsHC4EWiT+Fnw3Y BU9gqnjg5KAlnM2NRS4uDHlhXeU27TTzmSObP9PDmVxnVVIQYWMX27BEh5GwhM+snTIy GYOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :organization:content-transfer-encoding; bh=5b6T59mtoBLg2aHTqbBo/r+mo6q1zaT8htW2r31opOo=; b=cNauonTJ1qmp+jXzuwBo5YNvvAZ2WiAOLTpwLzp62/S/EJuAvAoJfVR/lcBHO2R5Vj e8b5YuWYBPaS/fLlTr7unnoDn0ytkhA0kJ923r9Y2BBlmTyUdyWlk85GkAH6/887GnT3 EA7ZYm2PdUXa57pyRp4TbBG7FGnRLeGmL18Z3CNF0Y7miESGCtjFwHDDwSOfh0iWig4b LfdiZ++YSvI/M1hVHUg5gSHQ/+Q5YsV2rNzrM9A38W/3i02983g4hLOKPBh3cizpLBar Vm1CkfhvVLFHylz5Rwc6Bcku/+lUqL/IgKVq+yMbqEu4sAA5RcONJJ23Yag2SzidQbpr L15Q== X-Gm-Message-State: AOAM5321iWcMMoEVN0+iBy9uhksryeTi1NL79JGYpYWPuL8A67N1U2RA rhdLde3NccEmDYIWGwtfW6uziw== X-Google-Smtp-Source: ABdhPJwjXJQ+chY2+2rwARmjalWZYGCDghqclK/Ut0wkfk6IbBp15ag9Ju/I1wD+LzfC15WFaL6/2A== X-Received: by 2002:a05:6000:81:: with SMTP id m1mr8479062wrx.94.1644778324070; Sun, 13 Feb 2022 10:52:04 -0800 (PST) Received: from veiron.westermo.com (static-193-12-47-89.cust.tele2.se. [193.12.47.89]) by smtp.gmail.com with ESMTPSA id j5sm25659049wrq.31.2022.02.13.10.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Feb 2022 10:52:03 -0800 (PST) From: Tobias Waldekranz To: davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , Russell King , =?UTF-8?q?Marek=20Beh=C3=BAn?= , "Russell King (Oracle)" , linux-kernel@vger.kernel.org Subject: [PATCH v2 net-next] net: dsa: mv88e6xxx: Fix validation of built-in PHYs on 6095/6097 Date: Sun, 13 Feb 2022 19:51:54 +0100 Message-Id: <20220213185154.3262207-1-tobias@waldekranz.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Organization: Westermo Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" These chips have 8 built-in FE PHYs and 3 SERDES interfaces that can run at 1G. With the blamed commit, the built-in PHYs could no longer be connected to, using an MII PHY interface mode. Create a separate .phylink_get_caps callback for these chips, which takes the FE/GE split into consideration. Fixes: 2ee84cfefb1e ("net: dsa: mv88e6xxx: convert to phylink_generic_valid= ate()") Signed-off-by: Tobias Waldekranz Reviewed-by: Russell King (Oracle) --- drivers/net/dsa/mv88e6xxx/chip.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/c= hip.c index 85527fe4fcc8..34036c555977 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -580,6 +580,25 @@ static const u8 mv88e6185_phy_interface_modes[] =3D { [MV88E6185_PORT_STS_CMODE_PHY] =3D PHY_INTERFACE_MODE_SGMII, }; =20 +static void mv88e6095_phylink_get_caps(struct mv88e6xxx_chip *chip, int po= rt, + struct phylink_config *config) +{ + u8 cmode =3D chip->ports[port].cmode; + + config->mac_capabilities =3D MAC_SYM_PAUSE | MAC_10 | MAC_100; + + if (mv88e6xxx_phy_is_internal(chip->ds, port)) { + __set_bit(PHY_INTERFACE_MODE_MII, config->supported_interfaces); + } else { + if (cmode < ARRAY_SIZE(mv88e6185_phy_interface_modes) && + mv88e6185_phy_interface_modes[cmode]) + __set_bit(mv88e6185_phy_interface_modes[cmode], + config->supported_interfaces); + + config->mac_capabilities |=3D MAC_1000FD; + } +} + static void mv88e6185_phylink_get_caps(struct mv88e6xxx_chip *chip, int po= rt, struct phylink_config *config) { @@ -3803,7 +3822,7 @@ static const struct mv88e6xxx_ops mv88e6095_ops =3D { .reset =3D mv88e6185_g1_reset, .vtu_getnext =3D mv88e6185_g1_vtu_getnext, .vtu_loadpurge =3D mv88e6185_g1_vtu_loadpurge, - .phylink_get_caps =3D mv88e6185_phylink_get_caps, + .phylink_get_caps =3D mv88e6095_phylink_get_caps, .set_max_frame_size =3D mv88e6185_g1_set_max_frame_size, }; =20 @@ -3850,7 +3869,7 @@ static const struct mv88e6xxx_ops mv88e6097_ops =3D { .rmu_disable =3D mv88e6085_g1_rmu_disable, .vtu_getnext =3D mv88e6352_g1_vtu_getnext, .vtu_loadpurge =3D mv88e6352_g1_vtu_loadpurge, - .phylink_get_caps =3D mv88e6185_phylink_get_caps, + .phylink_get_caps =3D mv88e6095_phylink_get_caps, .set_max_frame_size =3D mv88e6185_g1_set_max_frame_size, }; =20 --=20 2.25.1