From patchwork Mon Dec 14 16:24:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Kaneko X-Patchwork-Id: 7845821 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A48D2BEEE5 for ; Mon, 14 Dec 2015 16:25:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C6197203B4 for ; Mon, 14 Dec 2015 16:25:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D880520270 for ; Mon, 14 Dec 2015 16:25:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751576AbbLNQZk (ORCPT ); Mon, 14 Dec 2015 11:25:40 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:36366 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750924AbbLNQZi (ORCPT ); Mon, 14 Dec 2015 11:25:38 -0500 Received: by pacdm15 with SMTP id dm15so105895753pac.3; Mon, 14 Dec 2015 08:25:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=9VkizNCtmzGR5npPnI4pXknNUfF9bakxNztVkuByn8M=; b=lcloSLKYIAAO0c4M68YBWboJHNFZrcgBFARJNssxEH5EK1zRzZUu7jOA/3djjQuM0a p4vyGPH5VvkF95mu9uX0RIZjIi1fHBbWNBEC5rAG9GPT9JBGOTUEg/2Z8O5BGuBU7nI7 wg3A6egh0cNnLR/ZLUjqaftyF+skmShDU5w3T/sG2DMyV9I9ORntPwyS0imBKHFa8AFo S/HC9G/lPZZqHI8nBLyjM0s8XkaHg7nGLy6K+dHUWYFtjnYCAc2gGmEX0kAMWdfbi2OU LjxyFRHpif/6MC1PPhC16PNaYVcNn8/OfbuYcgsZYYFt0z2x36GQ3XmYGhw5norn9vRU ESKw== X-Received: by 10.67.24.104 with SMTP id ih8mr47434524pad.124.1450110337872; Mon, 14 Dec 2015 08:25:37 -0800 (PST) Received: from localhost.localdomain (KD118152108246.ppp-bb.dion.ne.jp. [118.152.108.246]) by smtp.gmail.com with ESMTPSA id q71sm12520680pfq.21.2015.12.14.08.25.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Dec 2015 08:25:37 -0800 (PST) From: Yoshihiro Kaneko To: netdev@vger.kernel.org Cc: "David S. Miller" , Sergei Shtylyov , Simon Horman , Magnus Damm , linux-sh@vger.kernel.org Subject: [PATCH v3 net] ravb: clear RIC1 in init instead of stop Date: Tue, 15 Dec 2015 01:24:58 +0900 Message-Id: <1450110298-21392-1-git-send-email-ykaneko0929@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kazuya Mizuguchi AVB-DMAC Receive FIFO Warning interrupt is not enabled, so it is not necessary to disable the interrupt in ravb_close(). On the other hand, this patch disables the interrupt in ravb_dmac_init() to prevent the possibility that the interrupt is issued by the state that a boot loader left. Signed-off-by: Kazuya Mizuguchi Signed-off-by: Yoshihiro Kaneko Acked-by: Sergei Shtylyov --- This patch is based on the master branch of David Miller's networking tree. v3 [Yoshihiro Kaneko] * compile tested only * As suggested by Sergei Shtylyov - update the subject to reflect what this patch is doing. - clear RIC1 in ravb_dmac_init() instead of ravb_open(). v2 [Yoshihiro Kaneko] * compile tested only * As suggested by Sergei Shtylyov - clear RIC1 in ndo_open() to disable the interrupt regardless of a left state from a bootloader. drivers/net/ethernet/renesas/ravb_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index b69e0c2..b76303e 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -405,9 +405,11 @@ static int ravb_dmac_init(struct net_device *ndev) /* Timestamp enable */ ravb_write(ndev, TCCR_TFEN, TCCR); - /* Interrupt enable: */ + /* Interrupt init: */ /* Frame receive */ ravb_write(ndev, RIC0_FRE0 | RIC0_FRE1, RIC0); + /* Disable FIFO full warning */ + ravb_write(ndev, 0, RIC1); /* Receive FIFO full error, descriptor empty */ ravb_write(ndev, RIC2_QFE0 | RIC2_QFE1 | RIC2_RFFE, RIC2); /* Frame transmitted, timestamp FIFO updated */ @@ -1471,7 +1473,6 @@ static int ravb_close(struct net_device *ndev) /* Disable interrupts by clearing the interrupt masks. */ ravb_write(ndev, 0, RIC0); - ravb_write(ndev, 0, RIC1); ravb_write(ndev, 0, RIC2); ravb_write(ndev, 0, TIC);