Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp463751yba; Wed, 15 May 2019 04:34:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIFLifWAl5KnzLC0a+cXA9kbvofdPgS8n+b3RHwaMgNAAJIcGrGYwqq/l+t4DnTqwM7+H6 X-Received: by 2002:a62:6582:: with SMTP id z124mr48251489pfb.0.1557920043898; Wed, 15 May 2019 04:34:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557920043; cv=none; d=google.com; s=arc-20160816; b=llal3PnNgiqsUg/IeTt2EcJPDF9uKDuCgKMs7GxPHbf3Xqry4XCVx57gNOjsghDbpw WE4o4bdYn7czMjIOHZ/wHcZUh4NKA7j7k2/q6OhHpE7XV8wcwLVuI2uT/IzGUxi2JRlZ +7BwAy+q8sNjfjIWva4GolH0NwX6IUGoQgSoUjFnMoj1SQew9ef+CeuQ6BArUoCgAArR xaD2SVEEt5mFu2yMPSCsFCEhvCPSBBDOvJHDNRcXkI4A3Yrg7BO3C7twjrWYRh786Uto bpp621euyGjQVlD0r3O1Opp2O8/Wolzq8RSFXhZljTdZ4ygkLXcXMlbitPVRHZbnjfwT wlJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sw6styh33GCK6+YV0Wb/LZahmqHJLIs53zyDCcNq7gM=; b=iQtLq2oEMxmpxde+P8ES3OFNrApKu9bXA6p9oL9ZD2W9Z+2ozKl2SCPny6NMKFwSHU MObQWndA2rKI28JtNAAuyWEnEpLPeeiQycYSB6BgW2UyuwmsAGsgX+UGKVVSacuO2OFA u0Wx2b7bfKqx8B6PMdh5pGuo/CUIsOPy/peYbbyOFGL6Qv+bImLUAFPMK960B2TCLbYh 0/yRN71dK+DtGIRC6uPIa4HFu89LOpIfHIPvJm7IoDZgalMnvGv7BJca5wRUFObXmxf+ OKHYGYm1FfRCuFsy3+F6tZjb0OwTcXNmmJmNOv7pRFBJAbOmySL4OkxW9TIM2vNHQGUv /RhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JMEZAO+U; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4si1951446pfb.272.2019.05.15.04.33.49; Wed, 15 May 2019 04:34:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JMEZAO+U; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732169AbfEOLap (ORCPT + 99 others); Wed, 15 May 2019 07:30:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:42230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732752AbfEOLaj (ORCPT ); Wed, 15 May 2019 07:30:39 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9EDE920843; Wed, 15 May 2019 11:30:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919839; bh=X8flbAO2akxSEzZQ8zHamo1pcx8klqpvg+NacVqQhnw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JMEZAO+UIRwKqg+BiZZnXQXWOjtppPJoIuPCGqsCl8pVgXmIgE5R13wyObxEbGQua NMuOc6EJBro2El++8krvlQurm64hKfhqlR1MZZB0do6cGZh18vSmYefOvZOdkRhqso BPgRw2k0Csj5E/QOGx961QRgc9WRJV3gbxm4GoS0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Harini Katakam , Nicolas Ferre , "David S. Miller" Subject: [PATCH 5.0 112/137] net: macb: Change interrupt and napi enable order in open Date: Wed, 15 May 2019 12:56:33 +0200 Message-Id: <20190515090701.711180496@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090651.633556783@linuxfoundation.org> References: <20190515090651.633556783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Harini Katakam [ Upstream commit 0504453139ef5a593c9587e1e851febee859c7d8 ] 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 Acked-by: Nicolas Ferre Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/cadence/macb_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -2414,12 +2414,12 @@ static int macb_open(struct net_device * return err; } - 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);