All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] net: phy: improve setting advertised modes in phy_probe
Date: Sun, 28 Apr 2019 20:10:43 +0200	[thread overview]
Message-ID: <b7ece77b-c7cc-ba54-2caf-c25c19de0724@gmail.com> (raw)
In-Reply-To: <20190428170456.GL23059@lunn.ch>

On 28.04.2019 19:04, Andrew Lunn wrote:
> On Sun, Apr 28, 2019 at 03:03:37PM +0200, Heiner Kallweit wrote:
>> So far we set the advertising bitmap before setting the pause flags
>> in the supported bitmap. This may cause pause not being advertised.
> 
> Hi Heiner
> 
> Pause requires that the PHY can advertise the pause bits, and that the
> MAC supports pause. So by default, we don't advertise pause. The MAC
> needs to say it supports pause, by calling one of
> 
> void phy_support_sym_pause(struct phy_device *phydev);
> void phy_support_asym_pause(struct phy_device *phydev);
> 
> These two then copy supported into advertising.
> 
Right, missed that. After checking the code a little bit more I think
we still may have few issues with pause settings.

1.
We have functions that copy supported -> advertising, e.g.
phy_set_max_speed(). If such a function is called pause gets advertised
even w/o the MAC calling one of the two functions.

2.
We have PHY's (e.g. KSZ9031) that support sym pause only due to a hw
erratum. If the MAC now calls phy_support_asym_pause() it sets the
asym pause flag in phydev->supported even though the PHY intentionally
disabled it. That's not nice ..

Maybe we should do it differently:
Apply my patch, then both pause modes are initially advertised.
(This also avoids point 3 below)
- remove phy_support_asym_pause()
- phy_support_sym_pause() clears the asym pause bit and doesn't touch
  sym pause bit.
- and we may need something like phy_support_no_pause().

3.
What's with all the existing drivers where the MAC supports pause but
drivers call neither of the two functions?

4.
Calling either of the two functions will be effective after an autoneg
restart only. Do we have to consider this?

>       Andrew
> 
Heiner

  reply	other threads:[~2019-04-28 18:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-28 13:03 [PATCH net-next] net: phy: improve setting advertised modes in phy_probe Heiner Kallweit
2019-04-28 17:04 ` Andrew Lunn
2019-04-28 18:10   ` Heiner Kallweit [this message]
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=b7ece77b-c7cc-ba54-2caf-c25c19de0724@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.