Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp467407yba; Wed, 15 May 2019 04:38:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSOPxz67W1gXonZaUZP+DWLKyYU25IyhapqZbgj5PuFFQyzSJC9qcLAIOQHtqdxc6Os4Hr X-Received: by 2002:a62:1a51:: with SMTP id a78mr45582251pfa.133.1557920292214; Wed, 15 May 2019 04:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557920292; cv=none; d=google.com; s=arc-20160816; b=JCa6X3CUDx+9gf9+9kdqa7b921KNigJHzcoZdRmhSgY0tCnSZrKeJKAAuwatu4oo1G K2aZ/qZ3kSci8lcaZtBNd/EFWdco7lyvlmnsqkowzOZQBcEug/sbeMCCyfwLxQ3DrX0D Dg0mn3xcR0WBv2GckE+d9VniOmZiSM6eCIb7YztcKHJNKHooMoQGAP0Uw6Tgww+0VQ++ Cd0DfaJ/3456NixAhDydyN4+qwSqmQ1of6BwhhMWouIOnk1vWRbUkYHx3nKVEWmG0W6U /cYHiMpiOm+zgemERR2STMZTgQTEplesazj3Ewx6hZ86p77z0jjw/wHN8JSwplnFfYcg aPFg== 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=e/fiYAB/lVZ8Fifdlg5KqmtztdiHPc3jZ1qtEL5WPSo=; b=tYNBSRoEufjlkFLz+uCEH2TXDHoTvKeCArU5QoMkpjbIgFl5E/1FnxWSAZ4/Z8vGqN 6vN6NvJ2f2TrGFD5jsVsSJUmEh/zPu5E5YP0ZT1Io7Ww8dDMep+ktxxTbGtJWgR9enOa YuXEteBP2yaip3AqL3BJmQ6nZwsrufnqHc7zJzj1SWKIVUwhX4++83nSwkteOjpPNnEq bYRkYTU063hb5BrGlbGoKmj2ZIq3lybi4maCxp89SvHCGXwTYY5uJlZEKuFSxHRb+DAl Eqbe5rY4CUTJffAbvumf4np2gE2eUGgjNL6b4jCroA5UTenLyI7pz6I6yFCrRnTZyR9d lmiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="dOwzZ/5F"; 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 h1si1562564pgc.83.2019.05.15.04.37.57; Wed, 15 May 2019 04:38:12 -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="dOwzZ/5F"; 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 S1733068AbfEOLcn (ORCPT + 99 others); Wed, 15 May 2019 07:32:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:44532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733038AbfEOLcl (ORCPT ); Wed, 15 May 2019 07:32:41 -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 0AD202053B; Wed, 15 May 2019 11:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919960; bh=HZn80yW1KMV5AsYLespaT2hnbht7qg6UOiGB/yOZGmI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dOwzZ/5Fz13c2EOmyZHqgxfJvYYI5/TXf1Wdi+nmFdK/SAJN6CJc8hfjj1Hn44vyy /jIKZydNFy+bFui/xZPH1uVc/jcMTItR7Y5GYnh1ToZuLsV7y0qQ1xgBkRIm6IkUVK bFaqujxOPMEb/zsuhTolCuv4FoXijH8pTmGq+UYw= 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.1 21/46] net: macb: Change interrupt and napi enable order in open Date: Wed, 15 May 2019 12:56:45 +0200 Message-Id: <20190515090624.035657060@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090616.670410738@linuxfoundation.org> References: <20190515090616.670410738@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 @@ -2461,12 +2461,12 @@ static int macb_open(struct net_device * 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);