From: Andrew Lunn <andrew@lunn.ch>
To: Tristram.Ha@microchip.com
Cc: Florian Fainelli <f.fainelli@gmail.com>,
Pavel Machek <pavel@ucw.cz>,
Ruediger Schmitt <ruediger.schmitt@philips.com>,
Arkadi Sharshevsky <arkadis@mellanox.com>,
UNGLinuxDriver@microchip.com, netdev@vger.kernel.org
Subject: Re: [PATCH v2 net-next 7/8] net: dsa: microchip: Prepare PHY for proper advertisement
Date: Wed, 6 Dec 2017 19:56:03 +0100 [thread overview]
Message-ID: <20171206185603.GB28774@lunn.ch> (raw)
In-Reply-To: <1512524798-16210-8-git-send-email-Tristram.Ha@microchip.com>
Hi Tristram
> +static void ksz9477_phy_setup(struct ksz_device *dev, int port,
> + struct phy_device *phy)
> +{
> + if (port < dev->phy_port_cnt) {
> + /* SUPPORTED_Asym_Pause and SUPPORTED_Pause can be removed to
> + * disable flow control when rate limiting is used.
> + */
> + phy->advertising = phy->supported;
> + }
This looks a bit odd. phy_probe() does the same:
/* Start out supporting everything. Eventually,
* a controller will attach, and may modify one
* or both of these values
*/
phydev->supported = phydrv->features;
of_set_phy_supported(phydev);
phydev->advertising = phydev->supported;
You don't modify anything here, so i don't see why it is needed.
> +void ksz_adjust_link(struct dsa_switch *ds, int port,
> + struct phy_device *phydev)
> +{
> + struct ksz_device *dev = ds->priv;
> + struct ksz_port *p = &dev->ports[port];
> +
> + if (phydev->link) {
> + p->speed = phydev->speed;
> + p->duplex = phydev->duplex;
> + p->flow_ctrl = phydev->pause;
> + p->link_up = 1;
> + dev->live_ports |= (1 << port) & dev->on_ports;
> + } else if (p->link_up) {
> + p->link_up = 0;
> + p->link_down = 1;
> + dev->live_ports &= ~(1 << port);
> + }
The link_down looks odd. If you are setting link_up to 1, should
link_down also be set to 0? Can it be both up and down at the same
time?
Andrew
next prev parent reply other threads:[~2017-12-06 18:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-06 1:46 [PATCH v2 net-next 0/8] net: dsa: microchip: Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers Tristram.Ha
2017-12-06 1:46 ` [PATCH v2 net-next 1/8] net: dsa: microchip: Replace license with GPL Tristram.Ha
2017-12-06 1:46 ` [PATCH v2 net-next 2/8] net: dsa: microchip: Clean up code according to patch check suggestions Tristram.Ha
2017-12-06 1:46 ` [PATCH v2 net-next 3/8] net: dsa: microchip: Initialize mutex before use Tristram.Ha
2017-12-06 18:44 ` Andrew Lunn
2017-12-06 1:46 ` [PATCH v2 net-next 4/8] net: dsa: microchip: Rename some functions with ksz9477 prefix Tristram.Ha
2017-12-06 1:46 ` [PATCH v2 net-next 5/8] net: dsa: microchip: Rename ksz_spi.c to ksz9477_spi.c Tristram.Ha
2017-12-06 1:46 ` [PATCH v2 net-next 6/8] net: dsa: microchip: Break KSZ9477 DSA driver into two files Tristram.Ha
2017-12-06 1:46 ` [PATCH v2 net-next 7/8] net: dsa: microchip: Prepare PHY for proper advertisement Tristram.Ha
2017-12-06 18:56 ` Andrew Lunn [this message]
2017-12-06 21:55 ` Tristram.Ha
2017-12-06 22:56 ` Florian Fainelli
2017-12-06 1:46 ` [PATCH v2 net-next 8/8] net: dsa: microchip: Rename ksz_9477_reg.h to ksz9477_reg.h Tristram.Ha
2017-12-15 9:14 ` Pavel Machek
2018-08-16 0:28 ` [PATCH v2 net-next 0/8] net: dsa: microchip: Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers Florian Fainelli
2018-08-16 21:34 ` Tristram.Ha
2018-10-19 17:56 ` Florian Fainelli
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=20171206185603.GB28774@lunn.ch \
--to=andrew@lunn.ch \
--cc=Tristram.Ha@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=arkadis@mellanox.com \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=ruediger.schmitt@philips.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).