netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Jaedon Shin <jaedon.shin@gmail.com>, netdev@vger.kernel.org
Cc: David Miller <davem@davemloft.net>,
	Petri Gynther <pgynther@google.com>,
	opendmb@gmail.com
Subject: Re: [PATCH] net: bcmgenet: Add MDIO_INTR in GENETv2
Date: Mon, 15 Feb 2016 10:18:34 -0800	[thread overview]
Message-ID: <56C2167A.1050109@gmail.com> (raw)
In-Reply-To: <1455525733-11736-1-git-send-email-jaedon.shin@gmail.com>

Hi Jaedon,

On 15/02/2016 00:42, Jaedon Shin wrote:
> The GENETv2 chipsets has MDIO interrupt like the GENETv3+ chipsets.
> 
> The previous commit d5c3d84657db ("net: phy: Avoid polling PHY with
> PHY_IGNORE_INTERRUPTS") and commit 49f7a471e4d1 ("net: bcmgenet: Properly
> configure PHY to ignore interrupt") cause link-down PHY always in some
> 40nm generation chipsets.

Humm, these are two different things here:

- GENET_HAS_MDIO_INTR is about telling the driver whether the hardware
supports MDIO_INTR_DONE and MDIO_INTR_ERROR
- eliminating PHY polling is about utilizing LINK_UP and LINK_DOWN to
avoid polling the PHY

So the original problem is actually here:

bcmgenet_irq_task():

	/* Link UP/DOWN event */
	if ((priv->hw_params->flags & GENET_HAS_MDIO_INTR) &&
	    (priv->irq0_stat & UMAC_IRQ_LINK_EVENT)) {

These two checks are actually orthogonal, so we should remove the first
check on GENET_HAS_MDIO_INTR.

Your patch remains valid though, just the explanation needs a bit
tweaking, thanks!

> 
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
> ---
>  drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 ++--
>  drivers/net/ethernet/broadcom/genet/bcmgenet.h | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> index b15a60d787c7..8e9aa8f6390d 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> @@ -1904,7 +1904,7 @@ static int init_umac(struct bcmgenet_priv *priv)
>  		bcmgenet_bp_mc_set(priv, reg);
>  	}
>  
> -	/* Enable MDIO interrupts on GENET v3+ */
> +	/* Enable MDIO interrupts on GENET v2+ */
>  	if (priv->hw_params->flags & GENET_HAS_MDIO_INTR)
>  		int0_enable |= (UMAC_IRQ_MDIO_DONE | UMAC_IRQ_MDIO_ERROR);
>  
> @@ -3168,7 +3168,7 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
>  		.rdma_offset = 0x3000,
>  		.tdma_offset = 0x4000,
>  		.words_per_bd = 2,
> -		.flags = GENET_HAS_EXT,
> +		.flags = GENET_HAS_EXT | GENET_HAS_MDIO_INTR,
>  	},
>  	[GENET_V3] = {
>  		.tx_queues = 4,
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
> index 967367557309..c14bfbfbe06a 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
> @@ -310,7 +310,7 @@ struct bcmgenet_mib_counters {
>  #define UMAC_IRQ_TXDMA_BDONE		(1 << 18)
>  #define UMAC_IRQ_TXDMA_DONE		UMAC_IRQ_TXDMA_MBDONE
>  
> -/* Only valid for GENETv3+ */
> +/* Only valid for GENETv2+ */
>  #define UMAC_IRQ_MDIO_DONE		(1 << 23)
>  #define UMAC_IRQ_MDIO_ERROR		(1 << 24)
>  
> 

  reply	other threads:[~2016-02-15 18:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-15  8:42 [PATCH] net: bcmgenet: Add MDIO_INTR in GENETv2 Jaedon Shin
2016-02-15 18:18 ` Florian Fainelli [this message]
2016-02-16  3:12   ` Jaedon Shin
2016-02-19  5:47     ` 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=56C2167A.1050109@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jaedon.shin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=opendmb@gmail.com \
    --cc=pgynther@google.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).