mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Nicolas.Ferre@microchip.com>
To: <harini.katakam@xilinx.com>, <davem@davemloft.net>, <rafalo@cadence.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<michal.simek@xilinx.com>, <harinikatakamlinux@gmail.com>
Subject: Re: [PATCH] net: macb: Change interrupt and napi enable order in open
Date: Tue, 7 May 2019 15:32:33 +0000	[thread overview]
Message-ID: <1f828865-16ec-0d2e-93a3-e911d0b6baa2@microchip.com> (raw)
In-Reply-To: <1557239350-4760-1-git-send-email-harini.katakam@xilinx.com>

On 07/05/2019 at 16:29, Harini Katakam wrote:
> External E-Mail
> 
> 
> Current order in open:
> -> Enable interrupts (macb_init_hw)
> -> Enable NAPI
> -> Start PHY
> 
> Sequence of RX handling:
> -> RX interrupt occurs
> -> Interrupt is cleared and interrupt bits disabled in handler
> -> NAPI is scheduled
> -> In NAPI, RX budget is processed and RX interrupts are re-enabled
> 
> With the above, on QEMU or fixed link setups (where PHY state doesn't
> matter), there's a chance macb RX interrupt occurs before NAPI is
> enabled. This will result in NAPI being scheduled before it is enabled.
> Fix this macb open by changing the order.
> 
> Fixes: ae1f2a56d273 ("net: macb: Added support for many RX queues")
> Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>

it looks okay to me:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

> ---
>   drivers/net/ethernet/cadence/macb_main.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 5d5c9d7..c049410 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -2427,12 +2427,12 @@ static int macb_open(struct net_device *dev)
>   		goto pm_exit;
>   	}
>   
> -	bp->macbgem_ops.mog_init_rings(bp);
> -	macb_init_hw(bp);
> -
>   	for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue)
>   		napi_enable(&queue->napi);
>   
> +	bp->macbgem_ops.mog_init_rings(bp);
> +	macb_init_hw(bp);
> +
>   	/* schedule a link state check */
>   	phy_start(dev->phydev);
>   
> 


-- 
Nicolas Ferre

  reply	other threads:[~2019-05-07 15:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07 14:29 Harini Katakam
2019-05-07 15:32 ` Nicolas.Ferre [this message]
2019-05-07 19:28 ` 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=1f828865-16ec-0d2e-93a3-e911d0b6baa2@microchip.com \
    --to=nicolas.ferre@microchip.com \
    --cc=davem@davemloft.net \
    --cc=harini.katakam@xilinx.com \
    --cc=harinikatakamlinux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=netdev@vger.kernel.org \
    --cc=rafalo@cadence.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

all inboxes | Powered by JetHome®