mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Łukasz Stelmach" <l.stelmach@samsung.com>
To: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Bartłomiej Żolnierkiewicz" <b.zolnierkie@samsung.com>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Łukasz Stelmach" <l.stelmach@samsung.com>
Subject: [PATCH] net: phy: Prevent reporting advertised modes when autoneg is off
Date: Wed, 14 Oct 2020 14:56:50 +0200	[thread overview]
Message-ID: <20201014125650.12137-1-l.stelmach@samsung.com> (raw)
In-Reply-To: <CGME20201014125655eucas1p129ba3322a72b17a19a533e7a2890ff88@eucas1p1.samsung.com>

Do not report advertised link modes when autonegotiation is turned
off. mii_ethtool_get_link_ksettings() exhibits the same behaviour.

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
---
 drivers/net/phy/phy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 35525a671400..3cadf224fdb2 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -315,7 +315,8 @@ void phy_ethtool_ksettings_get(struct phy_device *phydev,
 			       struct ethtool_link_ksettings *cmd)
 {
 	linkmode_copy(cmd->link_modes.supported, phydev->supported);
-	linkmode_copy(cmd->link_modes.advertising, phydev->advertising);
+	if (phydev->autoneg)
+		linkmode_copy(cmd->link_modes.advertising, phydev->advertising);
 	linkmode_copy(cmd->link_modes.lp_advertising, phydev->lp_advertising);
 
 	cmd->base.speed = phydev->speed;
-- 
2.26.2


       reply	other threads:[~2020-10-14 12:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20201014125655eucas1p129ba3322a72b17a19a533e7a2890ff88@eucas1p1.samsung.com>
2020-10-14 12:56 ` Łukasz Stelmach [this message]
2020-10-14 13:32   ` Russell King - ARM Linux admin
     [not found]     ` <CGME20201014144018eucas1p101424a57f5bf63eabb3dc24177551dff@eucas1p1.samsung.com>
2020-10-14 14:39       ` Lukasz Stelmach
2020-10-14 22:04         ` Russell King - ARM Linux admin
     [not found]           ` <CGME20201014233749eucas1p239bd9b81aca3ddaa1d589ffeed930a08@eucas1p2.samsung.com>
2020-10-14 23:37             ` Lukasz Stelmach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201014125650.12137-1-l.stelmach@samsung.com \
    --to=l.stelmach@samsung.com \
    --cc=andrew@lunn.ch \
    --cc=b.zolnierkie@samsung.com \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=m.szyprowski@samsung.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®