netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Hancock <robert.hancock@calian.com>
To: "andrew@lunn.ch" <andrew@lunn.ch>
Cc: "linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"michal.simek@xilinx.com" <michal.simek@xilinx.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"radhey.shyam.pandey@xilinx.com" <radhey.shyam.pandey@xilinx.com>
Subject: Re: [PATCH] net: axienet: Properly handle PCS/PMA PHY for 1000BaseX mode
Date: Mon, 19 Oct 2020 21:48:43 +0000	[thread overview]
Message-ID: <c989910aee122cfa9d29994d9ce650ce486442ca.camel@calian.com> (raw)
In-Reply-To: <20201019213638.GW139700@lunn.ch>

On Mon, 2020-10-19 at 23:36 +0200, Andrew Lunn wrote:
> >  static void axienet_mac_config(struct phylink_config *config,
> > unsigned int mode,
> >  			       const struct phylink_link_state *state)
> >  {
> > -	/* nothing meaningful to do */
> > +	struct net_device *ndev = to_net_dev(config->dev);
> > +	struct axienet_local *lp = netdev_priv(ndev);
> > +	int ret;
> > +
> > +	switch (state->interface) {
> > +	case PHY_INTERFACE_MODE_SGMII:
> > +	case PHY_INTERFACE_MODE_1000BASEX:
> > +		ret = phylink_mii_c22_pcs_config(lp->pcs_phy, mode,
> > +						 state->interface,
> > +						 state->advertising);
> > +		if (ret < 0)
> > +			netdev_warn(ndev, "Failed to configure PCS:
> > %d\n",
> > +				    ret);
> > +
> > +		/* Ensure isolate bit is cleared */
> > +		ret = mdiobus_modify(lp->pcs_phy->bus, lp->pcs_phy-
> > >addr,
> > +				     MII_BMCR, BMCR_ISOLATE, 0);
> 
> Hi Robert
> 
> That looks like a layering violation. Maybe move this into
> phylink_mii_c22_pcs_config(), it is accessing MII_BMCR anyway.

Could do - do we think there's any harm in just disabling BMCR_ISOLATE
in all cases in that function?

-- 
Robert Hancock
Senior Hardware Designer, Advanced Technologies 
www.calian.com

  reply	other threads:[~2020-10-19 21:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 20:39 [PATCH] net: axienet: Properly handle PCS/PMA PHY for 1000BaseX mode Robert Hancock
2020-10-19 21:36 ` Andrew Lunn
2020-10-19 21:48   ` Robert Hancock [this message]
2020-10-19 22:04     ` 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=c989910aee122cfa9d29994d9ce650ce486442ca.camel@calian.com \
    --to=robert.hancock@calian.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=michal.simek@xilinx.com \
    --cc=netdev@vger.kernel.org \
    --cc=radhey.shyam.pandey@xilinx.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).