From: Parshuram Raju Thombare <pthombar@cadence.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "nicolas.ferre@microchip.com" <nicolas.ferre@microchip.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
"hkallweit1@gmail.com" <hkallweit1@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Rafal Ciepiela <rafalc@cadence.com>,
Piotr Sroka <piotrs@cadence.com>, Jan Kotas <jank@cadence.com>
Subject: RE: [PATCH 1/3] net: ethernet: add support for PCS and 2.5G speed
Date: Sat, 23 Feb 2019 06:24:10 +0000 [thread overview]
Message-ID: <CO2PR07MB246952FB454FDD08FA41F624C1780@CO2PR07MB2469.namprd07.prod.outlook.com> (raw)
In-Reply-To: <20190222213953.GN5894@lunn.ch>
>> /* mask with MAC supported features */
>> - if (macb_is_gem(bp) && bp->caps &
>MACB_CAPS_GIGABIT_MODE_AVAILABLE)
>> - phy_set_max_speed(phydev, SPEED_1000);
>> - else
>> - phy_set_max_speed(phydev, SPEED_100);
>> + if (macb_is_gem(bp)) {
>> + linkmode_copy(phydev->supported, PHY_GBIT_FEATURES);
>> + if (bp->caps & MACB_CAPS_TWO_PT_FIVE_GIG_SPEED)
>> +
> linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
>> + phydev->supported);
>> + } else {
>> + linkmode_copy(phydev->supported, PHY_BASIC_FEATURES);
>> + }
>> +
>> + linkmode_copy(phydev->advertising, phydev->supported);
>
>This is not correct. Just because the MAC can do 2.5G does not mean the PHY
>can. So you should not be adding links modes. Also, somebody might be using a
>PHY that can do 2.5G with a MAC which can only do 1G.
>
>The correct thing to do is call phy_set_max_speed() with the maximum speed the
>MAC can do.
Hi Andrew,
Ok, I think this should have been logical AND. I will modify to use phy_set_max_speed()
instead of directly copying linkmodes.
Regards,
Parshuram Thombare
next prev parent reply other threads:[~2019-02-23 6:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-22 20:12 [PATCH 1/3] net: ethernet: add support for PCS and 2.5G speed Parshuram Thombare
2019-02-22 21:39 ` Andrew Lunn
2019-02-23 6:24 ` Parshuram Raju Thombare [this message]
2019-02-25 2:31 ` Florian Fainelli
2019-02-25 9:11 ` Parshuram Raju Thombare
2019-02-25 17:21 ` Florian Fainelli
2019-02-26 9:23 ` Nicolas.Ferre
2019-02-26 17:09 ` David Miller
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=CO2PR07MB246952FB454FDD08FA41F624C1780@CO2PR07MB2469.namprd07.prod.outlook.com \
--to=pthombar@cadence.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=jank@cadence.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=piotrs@cadence.com \
--cc=rafalc@cadence.com \
/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;
as well as URLs for NNTP newsgroup(s).