Message ID | 20230221050334.578012-1-o.rempel@pengutronix.de |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1683034wrn; Mon, 20 Feb 2023 21:19:43 -0800 (PST) X-Google-Smtp-Source: AK7set/nNhsBTTFjhyTRIpC9UlOIcDXNOGD+AXuTl0Lp7VIecK89UGZOWjRnmlh0b+7N3H8ehZ+L X-Received: by 2002:a17:907:a0d5:b0:8b8:c06e:52d8 with SMTP id hw21-20020a170907a0d500b008b8c06e52d8mr16329298ejc.36.1676956783025; Mon, 20 Feb 2023 21:19:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676956783; cv=none; d=google.com; s=arc-20160816; b=E9yM4MYa0sZ+feGk07VNrNeS1BPT6mW40ofV/uME2bXKitlQahSC+YDaZQJ1frLJgT KQbXHvbC/uO553GpbDy/89HnD0mn0KlKacCWV93g+GQu44m62kYvIBsAkU0Y6RlE1l7v b7aa0IU8lwXLY3SL2FytiFIfkpXjLkF7nBVnC9Rw45aXcnEsD02tVZc0ZVwZyz1WUI/z bhTO8P6lLPOzKtZzf9TJb0JWq0+kH43BGCaILsbG2MXb4JLvWBpgQ8NMDw390E6xS5pK 1T3yJfNQeLD3nMXf3A4tFguwyRUKxokyWtfR1Au5keeQqgcgwdxf7O7FhRmUKy4/gTzB OZCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=94H59Loq3qn0lTdHFWTGTOPpW9EJBvUHvRM/t2Dd/v4=; b=ycvjTS2JsNsOuDCnMkT1TTejvGqUJy2+jL1ve11xlhWV0YL7rQtL47jWnWdQs2mIq0 U1vFjcsrIsC7jNfy1RZ6fyghBrj2yfroj5nIbnHKn0bNzwJsoY4qxeexmkNT3JEgGDI6 PMSzUupCT35O8RKQfnBscl/cEAJmY6Rr9M5Si/3c5EDJFC3/OJFhq70HG/giYwwKe3i9 rXeM2x1rTBgaxEaMi8ojfe/8wWVFzehRYqCw2EiEfUYKy/z95dDjMOuj/F40FacnfYsO mnE9boHe2wNvNrvnY/3a8WJOTZ03A1y7xlQFKCnzTNmfoncB+frJaqc9HEGDC6PB90Lp H5kA== ARC-Authentication-Results: i=1; mx.google.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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id vs23-20020a170907139700b008d2262654c7si4983553ejb.203.2023.02.20.21.19.20; Mon, 20 Feb 2023 21:19:43 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231916AbjBUFDv (ORCPT <rfc822;kautuk.consul.80@gmail.com> + 99 others); Tue, 21 Feb 2023 00:03:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbjBUFDu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 21 Feb 2023 00:03:50 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F70218AAC for <linux-kernel@vger.kernel.org>; Mon, 20 Feb 2023 21:03:47 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <ore@pengutronix.de>) id 1pUKoU-0002zs-4E; Tue, 21 Feb 2023 06:03:38 +0100 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from <ore@pengutronix.de>) id 1pUKoR-006PyO-8y; Tue, 21 Feb 2023 06:03:36 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from <ore@pengutronix.de>) id 1pUKoR-002QNj-O0; Tue, 21 Feb 2023 06:03:35 +0100 From: Oleksij Rempel <o.rempel@pengutronix.de> To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: Oleksij Rempel <o.rempel@pengutronix.de>, kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Russell King <linux@armlinux.org.uk> Subject: [PATCH net-next v2 0/4] net: phy: EEE fixes Date: Tue, 21 Feb 2023 06:03:30 +0100 Message-Id: <20230221050334.578012-1-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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?1758416635418574757?= X-GMAIL-MSGID: =?utf-8?q?1758416635418574757?= |
Series |
net: phy: EEE fixes
|
|
Message
Oleksij Rempel
Feb. 21, 2023, 5:03 a.m. UTC
changes v2: - restore previous ethtool set logic for the case where advertisements are not provided by user space. - use ethtool_convert_legacy_u32_to_link_mode() where possible - genphy_c45_an_config_eee_aneg(): move adv initialization in to the if scope. Different EEE related fixes. Oleksij Rempel (4): net: phy: c45: use "supported_eee" instead of supported for access validation net: phy: c45: add genphy_c45_an_config_eee_aneg() function net: phy: do not force EEE support net: phy: c45: genphy_c45_ethtool_set_eee: validate EEE link modes drivers/net/phy/phy-c45.c | 55 ++++++++++++++++++++++++++++-------- drivers/net/phy/phy_device.c | 21 +++++++++++++- include/linux/phy.h | 6 ++++ 3 files changed, 69 insertions(+), 13 deletions(-)
Comments
On Tue, Feb 21, 2023 at 06:03:30AM +0100, Oleksij Rempel wrote: > changes v2: > - restore previous ethtool set logic for the case where advertisements > are not provided by user space. I don't think the _kernel_ should be doing this - this introduces a different behaviour to the kernel. As I already said, setting the default advertisement in the case of ethtool -s is done by userspace not by the kernel. In fact, the kernel explicitly rejects an attempt to have autoneg enabled with a zero advertising mask: linkmode_copy(advertising, cmd->link_modes.advertising); linkmode_and(advertising, advertising, phydev->supported); if (autoneg == AUTONEG_ENABLE && linkmode_empty(advertising)) return -EINVAL; and I think we should have a uniform behaviour with the same API, rather than different behaviours, as that becomes quite messy.
On Tue, Feb 21, 2023 at 09:36:35AM +0000, Russell King (Oracle) wrote: > On Tue, Feb 21, 2023 at 06:03:30AM +0100, Oleksij Rempel wrote: > > changes v2: > > - restore previous ethtool set logic for the case where advertisements > > are not provided by user space. > > I don't think the _kernel_ should be doing this - this introduces a > different behaviour to the kernel. As I already said, setting the > default advertisement in the case of ethtool -s is done by userspace > not by the kernel. > > In fact, the kernel explicitly rejects an attempt to have autoneg > enabled with a zero advertising mask: > > linkmode_copy(advertising, cmd->link_modes.advertising); > linkmode_and(advertising, advertising, phydev->supported); > if (autoneg == AUTONEG_ENABLE && linkmode_empty(advertising)) > return -EINVAL; > > and I think we should have a uniform behaviour with the same API, > rather than different behaviours, as that becomes quite messy. I decided to revert this part to not mix different issue. This logic existed before my refactoring. So, it is better to handle it as different patch. Current patch set should address only regressions.
On Tue, Feb 21, 2023 at 10:48:09AM +0100, Oleksij Rempel wrote: > On Tue, Feb 21, 2023 at 09:36:35AM +0000, Russell King (Oracle) wrote: > > On Tue, Feb 21, 2023 at 06:03:30AM +0100, Oleksij Rempel wrote: > > > changes v2: > > > - restore previous ethtool set logic for the case where advertisements > > > are not provided by user space. > > > > I don't think the _kernel_ should be doing this - this introduces a > > different behaviour to the kernel. As I already said, setting the > > default advertisement in the case of ethtool -s is done by userspace > > not by the kernel. > > > > In fact, the kernel explicitly rejects an attempt to have autoneg > > enabled with a zero advertising mask: > > > > linkmode_copy(advertising, cmd->link_modes.advertising); > > linkmode_and(advertising, advertising, phydev->supported); > > if (autoneg == AUTONEG_ENABLE && linkmode_empty(advertising)) > > return -EINVAL; > > > > and I think we should have a uniform behaviour with the same API, > > rather than different behaviours, as that becomes quite messy. > > I decided to revert this part to not mix different issue. This logic > existed before my refactoring. So, it is better to handle it as > different patch. Current patch set should address only regressions. Okay, let's keep it like that then. Thanks.
On Tue, 2023-02-21 at 06:03 +0100, Oleksij Rempel wrote: > changes v2: > - restore previous ethtool set logic for the case where advertisements > are not provided by user space. > - use ethtool_convert_legacy_u32_to_link_mode() where possible > - genphy_c45_an_config_eee_aneg(): move adv initialization in to the if > scope. > > Different EEE related fixes. > > Oleksij Rempel (4): > net: phy: c45: use "supported_eee" instead of supported for access > validation > net: phy: c45: add genphy_c45_an_config_eee_aneg() function > net: phy: do not force EEE support > net: phy: c45: genphy_c45_ethtool_set_eee: validate EEE link modes > > drivers/net/phy/phy-c45.c | 55 ++++++++++++++++++++++++++++-------- > drivers/net/phy/phy_device.c | 21 +++++++++++++- > include/linux/phy.h | 6 ++++ > 3 files changed, 69 insertions(+), 13 deletions(-) > # Form letter - net-next is closed The merge window for v6.3 has begun and therefore net-next is closed for new drivers, features, code refactoring and optimizations. We are currently accepting bug fixes only. Please repost when net-next reopens after Mar 6th. RFC patches sent for review only are obviously welcome at any time.
On Tue, 2023-02-21 at 12:45 +0100, Paolo Abeni wrote: > On Tue, 2023-02-21 at 06:03 +0100, Oleksij Rempel wrote: > > changes v2: > > - restore previous ethtool set logic for the case where advertisements > > are not provided by user space. > > - use ethtool_convert_legacy_u32_to_link_mode() where possible > > - genphy_c45_an_config_eee_aneg(): move adv initialization in to the if > > scope. > > > > Different EEE related fixes. > > > > Oleksij Rempel (4): > > net: phy: c45: use "supported_eee" instead of supported for access > > validation > > net: phy: c45: add genphy_c45_an_config_eee_aneg() function > > net: phy: do not force EEE support > > net: phy: c45: genphy_c45_ethtool_set_eee: validate EEE link modes > > > > drivers/net/phy/phy-c45.c | 55 ++++++++++++++++++++++++++++-------- > > drivers/net/phy/phy_device.c | 21 +++++++++++++- > > include/linux/phy.h | 6 ++++ > > 3 files changed, 69 insertions(+), 13 deletions(-) > > > # Form letter - net-next is closed > > The merge window for v6.3 has begun and therefore net-next is closed > for new drivers, features, code refactoring and optimizations. > We are currently accepting bug fixes only. > > Please repost when net-next reopens after Mar 6th. > > RFC patches sent for review only are obviously welcome at any time. It looks like I was a little too hasty here; these are fixes for code currently only on net-next. As such you can re-post (for -net) after that Linus's net-next pull and subsequent merge into -net. Thanks, Paolo