linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: "Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Antoine Ténart" <antoine.tenart@bootlin.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH net] net: macb: Properly handle phylink on at91rm9200
Date: Mon, 17 Feb 2020 14:03:47 -0800	[thread overview]
Message-ID: <661c1e61-11c8-0c54-83a2-5e81674246e0@gmail.com> (raw)
In-Reply-To: <20200217104348.43164-1-alexandre.belloni@bootlin.com>



On 2/17/2020 2:43 AM, Alexandre Belloni wrote:
> at91ether_init was handling the phy mode and speed but since the switch to
> phylink, the NCFGR register got overwritten by macb_mac_config().
> 
> Add new phylink callbacks to handle emac and at91rm9200 properly.
> 
> Fixes: 7897b071ac3b ("net: macb: convert to phylink")
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---

[snip]

> +static void at91ether_mac_link_up(struct phylink_config *config,
> +				  unsigned int mode,
> +				  phy_interface_t interface,
> +				  struct phy_device *phy)
> +{
> +	struct net_device *ndev = to_net_dev(config->dev);
> +	struct macb *bp = netdev_priv(ndev);
> +
> +	/* Enable Rx and Tx */
> +	macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(RE) | MACB_BIT(TE));
> +
> +	netif_tx_wake_all_queues(ndev);

So this happens to be copied from the mvpp2 driver, if this is a
requirement, should not this be moved to the phylink implementation
since it already manages the carrier? Those two drivers are the only
ones doing this.
-- 
Florian

  parent reply	other threads:[~2020-02-17 22:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-17 10:43 [PATCH net] net: macb: Properly handle phylink on at91rm9200 Alexandre Belloni
2020-02-17 16:56 ` Russell King - ARM Linux admin
2020-02-17 17:06   ` Russell King - ARM Linux admin
2020-02-17 17:42   ` Alexandre Belloni
2020-02-17 18:47     ` Russell King - ARM Linux admin
2020-02-17 22:03 ` Florian Fainelli [this message]
2020-02-21 17:10   ` Russell King - ARM Linux admin

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=661c1e61-11c8-0c54-83a2-5e81674246e0@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=antoine.tenart@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.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).