netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@savoirfairelinux.com,
	"David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH net-next 1/4] net: dsa: move up phy enabling in core
Date: Fri, 22 Sep 2017 18:32:58 +0200	[thread overview]
Message-ID: <20170922163258.GA3470@lunn.ch> (raw)
In-Reply-To: <20170922161753.19563-2-vivien.didelot@savoirfairelinux.com>

On Fri, Sep 22, 2017 at 12:17:50PM -0400, Vivien Didelot wrote:
> bcm_sf2 is currently the only driver using the phy argument passed to
> .port_enable. It resets the state machine if the phy has been hard
> reset. This check is generic and can be moved to DSA core.
>  
>  	dsa_port_set_state_now(p->dp, stp_state);
>  
> -	if (p->phy)
> -		phy_start(p->phy);
> +	if (phy) {
> +		/* If phy_stop() has been called before, phy will be in
> +		 * halted state, and phy_start() will call resume.
> +		 *
> +		 * The resume path does not configure back autoneg
> +		 * settings, and since the internal phy may have been
> +		 * hard reset, we need to reset the state machine also.
> +		 */
> +		phy->state = PHY_READY;
> +		phy_init_hw(phy);
> +		phy_start(phy);
> +	}

Hi Vivien

If this is generic, why is it needed at all here? Shouldn't this
actually by in phylib?

Florian ?

   Andrew

  reply	other threads:[~2017-09-22 16:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-22 16:17 [PATCH net-next 0/4] net: dsa: simplify port enabling Vivien Didelot
2017-09-22 16:17 ` [PATCH net-next 1/4] net: dsa: move up phy enabling in core Vivien Didelot
2017-09-22 16:32   ` Andrew Lunn [this message]
2017-09-22 16:58     ` Florian Fainelli
2017-09-22 16:52   ` Florian Fainelli
2017-09-22 16:17 ` [PATCH net-next 2/4] net: dsa: remove phy arg from port enable/disable Vivien Didelot
2017-09-22 17:14   ` Florian Fainelli
2017-09-22 18:12     ` Vivien Didelot
2017-09-22 18:23       ` Florian Fainelli
2017-09-22 19:11         ` Andrew Lunn
2017-09-22 16:17 ` [PATCH net-next 3/4] net: dsa: make slave close symmetrical to open Vivien Didelot
2017-09-22 16:34   ` Andrew Lunn
2017-09-22 17:15   ` Florian Fainelli
2017-09-22 16:17 ` [PATCH net-next 4/4] net: dsa: add port enable and disable helpers Vivien Didelot
2017-09-22 16:35   ` Andrew Lunn
2017-09-22 17:16   ` 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=20170922163258.GA3470@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@savoirfairelinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.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).