Message ID | 20230516154410.4012337-1-vladimir.oltean@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp540966vqo; Tue, 16 May 2023 09:08:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Hp3w9aHAKrMyKYgZkC5eBJqvVt00PMu4WOFw2e9IdTcJop90/39yM1xnmSzkz/lvTJzvW X-Received: by 2002:a05:6808:23d5:b0:395:fae4:7da4 with SMTP id bq21-20020a05680823d500b00395fae47da4mr4770799oib.5.1684253303035; Tue, 16 May 2023 09:08:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684253303; cv=pass; d=google.com; s=arc-20160816; b=nVKftnlFf9Y05MiK8asuYwT9VfnP20rpsZnrY5echeEQoEGEfM7IAQYjqobSpCy2ai E0CzQt1N9P9LfOhGoshVzB50ks7RttBV7BW0d2OzqiPqC547FXQpkEGP5PQUHWhgtI7I l3MDG3M9B58/KppWedXEEC/UJxkpRUbAG4zGmldSez45uATeOR6Eeyd7mjazLxoDJKbW xm5f5QjfMJs+VXQ59Lq21gX+Qw6EUvmOe0ggA5R5iZcRm5WEVR1RApPAFLYc3ZkdxDrg 4tpFJSfZun2LPe7INV1Kx7R3EVmiqQc+BZb6tXK2wgCTW3e9LEXPgu7Vhd9zemDHmfje RE/Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=UgItz6+LGBXMCLOpx3et6fGh8NUdfYz93TvZYNwvjtY=; b=val1xfIZRZAOp7fD9IgK9TLGXQxE9z8240MrDrgiDPiL6YjX0Ef/6kFt5bkxtXjv1v Ul7WRDYUFXThwh+Buf8Y3T/g5b2cuiai+Ke8shc9ji8SLZIYhqEet8aqgJcX32Hxw2oz h7L1Ln9im0kkppr8beJwGnPpgLqfpu4HfHF8XZFvgsitp6bIDO84GmSN7n+wwAnb/GvI D26vNfRx0+6uJddMAYZ/qYUENX+wQuPD+eQY3+uiR32QjNKx47qQ3HZbzVWtTg10gxbY FGgUhPTHUwpKBCqEVwvTFZ4a0g3oCStAZin1fxcLw6xMd5Tougm8clSDoN6akwUG9Xya FpaA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=L2dX28ox; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cp15-20020a056830660f00b006ac9b7fa271si6288690otb.34.2023.05.16.09.08.08; Tue, 16 May 2023 09:08:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=L2dX28ox; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234113AbjEPPpa (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Tue, 16 May 2023 11:45:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233418AbjEPPp1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 16 May 2023 11:45:27 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2055.outbound.protection.outlook.com [40.107.20.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA8728A78; Tue, 16 May 2023 08:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mWYK3MyVA8z5KABk/qCXm9AFHF0mQl9RLl8my/T3RBbeMXutTgLTvQZDS5N2RUG+6pJNxEkysgKOHQcToCWlJKMW12psM8eTjfL7iZNHeZPD+R2G1oixB5KtLSzDwkq2XoXkpQLYdklVj6Zk2zVijQjE3YVZtGUGR6SY8MMfdBZ166R7vYX7svhgo7yTQVvtTPn53uC1dnRvKT3J4jOOZKAvlfC3ZacA/CsekO9fqVlBpKShz0hD7+y9nHkyBxGobdg2QXlbF9MxBrUJ1BokzH71AqN7WMl/qUu44XIiwWFwSfD9oTbIw5fbjXj9fOBBQvZEyOWuk1K6UlxvH4f1ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UgItz6+LGBXMCLOpx3et6fGh8NUdfYz93TvZYNwvjtY=; b=hnvjUGOPe259o4/h4M58ZxeFO0OtTnH6rTLEVELo92wt/CCs2SzrJoK5d23WfJNo8cJ8UhmEvbDUr9MG2Iua2L9Rb2m+2KMcb9TeOJDQScD0rNYgdWxMPgssJ/eQ/Nj5ZmyGxWtxICCvl67xhztUAVVVY/jRYUGf22Jok8s7KrqMHjIaLNx7WcTdJnd4q+C+6lQV2ADYiuHwoYBfOuBlypwI7wY79EV1TjrThjktwCh1C9+FmM2uZqS08Mlme0GlVt5WqQppH/6Iur0P/SVDLl/70DFKdbsJtlnqLrdBTlEcNFU8x1cL3ftIV5O/88U8Zm1j6YY/Hn5tF/N6FqKKwg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UgItz6+LGBXMCLOpx3et6fGh8NUdfYz93TvZYNwvjtY=; b=L2dX28ox252ERCHKMEsAH3Ni34Syxvcoamvn/yXDDD8VRiOw+UfUFXKumXH1v+tlejmvTQpmi0+NBWVayMK0inUprOlOsJWkrmvN9q6b6g6Agy6uzf7BAgjIjvIhKerxg5hcMQWJhc08f+9Rmj/UUx64QwbYngOaRbT2F/b9Gas= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AM9PR04MB7668.eurprd04.prod.outlook.com (2603:10a6:20b:2dd::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.24; Tue, 16 May 2023 15:44:30 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::b027:17aa:e5f5:4fea]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::b027:17aa:e5f5:4fea%5]) with mapi id 15.20.6387.032; Tue, 16 May 2023 15:44:30 +0000 From: Vladimir Oltean <vladimir.oltean@nxp.com> To: netdev@vger.kernel.org Cc: Jose Abreu <Jose.Abreu@synopsys.com>, Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, linux-kernel@vger.kernel.org Subject: [PATCH net] net: pcs: xpcs: fix C73 AN not getting enabled Date: Tue, 16 May 2023 18:44:10 +0300 Message-Id: <20230516154410.4012337-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: VI1PR0502CA0014.eurprd05.prod.outlook.com (2603:10a6:803:1::27) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM9PR04MB7668:EE_ X-MS-Office365-Filtering-Correlation-Id: 82b9b869-79d2-4d3e-b78e-08db56247002 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zOif2akDFrKMcrysjGJmvThZwZ6Jo5G82q223vLMZfezK84xcTPL9HuyGg/vDSPlPaRKW+tpYiGlZC389bTzuA4T6+3tsxNnpvRKxPKlmzp/hl4L18VyK8ysXUATn9VypNPcjxkBgjnjekrbV2x/sY/o3XpogFb1izcJ9Z+jd/bPiiXUpjR66cRPXTG/GHXfxnGBjlhbLabWLQNtMsZIt3zWG2oFRakT/DFW3iUhQw4HLCjdmrFTxQmu0SpLPqpCxgTO1y/pr2aywL2pLTA7HzcLOIAHmWts8oYobATKEUMH+lZWsbENjyGirOlGL8hzDXxy87iIk5S707Qo6VUd5qIkUgEAmhPPpFYjcE4ethEoeO6Ln5WZMQhGOAdm8SLqNTFNN2QvsJMF8Uo9DIRRefotYOW01HkkPrgwQU1t7lx/BkmfdNItyP3PGSVMcw/2Rn7RiP5cOnnvoF2QhR69yf3HG5EVJzOM3k5wDdZNac+JO8UmNfOuuHzQH5kAuVfKTIbBiRcPgKP6VS2hiJBP2UQwfaNFoZg5Tht3lPZaGegBKZdfFSiq8NNsk7aiTa2dwd8TgEdz8p4KHAp6slTRbeGU77sveGKHJIuRO+G97h4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(376002)(346002)(396003)(136003)(39860400002)(451199021)(36756003)(8676002)(44832011)(5660300002)(8936002)(2906002)(7416002)(2616005)(66556008)(66476007)(41300700001)(66946007)(4326008)(83380400001)(6916009)(316002)(86362001)(6506007)(186003)(478600001)(1076003)(6512007)(54906003)(38100700002)(26005)(38350700002)(52116002)(966005)(6666004)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FFyd9+RcXWYi5hDU43BTRVBXDgaCiHI4RmdqH3QNHmVg6IbgKcrToiSF/mg5D1VzHvup+ggOX03KDjM35e0ysdduW3PVjoxWw5YSNjCOMHI5uCRJI17AMVhszrwT8RmUYwRU0d8FDhH7wMlNyqk0bHPEpEsBeoqLZaJ9hPRiKUu8fLV1AWEk3g2AHES3LZFjMsDOH+wiHmkWJeM2/XJ0UBsbrk8IRVbopH98G9I6qhNgfYgnpFl/QdUAQbaaE79aQN3Nl+ATeizq9bTuvWWT8MBCW0SOpqJQaxjrDNZBsWwPzphvsFBbtCey5+ArsxyitW1BjhH8NN3ecRYDWhqTfaF9he3strPHR5WJE1fFBqnjmrmHyxdqzfXIIS7CXMVRRPLdQWBjP6/1Xl1aeBnoGPrZ/K0t5aQTmiyTVgdwrtmBUAVmp/HmWH4WGixuryRfn1+Z8PwPAjBwB46m4fhCQAnNcNZaSxAY4KaaTBtsNTGO2jP5K8SmYJBjTx0lBG+JiJ4tSryx56Lz7Y8HnutuwPaA8+SPL4kM/MUHozlmuJC7tMA5QudaYxvSgjMe0MBLqgDXgHvd2oefdu2ZOwlbEQxbUUVxP7esyD6PlN5jCRsAtfkWf6kUoGG+dPdNSkPJg6zdTko8FSKjHOqWAwN2sT++b5wxboLl7zEdSUm/rWXqJZOA3UaRiUbLe+Fm4vcKoAgEavSLHyDneZfeJOGs5QEnELhqbpwRlUdl/ChxPCVavPjRuK8k02OhLZ1wtNBWeVZvCPhz5zvtI6wp4bJgx64ct8MAf97N5WrwQFNZWVlPaIbkNqSZp/Lus9Do2II/F8CltD6IBHmi2krywb30QbAK4iDEy04AW+0WkzzFuDQEapdiLYP0lo9zRT3NsLI/oVb//tfsTiqUSxLir8dZPIPfo8MZNa+xQfYa/72dgITx8aoHASIiSET1NOlevD4nAhA/An4PE5F/Yv9D+6HHBJtnue3w8968PX9nPHrH0Jiquc7i6gzVGCPtPe8j9UEimDW8n1H54GVArvr3KWy8418dzqYYZ2hGmc1gxa7RlEjUGO7PTm108Z92WEGk+UFTTw3eijeZKe/CXJ/WGmsBLj7//uE2neLb6nYqcAWZk4bjbTSSqjiOZhihVBY0Lxbifnwq51LIqmniEOaoT5eVm5W2D+P5rOBwnK0SeHEnwc2evem+o5LDGJfZy2XuAlurFtAsprp3MO6/7IeLhaZ8PM6Zn+bbCpgVQDiFjofx4FmIKAqbd3/4l2gWpt0dMZqaV3uoaXZb65SERI/9bJp0jSu+b9/0dFU21T0rGkGsnhyVfYLLlGu0uYS13yAP0iCZBn765aWkxgOyp63xw6MOwsr5zu61y36+frtU0FixeSrb5EcgDoK+TUREdCZgbIBmwCBPTk0m7XYkMtD/VEYlOTS+VS12Pe5pDxQvAu70dGptv2WP6pXpjxnf3GF74YCcfVVERHtCQtIcl5aZtBzNkN5OCLC1GNRPnx0gNT9spzJshBPQOgCZfw1FG9l0aocmyDmnRuu1Z2/WAZIlyNWpkBp7vEM8J5jR4V95eOcIQncZheAtq3Ej3HPAsyt837VzoZfcGVY+XYFjUrOipp0L3A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82b9b869-79d2-4d3e-b78e-08db56247002 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2023 15:44:30.2736 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 32zkwaswPEIJB80nJcFWEuhqbrzAN9ijVQt1ZfJRUqWH0XSXUhfRrGJ5peLXFaFgc1orlTCHogJ9DzLymWmUIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7668 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766067591506237420?= X-GMAIL-MSGID: =?utf-8?q?1766067591506237420?= |
Series |
[net] net: pcs: xpcs: fix C73 AN not getting enabled
|
|
Commit Message
Vladimir Oltean
May 16, 2023, 3:44 p.m. UTC
The XPCS expects clause 73 (copper backplane) autoneg to follow the
ethtool autoneg bit. It actually did that until the blamed
commit inaptly replaced state->an_enabled (coming from ethtool) with
phylink_autoneg_inband() (coming from the device tree or struct
phylink_config), as part of an unrelated phylink_pcs API conversion.
Russell King suggests that state->an_enabled from the original code was
just a proxy for the ethtool Autoneg bit, and that the correct way of
restoring the functionality is to check for this bit in the advertising
mask.
Fixes: 11059740e616 ("net: pcs: xpcs: convert to phylink_pcs_ops")
Link: https://lore.kernel.org/netdev/ZGNt2MFeRolKGFck@shell.armlinux.org.uk/
Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
The only (paranoid) test I've done is that the sja1105 driver (which
also calls xpcs_do_config() outside of phylink, and provides a NULL
pointer for "advertising") does not crash. Which was completely to be
expected, since none of the nxp_sja1105 XPCS compatible modes uses
DW_AN_C73.
drivers/net/pcs/pcs-xpcs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hello: This patch was applied to netdev/net.git (main) by David S. Miller <davem@davemloft.net>: On Tue, 16 May 2023 18:44:10 +0300 you wrote: > The XPCS expects clause 73 (copper backplane) autoneg to follow the > ethtool autoneg bit. It actually did that until the blamed > commit inaptly replaced state->an_enabled (coming from ethtool) with > phylink_autoneg_inband() (coming from the device tree or struct > phylink_config), as part of an unrelated phylink_pcs API conversion. > > Russell King suggests that state->an_enabled from the original code was > just a proxy for the ethtool Autoneg bit, and that the correct way of > restoring the functionality is to check for this bit in the advertising > mask. > > [...] Here is the summary with links: - [net] net: pcs: xpcs: fix C73 AN not getting enabled https://git.kernel.org/netdev/net/c/c46e78ba9a7a You are awesome, thank you!
diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c index 539cd43eae8d..f680d03863ff 100644 --- a/drivers/net/pcs/pcs-xpcs.c +++ b/drivers/net/pcs/pcs-xpcs.c @@ -873,7 +873,7 @@ int xpcs_do_config(struct dw_xpcs *xpcs, phy_interface_t interface, switch (compat->an_mode) { case DW_AN_C73: - if (phylink_autoneg_inband(mode)) { + if (test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, advertising)) { ret = xpcs_config_aneg_c73(xpcs, compat); if (ret) return ret;