From patchwork Sun Dec 13 15:12:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Kaneko X-Patchwork-Id: 7839231 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 65E259F350 for ; Sun, 13 Dec 2015 15:15:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 769EB20361 for ; Sun, 13 Dec 2015 15:15:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 836B720351 for ; Sun, 13 Dec 2015 15:15:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751897AbbLMPOq (ORCPT ); Sun, 13 Dec 2015 10:14:46 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:34466 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751884AbbLMPOp (ORCPT ); Sun, 13 Dec 2015 10:14:45 -0500 Received: by pacwq6 with SMTP id wq6so90259500pac.1; Sun, 13 Dec 2015 07:14:44 -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=I/PEfirZYBTbNaDB8ndpxR4w0JHOCTjYROCXqabmA/4=; b=N6VSEP/DALIpOcAYJPUqfKmmveV6+iG3ehkfZ/Uh2n9CyEWStH2QFRVkH4rpoGUWAI mwXUhcFrukm0ggYckHUxFZ/3rJ+NmJ3Oa2X7N1G76bRhOisbwQcy+s3OApJLyYlgm7f8 ekDZBhpPFb9DeNS43n+YkMd0CMEMhNDh5jChh9nJ340UEQv1+8LSTlvQBXNp0caKHc8Y WSLpHiMzPhselzwtU9IIxHqe7P1/lfGGNlJcXUfARLMiBgV4q/OrzxNKK0O+8590gtUL PSNBy1wx14lHngS7XXE3uu/uRGY+GcZzoHt6cPGBf9+kEyvhy7MU7V5Ozo0C3vPG51+K wudg== X-Received: by 10.67.23.135 with SMTP id ia7mr38637321pad.77.1450019684819; Sun, 13 Dec 2015 07:14:44 -0800 (PST) Received: from localhost.localdomain (KD118152108246.ppp-bb.dion.ne.jp. [118.152.108.246]) by smtp.gmail.com with ESMTPSA id rz10sm37227844pac.29.2015.12.13.07.14.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 13 Dec 2015 07:14:44 -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 v2 net] ravb: Remove clear unhandled interrupt Date: Mon, 14 Dec 2015 00:12:23 +0900 Message-Id: <1450019545-32540-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=ham 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 ndo_close(). On the other hand, this patch disables the interrupt in ndo_open() 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 --- This patch is based on the master branch of David Miller's networking tree. 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index b69e0c2..5e34a88 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -1228,6 +1228,9 @@ static int ravb_open(struct net_device *ndev) goto out_free_irq2; ravb_emac_init(ndev); + /* Disable unhandled interrupt */ + ravb_write(ndev, 0, RIC1); + /* Initialise PTP Clock driver */ ravb_ptp_init(ndev, priv->pdev); @@ -1471,7 +1474,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);