Received: by 10.223.176.5 with SMTP id f5csp862912wra; Fri, 9 Feb 2018 08:24:13 -0800 (PST) X-Google-Smtp-Source: AH8x227wfgP7WXdsqUhyMqH50e+y8nYs73rcyjMW55fQpTB/IfxZNAC3Ci5RfFDUCFys0Te458Mr X-Received: by 2002:a17:902:66e6:: with SMTP id e93-v6mr3007359plk.173.1518193453506; Fri, 09 Feb 2018 08:24:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518193453; cv=none; d=google.com; s=arc-20160816; b=HT8aZ+YcKsddFqcUgeCNReHqwrZU8wkKmL5WzUe/yPGz/8gElajTZuB3zswV9aseID 86b19uubE6XOlNOROmUO1k2KjCqbv31jBnKAtwwX4Y6f3B1EYYraA/uYan8w7et5bFM8 6/gcp4XXUmh2LA5Xk1agls+jhKUXpfm866EcJqSU6egWN18NsasobQTH2vZpQDU61egA WB8u4MfNH8jLK3DjKAA22hvtKe8zM0ex1QK3XtA67+y97G0B8XdbjeaZmjjwvGt4yqqN P2adXc8GqCJxIEseL1jN25VrXB+i96v3P/N61cgUZ8K/dP3dn8sxgw9gD0oHBooICxMB r8lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=v6ZKFQYXKvYEfvXgQDZiOT7j9tY3OlFsKAmMj1kLX0I=; b=Pj0ZxNrDazREo+h5GT2FAX1CpNhKD3rO96Rr9JHHYYjt3EY7mDHz/ytAB0RlcPbotr h1D3/PiOXARhcGdkuw/kN5yXNI7d/KSwpT3csvdhLst/KOdpO3Uo1esc3ngnu9Zj1XkJ X6/+7mNaXcFu30CEOPyPPCqCagjnePLRoU8ldk6Ulr7FuJq8INJDIc8pLWvU4Y2j6IGP x1KRyaAmnZmX+GIZRKVtakKS396/jAaI3NQLfPeaTPPKUOzjGcz6bDqdANsww9HjWVS6 6y/575jQ5c2VXen6lZOHlgw7QpBMWyd3nrqHNJ/w/BJSU4obAU93hwr7Mv6XxK7fjy8S yoFw== 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 n8si1561907pfg.69.2018.02.09.08.23.59; Fri, 09 Feb 2018 08:24:13 -0800 (PST) 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 S1752315AbeBIQXH (ORCPT + 99 others); Fri, 9 Feb 2018 11:23:07 -0500 Received: from bastet.se.axis.com ([195.60.68.11]:49954 "EHLO bastet.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751145AbeBIQXE (ORCPT ); Fri, 9 Feb 2018 11:23:04 -0500 Received: from localhost (localhost [127.0.0.1]) by bastet.se.axis.com (Postfix) with ESMTP id 8432F1894E; Fri, 9 Feb 2018 17:23:03 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at bastet.se.axis.com Received: from bastet.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bastet.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id SUk0mX39CeWf; Fri, 9 Feb 2018 17:23:02 +0100 (CET) Received: from boulder02.se.axis.com (boulder02.se.axis.com [10.0.8.16]) by bastet.se.axis.com (Postfix) with ESMTPS id 91F04188E8; Fri, 9 Feb 2018 17:23:02 +0100 (CET) Received: from boulder02.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 755C41A066; Fri, 9 Feb 2018 17:23:02 +0100 (CET) Received: from boulder02.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6A2DC1A065; Fri, 9 Feb 2018 17:23:02 +0100 (CET) Received: from seth.se.axis.com (unknown [10.0.2.172]) by boulder02.se.axis.com (Postfix) with ESMTP; Fri, 9 Feb 2018 17:23:02 +0100 (CET) Received: from lnxartpec1.se.axis.com (lnxartpec1.se.axis.com [10.88.4.10]) by seth.se.axis.com (Postfix) with ESMTP id 5E4B52E71; Fri, 9 Feb 2018 17:23:02 +0100 (CET) Received: by lnxartpec1.se.axis.com (Postfix, from userid 20283) id 59D62401B8; Fri, 9 Feb 2018 17:23:02 +0100 (CET) From: Niklas Cassel To: Giuseppe Cavallaro , Alexandre Torgue Cc: Niklas Cassel , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 1/3] net: stmmac: discard disabled flags in interrupt status register Date: Fri, 9 Feb 2018 17:22:45 +0100 Message-Id: <20180209162247.3724-2-niklas.cassel@axis.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180209162247.3724-1-niklas.cassel@axis.com> References: <20180209162247.3724-1-niklas.cassel@axis.com> X-TM-AS-GCONF: 00 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index ed222b20fcf1..1e0a7668b752 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -572,10 +572,12 @@ static int dwmac4_irq_status(struct mac_device_info *hw, 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)) -- 2.14.2