From patchwork Mon Apr 15 20:24:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 162265 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3369035jan; Mon, 15 Apr 2019 13:25:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdm6hSspptPnkOqISSy4hsHS7XeJX1tmB9L8UdJGTjET+nyTd9ULnwjhPmoSxcml7THq9D X-Received: by 2002:a62:6f47:: with SMTP id k68mr61495395pfc.196.1555359955356; Mon, 15 Apr 2019 13:25:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555359955; cv=none; d=google.com; s=arc-20160816; b=Q60rAFJCbGlmRsjywT6fo3558LUue/14pe6FbcKZxcVSrD1Qy7/thbQHCGouyPTJzR OZ5mIRAUc32HFjZay1c88SBbtZey30py4o6Krs9Gb0TnQRmT/0UK9t5hnvedN+pEIku3 sw8PJYCtpNlTWdA3TUTHTVQHUKmU0707viFJaZbwGw0s+vPiQ1bfjrOrp9IKe8a7/N82 P1HdWgihiXxheEuL/gcVuKIB52RzeXABEY3jyGdWOdcCYeGXFoYRUin+awXizbJt7cRX QGwSoEzqQgnDa9h7oCXHoDqFZcMVmzFfg5O1N0m9ykdjcefYYIe9Fa49pVBjfJEgLVNW 6e6g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1sVG/7AmipBM6pLKCU0nehMBOLK0gsKZ8Ih7G40GqAo=; b=TC0qtAmSsZ14AOn1Xdll03QvjNLLLEPbz0xVye5BZWIeP6RLBL8Ja7b6PvnuxiZJIr p/w8dBPMmtf9w9fe/A4DtyULH4ijX2zSxQahhLZUUy+vDUP8GnQBm+au5O+fI0OLsb2s /A8UwCSaZ3EcBJx2q65XXV327U2SBZmoLCJuzbe5r6UEBk/SkI4gBjJ00BUdGntShB0e ttRm9AzDWPdXkqpm8sI74auaCGfRV0C0owRFUM7G6J2Ow0iJAwBCmIhrUdXmKa0ITDqK KkguTgiIKNju2qFDZJl/aN0/CvoKq8Ov7IM4OazQqj1tX6Dk+oHOkYCEDV1u4V4Ihd9S hvnA== 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 v4si46068933pgj.138.2019.04.15.13.25.55; Mon, 15 Apr 2019 13:25:55 -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 S1727973AbfDOUZx (ORCPT + 30 others); Mon, 15 Apr 2019 16:25:53 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:47069 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727379AbfDOUZx (ORCPT ); Mon, 15 Apr 2019 16:25:53 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.129]) with ESMTPA (Nemesis) id 1MQNF3-1hTYRh3xMf-00MJcC; Mon, 15 Apr 2019 22:25:25 +0200 From: Arnd Bergmann To: Greg Ungerer Cc: Linus Walleij , arm@kernel.org, Arnd Bergmann , "David S. Miller" , YueHaibing , Yang Wei , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] ARM: ks8695, net: use disable_irq/enable_irq Date: Mon, 15 Apr 2019 22:24:14 +0200 Message-Id: <20190415202501.941196-2-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190415202501.941196-1-arnd@arndb.de> References: <20190415202501.941196-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:8tGLnwpQBE+hy+QbBxx311K8axver6qgKQ4XBwgIDHEvIxWbZM4 vd9oI7nAvHCsyMhxKLKWHXrUXv3evFP6DANXx52AN/+36n357jJBTuUy6QzBuEOMoy0hnAK 6MOrDkssOoGVEHIzfdGiiTZd/21OY89EjqJWjWZZ34g5CS38akG01kC6AcKhytK5iYg2UYr d+NoNKE+/BuoRwuquvE+A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:r2hNp5L619c=:KZhCizwnOJmaLaN5VInOhb 6DhVrL3pf2b7fd+jUPk89BkhGPEkeTVviInbb0sljEw+LwCbnCW9ofoaJ/K6Y/3xYNo4Zzz09 Ph46yL4zCSt5kdKs4hWyPyW1x0IcnkV+wKYcZeauDpZwo3SGycvBrwDkcUxPuh8+aNw96dZzG Fe7OqB4/o+/D4h0gkyWkM3Z413+ub6cdVUGBnxszqgEf8ScUCndh1YQ74I4hEG52TybdHLZjJ IYwSbM2VIOnQZkm72WwmLfjuHAeDiArDNwhEHngPhrmec6Jx4YvJMws5EKLpYkPVv/BsrzrqX l8sptrqOImu94owRKTuvzvl1AFWLXqmEy05wf/3O31P+DvHDeeRv0zNLAcVNYpBpPr8BYes44 OtldfHfRGz1QuvLbJTNdWZKRT/xiQIwWrrYEeCjBB871+sHsDUJE87okBrqKGfW+n5rqul9Ut VOEC8AZHxyMzC9ka16o8idK7G+nSaRReiTk3uyNBthM265RNtunWd6OTp9f4NcdbBICwjlw6Z QIRSzhRbSR5fj5n2XI+es519FlQe+tO4JgKu1TLiD8vG7ymSffVtUUZQdYbMUMRWPur1F/ReJ gYKormZA7iMqhRaOYLsBLFtyS1pe0gmVmSU1G3lL08y2oKJQzfO2+r5SUj91LU4avmrkD5WWz IKY/g4EL1iLoYdn0gJ5hVQtUNH+aecsZJFKxQoLHj4uVi2W8BviS+CuobQVyl0xfgyPxRD4pF jfX1w57yAquNwPteUBE3iwgwSObvEnmHY37YvQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rather than poking the registers manually, better use the exported interfaces for it. Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/micrel/ks8695net.c | 30 ++----------------------- 1 file changed, 2 insertions(+), 28 deletions(-) -- 2.20.0 diff --git a/drivers/net/ethernet/micrel/ks8695net.c b/drivers/net/ethernet/micrel/ks8695net.c index 6006d47707cb..3b6375adff08 100644 --- a/drivers/net/ethernet/micrel/ks8695net.c +++ b/drivers/net/ethernet/micrel/ks8695net.c @@ -402,25 +402,6 @@ ks8695_tx_irq(int irq, void *dev_id) return IRQ_HANDLED; } -/** - * ks8695_get_rx_enable_bit - Get rx interrupt enable/status bit - * @ksp: Private data for the KS8695 Ethernet - * - * For KS8695 document: - * Interrupt Enable Register (offset 0xE204) - * Bit29 : WAN MAC Receive Interrupt Enable - * Bit16 : LAN MAC Receive Interrupt Enable - * Interrupt Status Register (Offset 0xF208) - * Bit29: WAN MAC Receive Status - * Bit16: LAN MAC Receive Status - * So, this Rx interrupt enable/status bit number is equal - * as Rx IRQ number. - */ -static inline u32 ks8695_get_rx_enable_bit(struct ks8695_priv *ksp) -{ - return ksp->rx_irq; -} - /** * ks8695_rx_irq - Receive IRQ handler * @irq: The IRQ which went off (ignored) @@ -438,11 +419,7 @@ ks8695_rx_irq(int irq, void *dev_id) spin_lock(&ksp->rx_lock); if (napi_schedule_prep(&ksp->napi)) { - unsigned long status = readl(KS8695_IRQ_VA + KS8695_INTEN); - unsigned long mask_bit = 1 << ks8695_get_rx_enable_bit(ksp); - /*disable rx interrupt*/ - status &= ~mask_bit; - writel(status , KS8695_IRQ_VA + KS8695_INTEN); + disable_irq(ksp->rx_irq); __napi_schedule(&ksp->napi); } @@ -561,8 +538,6 @@ static int ks8695_rx(struct ks8695_priv *ksp, int budget) static int ks8695_poll(struct napi_struct *napi, int budget) { struct ks8695_priv *ksp = container_of(napi, struct ks8695_priv, napi); - unsigned long isr = readl(KS8695_IRQ_VA + KS8695_INTEN); - unsigned long mask_bit = 1 << ks8695_get_rx_enable_bit(ksp); int work_done; work_done = ks8695_rx(ksp, budget); @@ -571,8 +546,7 @@ static int ks8695_poll(struct napi_struct *napi, int budget) unsigned long flags; spin_lock_irqsave(&ksp->rx_lock, flags); - /* enable rx interrupt */ - writel(isr | mask_bit, KS8695_IRQ_VA + KS8695_INTEN); + enable_irq(ksp->rx_irq); spin_unlock_irqrestore(&ksp->rx_lock, flags); } return work_done;