From patchwork Wed Sep 21 23:05:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 76726 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp2297502qgf; Wed, 21 Sep 2016 16:06:39 -0700 (PDT) X-Received: by 10.66.73.3 with SMTP id h3mr16615620pav.87.1474499199896; Wed, 21 Sep 2016 16:06:39 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p83si576430pfi.109.2016.09.21.16.06.39; Wed, 21 Sep 2016 16:06:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934461AbcIUXGQ (ORCPT + 4 others); Wed, 21 Sep 2016 19:06:16 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:34984 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934062AbcIUXGM (ORCPT ); Wed, 21 Sep 2016 19:06:12 -0400 Received: by mail-pa0-f67.google.com with SMTP id hi10so2818944pac.2; Wed, 21 Sep 2016 16:06:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=ogNyJNJOmA0Ak4uFVkcL633+EVH+zmxThctrj9Iphcc=; b=utRN8izH2XYylLadQZOh9r7fth386p3WcEXq2zHMvvwFFfQZlUBRB66UXiO3Pt19JX Y30CXsGwjdUzRT4xHKvJyt4OADEWyNus4r0ZkWmpMhsgpWIcN834R/GZYbISwoOVgNhF uR1QTMaUn5vNYqP3F0ZZYkNeFqBRp5vdAVPDehk8H97VW9FWjuOzQgNURJQsNrHoKtgr a16D2xDL10zYQpaw2ctGV9wQ0Qr5U9Aqk0rFwbp05rHLPvkEuJ5fvJdLe+OBB8veL8Pa 0pR5kgeJRBKnlAFIV8v+H/Xl/UXSxmAN8aSnC0J+BS9S92Pc7CpMRaww2ve2X7EHkKF0 qiSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=ogNyJNJOmA0Ak4uFVkcL633+EVH+zmxThctrj9Iphcc=; b=WnET96Q8V5+Zgatstn3yshQHyepUk2KsvhEhbMCqzqMKOvnl5Zn9WEA8GwCGtFudPD pEnXqy7FO9sHirVloVNnGLa3WmQj6xsjz7UpQIzjgSmFh31pxyXIiFAOkogP9wW4GbH1 2brUSKcIfH2445sqVHB5XuCpRFFlRQZDXLlDv1qRrFX6ExgFYHbKTtfGnpugGKIwpqJR mJwbbtagN3m8a7HlIU38KtylVgt1pODntpGyOdTsAPYyYdh4mu+GIYWmDOqfI2whURys nezaSt9DIySqrtmrG3CeHe7aEG3uLnZLqampZR0Z++L/APYDncX/XNDviUuApslsmQ2f usIg== X-Gm-Message-State: AE9vXwNHnNTeLlwQ4ryXqLsY7d242i3kYmJhiCiOTsLBhINWpNLvlooLV/v6/v0Ng6638Q== X-Received: by 10.66.10.193 with SMTP id k1mr48721251pab.175.1474499171702; Wed, 21 Sep 2016 16:06:11 -0700 (PDT) Received: from aurora.jms.id.au ([2403:480:11:8000:c0f3:c161:fe9a:f6bb]) by smtp.gmail.com with ESMTPSA id b69sm285268pfl.69.2016.09.21.16.06.06 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 21 Sep 2016 16:06:11 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Thu, 22 Sep 2016 08:36:02 +0930 From: Joel Stanley To: davem@davemloft.net Cc: clg@kaod.org, gwshan@linux.vnet.ibm.com, andrew@lunn.ch, andrew@aj.id.au, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, benh@kernel.crashing.org Subject: [PATCH net-next v2 6/6] net/faraday: Mask out PHYSTS_CHG interrupt Date: Thu, 22 Sep 2016 08:35:03 +0930 Message-Id: <20160921230503.23309-7-joel@jms.id.au> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160921230503.23309-1-joel@jms.id.au> References: <20160921230503.23309-1-joel@jms.id.au> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The PHYSTS_CHG (the ftgmac100's PHY IRQ) is telling the system to go look at the PHY registers for a link status change. The interrupt was causing issues on Aspeed SoC where some board designs had an active high configuration, some active low, and in some cases repurposed for other functions. When misconfigured Linux would chew 100% of CPU cycles servicing interrupts: [ 20.280000] ftgmac100 1e660000.ethernet eth0: [ISR] = 0x200: PHYSTS_CHG [ 20.280000] ftgmac100 1e660000.ethernet eth0: [ISR] = 0x200: PHYSTS_CHG [ 20.280000] ftgmac100 1e660000.ethernet eth0: [ISR] = 0x200: PHYSTS_CHG [ 20.300000] ftgmac100 1e660000.ethernet eth0: [ISR] = 0x200: PHYSTS_CHG While in the ftgmac100 IP can be configured for high, low and edge sensitivity the current driver always polls the PHY, so we chose to mask out the interrupt. See https://patchwork.ozlabs.org/patch/672099/ for more discussion. Signed-off-by: Joel Stanley --- v2: - Reworked to mask out PHYSTS_CHG instead of trying to determine the IRQ line level drivers/net/ethernet/faraday/ftgmac100.c | 10 +++------- drivers/net/ethernet/faraday/ftgmac100.h | 1 + 2 files changed, 4 insertions(+), 7 deletions(-) -- 2.9.3 diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index e3653b14008a..90f9c5481290 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1075,14 +1075,12 @@ static int ftgmac100_poll(struct napi_struct *napi, int budget) } if (status & priv->int_mask_all & (FTGMAC100_INT_NO_RXBUF | - FTGMAC100_INT_RPKT_LOST | FTGMAC100_INT_AHB_ERR | - FTGMAC100_INT_PHYSTS_CHG)) { + FTGMAC100_INT_RPKT_LOST | FTGMAC100_INT_AHB_ERR)) { if (net_ratelimit()) - netdev_info(netdev, "[ISR] = 0x%x: %s%s%s%s\n", status, + netdev_info(netdev, "[ISR] = 0x%x: %s%s%s\n", status, status & FTGMAC100_INT_NO_RXBUF ? "NO_RXBUF " : "", status & FTGMAC100_INT_RPKT_LOST ? "RPKT_LOST " : "", - status & FTGMAC100_INT_AHB_ERR ? "AHB_ERR " : "", - status & FTGMAC100_INT_PHYSTS_CHG ? "PHYSTS_CHG" : ""); + status & FTGMAC100_INT_AHB_ERR ? "AHB_ERR " : ""); if (status & FTGMAC100_INT_NO_RXBUF) { /* RX buffer unavailable */ @@ -1390,7 +1388,6 @@ static int ftgmac100_probe(struct platform_device *pdev) FTGMAC100_INT_XPKT_ETH | FTGMAC100_INT_XPKT_LOST | FTGMAC100_INT_AHB_ERR | - FTGMAC100_INT_PHYSTS_CHG | FTGMAC100_INT_RPKT_BUF | FTGMAC100_INT_NO_RXBUF); @@ -1412,7 +1409,6 @@ static int ftgmac100_probe(struct platform_device *pdev) dev_info(&pdev->dev, "Using NCSI interface\n"); priv->use_ncsi = true; - priv->int_mask_all &= ~FTGMAC100_INT_PHYSTS_CHG; priv->ndev = ncsi_register_dev(netdev, ftgmac100_ncsi_handler); if (!priv->ndev) goto err_ncsi_dev; diff --git a/drivers/net/ethernet/faraday/ftgmac100.h b/drivers/net/ethernet/faraday/ftgmac100.h index 8a377ab1d127..a7ce0ac8858a 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.h +++ b/drivers/net/ethernet/faraday/ftgmac100.h @@ -157,6 +157,7 @@ #define FTGMAC100_MACCR_FULLDUP (1 << 8) #define FTGMAC100_MACCR_GIGA_MODE (1 << 9) #define FTGMAC100_MACCR_CRC_APD (1 << 10) +#define FTGMAC100_MACCR_PHY_LINK_LEVEL (1 << 11) #define FTGMAC100_MACCR_RX_RUNT (1 << 12) #define FTGMAC100_MACCR_JUMBO_LF (1 << 13) #define FTGMAC100_MACCR_RX_ALL (1 << 14)