Received: by 10.192.165.148 with SMTP id m20csp537041imm; Wed, 25 Apr 2018 03:54:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx493MDKU7wxUJKrSelWkw2vyyR2+YRUkgnFGLQ15aAuNh/tV5/ZOwpOOc70JcsjLWeS+MS43 X-Received: by 10.98.107.138 with SMTP id g132mr27173533pfc.163.1524653655321; Wed, 25 Apr 2018 03:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524653655; cv=none; d=google.com; s=arc-20160816; b=p9cIQNygjoy5mxf5KDhZrKN8hwkPmuz4XxkVfst139+EihIbD8apzO/UYWsbX/2L2V mgDUZDaAsUrsRH+aKbTmC7sPSdyc6GD+SbBAzNgJZkVc4qUyaqo8so1MM5kD+22PFdta ybmNGBwbvw2V3XhdLpyCUfoBBGukai1DURXEA5AlOLclPPwUQ6Q8d+RSfZOUMg7EtsUm azJNKefMvHXlml0Xn2aqBSo2LqHn+tuQEFCr3zvYn5zyVrJhr/a6cWNlITV7xs71YWBu LbmM2ByTqEEJHqtwFxmaNRr+HPzFajcYiuAxq23PDKdSjD4DOUi6lvgLJDLXhT5mItqz GAvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=iiHLzrSOFW8N3rz+uvEO2/yy2QwmxXnDvk/mKafpwVc=; b=oisUH3grXrBBQ6S6sZSbRLY59OuNA3EJRmueqd7gx3GFXSnAI04RjNvy5MzwIQX7+S RuBH2CAF27YVXAzNCoY9d5azSGRB4JN+vhYSpFwAY0MVyfvRjbE/1OX95yq4PjFMcnnE 2CRt4BwT0preY6SiGjhyEiVH46VCjWbxywtYx6TpF32fvJ6zaAx/q4D+Tzp1MmJCbXlV 1jco9TfvhHGdMLF31AavT6GIC0Zp26tasRc77OeDKlsd7OgWwyNO/1unG+GlOsIn9OHy CnE2oEKDTnlWt73xO305m9uHAs5F82Jg/ylh1oBB3oSQ+2Od+YJBQMEiBaNuQziaQN0x wBQg== ARC-Authentication-Results: i=1; mx.google.com; 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 f28-v6si17819092plj.255.2018.04.25.03.54.01; Wed, 25 Apr 2018 03:54:15 -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; 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 S1753787AbeDYKxB (ORCPT + 99 others); Wed, 25 Apr 2018 06:53:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53132 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754261AbeDYKnu (ORCPT ); Wed, 25 Apr 2018 06:43:50 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F1DB1272; Wed, 25 Apr 2018 10:43:49 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Niklas Cassel , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 159/183] net: stmmac: discard disabled flags in interrupt status register Date: Wed, 25 Apr 2018 12:36:19 +0200 Message-Id: <20180425103248.926651440@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Niklas Cassel [ Upstream commit 1b84ca187510f60f00f4e15255043ce19bb30410 ] The interrupt status register in both dwmac1000 and dwmac4 ignores interrupt enable (for dwmac4) / interrupt mask (for dwmac1000). Therefore, if we want to check only the bits that can actually trigger an irq, we have to filter the interrupt status register manually. Commit 0a764db10337 ("stmmac: Discard masked flags in interrupt status register") fixed this for dwmac1000. Fix the same issue for dwmac4. Just like commit 0a764db10337 ("stmmac: Discard masked flags in interrupt status register"), this makes sure that we do not get spurious link up/link down prints. Signed-off-by: Niklas Cassel Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -562,10 +562,12 @@ static int dwmac4_irq_status(struct mac_ struct stmmac_extra_stats *x) { void __iomem *ioaddr = hw->pcsr; - u32 intr_status; + u32 intr_status = readl(ioaddr + GMAC_INT_STATUS); + u32 intr_enable = readl(ioaddr + GMAC_INT_EN); int ret = 0; - intr_status = readl(ioaddr + GMAC_INT_STATUS); + /* Discard disabled bits */ + intr_status &= intr_enable; /* Not used events (e.g. MMC interrupts) are not handled. */ if ((intr_status & mmc_tx_irq))