netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Quentin Schulz <quentin.schulz@bootlin.com>,
	Manu Gautam <mgautam@codeaurora.org>,
	Tony Lindgren <tony@atomide.com>,
	netdev@vger.kernel.org,
	Antoine Tenart <antoine.tenart@free-electrons.com>,
	Sekhar Nori <nsekhar@ti.com>,
	linux-kernel@vger.kernel.org,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Chunfeng Yun <chunfeng.yun@mediatek.com>,
	linux-mediatek@lists.infradead.org,
	Vivek Gautam <vivek.gautam@codeaurora.org>,
	Carlo Caione <carlo@caione.org>,
	linux-amlogic@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	Matthias Brugger <matthias.bgg@gmail.com>
Subject: Re: [PATCH 4/5] phy: mvebu-cp110-comphy: convert to use eth phy mode and submode
Date: Thu, 8 Nov 2018 22:21:23 +0000	[thread overview]
Message-ID: <20181108222123.GZ30658@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20181108003617.10334-5-grygorii.strashko@ti.com>

On Wed, Nov 07, 2018 at 06:36:16PM -0600, Grygorii Strashko wrote:
> diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> index 7a37a37..fb28b71 100644
> --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> @@ -1165,28 +1165,17 @@ static void mvpp22_gop_setup_irq(struct mvpp2_port *port)
>   */
>  static int mvpp22_comphy_init(struct mvpp2_port *port)
>  {
> -	enum phy_mode mode;
> +	int submode;
>  	int ret;
>  
>  	if (!port->comphy)
>  		return 0;
>  
> -	switch (port->phy_interface) {
> -	case PHY_INTERFACE_MODE_SGMII:
> -	case PHY_INTERFACE_MODE_1000BASEX:
> -		mode = PHY_MODE_SGMII;
> -		break;
> -	case PHY_INTERFACE_MODE_2500BASEX:
> -		mode = PHY_MODE_2500SGMII;
> -		break;
> -	case PHY_INTERFACE_MODE_10GKR:
> -		mode = PHY_MODE_10GKR;
> -		break;
> -	default:
> -		return -EINVAL;
> -	}
> +	submode = port->phy_interface;
> +	if (submode == PHY_INTERFACE_MODE_1000BASEX)
> +		submode = PHY_INTERFACE_MODE_SGMII;

If the intention is to move the ethernet PHY mode into the generic PHY
layer, I'd suggest that the equivalence of 1000base-X and SGMII is
handled in the generic PHY driver rather than ethernet drivers.  Just
move this into this hunk of the comphy driver:

> @@ -517,10 +519,14 @@ static int mvebu_comphy_set_mode(struct phy *phy,
>  {
>  	struct mvebu_comphy_lane *lane = phy_get_drvdata(phy);
>  
> -	if (mvebu_comphy_get_mux(lane->id, lane->port, mode) < 0)
> +	if (mode != PHY_MODE_ETHERNET)
> +		return -EINVAL;
> +
> +	if (mvebu_comphy_get_mux(lane->id, lane->port, mode, submode) < 0)
>  		return -EINVAL;
>  
>  	lane->mode = mode;
> +	lane->submode = submode;
>  	return 0;
>  }

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

  reply	other threads:[~2018-11-09  7:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-08  0:36 [PATCH 0/5] hy: core: rework phy_set_mode to accept phy mode and submode Grygorii Strashko
2018-11-08  0:36 ` [PATCH 2/5] phy: core: add PHY_MODE_ETHERNET Grygorii Strashko
2018-11-08  0:42   ` Russell King - ARM Linux
2018-11-08 18:12     ` Grygorii Strashko
     [not found] ` <20181108003617.10334-1-grygorii.strashko-l0cyMroinI0@public.gmane.org>
2018-11-08  0:36   ` [PATCH 1/5] phy: core: rework phy_set_mode to accept phy mode and submode Grygorii Strashko
2018-11-08  0:36   ` [PATCH 3/5] phy: ocelot-serdes: convert to use eth " Grygorii Strashko
2018-11-08  0:36 ` [PATCH 4/5] phy: mvebu-cp110-comphy: " Grygorii Strashko
2018-11-08 22:21   ` Russell King - ARM Linux [this message]
2018-11-08 22:42     ` Grygorii Strashko
2018-11-16 16:05   ` Maxime Chevallier
2018-11-08  0:36 ` [PATCH 5/5] phy: core: clean up unused ethernet specific phy modes Grygorii Strashko
2018-11-09  3:20 ` [PATCH 0/5] hy: core: rework phy_set_mode to accept phy mode and submode 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=20181108222123.GZ30658@n2100.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=alexandre.belloni@bootlin.com \
    --cc=antoine.tenart@free-electrons.com \
    --cc=carlo@caione.org \
    --cc=chunfeng.yun@mediatek.com \
    --cc=davem@davemloft.net \
    --cc=grygorii.strashko@ti.com \
    --cc=kishon@ti.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=mgautam@codeaurora.org \
    --cc=netdev@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=quentin.schulz@bootlin.com \
    --cc=tony@atomide.com \
    --cc=vivek.gautam@codeaurora.org \
    --cc=wens@csie.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 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).