All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	David Miller <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: [PATCH net-next] net: phy: improve setting advertised modes in phy_probe
Date: Sun, 28 Apr 2019 15:03:37 +0200	[thread overview]
Message-ID: <13d4d69b-86a8-6c0d-a5a3-354f79a82170@gmail.com> (raw)

So far we set the advertising bitmap before setting the pause flags
in the supported bitmap. This may cause pause not being advertised.
At least r8169 driver works around this by copying supported ->
advertising on its own. The linkmode bitmaps have been introduced only
recently, therefore the patch wouldn't apply to older versions.
And behavior has been like this for years, therefore I'd consider it
an improvement.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/phy_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 2a2aaa5f3..c56897db2 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -2177,7 +2177,6 @@ static int phy_probe(struct device *dev)
 		phydev->is_gigabit_capable = 1;
 
 	of_set_phy_supported(phydev);
-	linkmode_copy(phydev->advertising, phydev->supported);
 
 	/* Get the EEE modes we want to prohibit. We will ask
 	 * the PHY stop advertising these mode later on
@@ -2203,6 +2202,8 @@ static int phy_probe(struct device *dev)
 				 phydev->supported);
 	}
 
+	linkmode_copy(phydev->advertising, phydev->supported);
+
 	/* Set the state to READY by default */
 	phydev->state = PHY_READY;
 
-- 
2.21.0


             reply	other threads:[~2019-04-28 13:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-28 13:03 Heiner Kallweit [this message]
2019-04-28 17:04 ` [PATCH net-next] net: phy: improve setting advertised modes in phy_probe Andrew Lunn
2019-04-28 18:10   ` Heiner Kallweit
2019-04-28 21:21     ` Andrew Lunn

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=13d4d69b-86a8-6c0d-a5a3-354f79a82170@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.