From patchwork Thu Oct 11 12:28:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 148622 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2061016lji; Thu, 11 Oct 2018 05:28:39 -0700 (PDT) X-Google-Smtp-Source: ACcGV608ZuFZYyx/o5RqTtJLmARb5t3LqvVO/0Zxv1DwN4jyeSp4/8Iu3gmVQGlgUGpGpbSPSOb2 X-Received: by 2002:a63:2bc5:: with SMTP id r188-v6mr1258089pgr.160.1539260919243; Thu, 11 Oct 2018 05:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539260919; cv=none; d=google.com; s=arc-20160816; b=LwfGmZ0OuetJgErSWjcZ9qllQEEjSpuuWlP3MhkbLGGXzFSqM7XTgmh69Kj5Pkwel7 6Zoq8QJOBTyfNIR8sxNVacyyIpBLdOXXyE5XMBKEthtRBLWCoDdtO/DWnbPL3xwG8+Xy yxy8es0prnxJhYPoP5/whHcF/6kTVjpqZ7nzvAPl2KLEu8o9MlsndBJ2EHBbI/fg4OMc ZgNb8DTmhEuxU3b83njbrLY7s+mgmTBHiJn6xA+qn1rCP9XdiwvGpv3iksJGtTQjQf9H 2A+zGdwzZf7JQ4829rpz98iQq6pxHofMPw+c1b02qf9/FY++u3hPlfoALGoXZrxmjs64 PQMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=gIKQ/o45l1AQZuJo/Zzn8KAy6s3cWMYWsrRhykaKGx0=; b=zRDtQ8T8I8eiAp7msZCV03A2UaRmcbLwbsen2WshtlRYbA5aKM5ZDIZrIKAurRQDck zG4MZuTqtucf4FqCw9blJs2LKD1aCY5UnwV70vYDtJdEnkf0EP+KbqE31CESLDFUa+7h ernpXZfX8o2r5ot7Fmi4YWBguATFIk5AMheUGhA5/9o3vvYc0c1ZmNl6k/dDD8VoFh1H 8qSVcNoBIOlcRggekssH/YMR0/01iJzMxDJdrBmQWk7i9SZFmohCpRBwbUXaHpiVr+YQ Zxt6Te88FtnyswSX5Ci3kFe/gJANHAa3c+0g8vypMya1/xbpKmfj7CwNEfBBJyJP2SEa d0dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=juAm6x34; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c27-v6si32577764pfk.235.2018.10.11.05.28.39; Thu, 11 Oct 2018 05:28: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=pass header.i=@linaro.org header.s=google header.b=juAm6x34; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727483AbeJKTzh (ORCPT + 10 others); Thu, 11 Oct 2018 15:55:37 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:37563 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726212AbeJKTzh (ORCPT ); Thu, 11 Oct 2018 15:55:37 -0400 Received: by mail-ed1-f68.google.com with SMTP id c22-v6so8082487edc.4 for ; Thu, 11 Oct 2018 05:28:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=gIKQ/o45l1AQZuJo/Zzn8KAy6s3cWMYWsrRhykaKGx0=; b=juAm6x34/3Nxpmqx47GGVX65xMmUgGQUvm+39z1zDNwpe986ayCYC7QKpRe7NElJ9G 2zagUkqGO5gP2O5hdC8O/TYnzMbTpW1ht/sM9JWkM+5UkbB95zw6X2iAk/6KCc6BmRpT UzjOhOwxcgc57LRo7CYrDmYzzNxepnbddvR5I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gIKQ/o45l1AQZuJo/Zzn8KAy6s3cWMYWsrRhykaKGx0=; b=n2kT5K+Uh+HNrZnxsqhYbbWLyW+na5Q/6yWiV0qn8jP/RCKMrqBUB0H6Id1fuQXsCa YRZc50aM1CsoWDmMUj4/KG17VrrhLUS/pCWzZIlwqepWBxz2yCMUQHd6IJlV/keQsJc7 aWFetj62p3o7QjDorSC2fCsiJjxx4P3NbFz9GMF4xBPqvK7cdZT6s72lDFZRpk5Vt1Pz W86nlt/930OXfiGFrwg8KZMsapdw3KAsKF4JBdyShISf0/kSVy7MdSfP0poABRsdUz6x CMmOiOvfG9O+uJu6YBxp0LbgteGbS7zx4GIl3B+eZc8ooLuXgQPzxgJuJnaEASqL/vxx Go/A== X-Gm-Message-State: ABuFfoimEF3BXk9ssy+e/yMYd3RKcJjsWkKTZSp9cke5wZpIN09v6dj4 LYluXs/YmIB+0RELcXySBrDyDD2hSUw= X-Received: by 2002:a50:d651:: with SMTP id c17-v6mr2398785edj.178.1539260915763; Thu, 11 Oct 2018 05:28:35 -0700 (PDT) Received: from localhost.localdomain ([2a02:587:4606:3e00:2e56:dcff:fe9a:8f06]) by smtp.gmail.com with ESMTPSA id e38-v6sm9264040eda.67.2018.10.11.05.28.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Oct 2018 05:28:34 -0700 (PDT) From: Ilias Apalodimas To: netdev@vger.kernel.org, jaswinder.singh@linaro.org Cc: ard.biesheuvel@linaro.org, masami.hiramatsu@linaro.org, Ilias Apalodimas Subject: [PATCH 1/1] net: socionext: clear rx irq correctly Date: Thu, 11 Oct 2018 15:28:26 +0300 Message-Id: <1539260906-29596-1-git-send-email-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org commit 63ae7949e94a ("net: socionext: Use descriptor info instead of MMIO reads on Rx") removed constant mmio reads from the driver and started using a descriptor field to check if packet should be processed. This lead the napi rx handler being constantly called while no packets needed processing and ksoftirq getting 100% cpu usage. Issue one mmio read to clear the irq correcty after processing packets Signed-off-by: Ilias Apalodimas Reported-by: Ard Biesheuvel --- drivers/net/ethernet/socionext/netsec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.7.4 Tested-by: Ard Biesheuvel Acked-by: Ard Biesheuvel diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c index 7aa5ebb..4289ccb 100644 --- a/drivers/net/ethernet/socionext/netsec.c +++ b/drivers/net/ethernet/socionext/netsec.c @@ -735,8 +735,11 @@ static int netsec_process_rx(struct netsec_priv *priv, int budget) u16 idx = dring->tail; struct netsec_de *de = dring->vaddr + (DESC_SZ * idx); - if (de->attr & (1U << NETSEC_RX_PKT_OWN_FIELD)) + if (de->attr & (1U << NETSEC_RX_PKT_OWN_FIELD)) { + /* reading the register clears the irq */ + netsec_read(priv, NETSEC_REG_NRM_RX_PKTCNT); break; + } /* This barrier is needed to keep us from reading * any other fields out of the netsec_de until we have