From patchwork Tue Aug 9 16:00:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 9271593 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 25F9C60754 for ; Tue, 9 Aug 2016 16:00:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13A9828365 for ; Tue, 9 Aug 2016 16:00:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04108283E5; Tue, 9 Aug 2016 16:00:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D06EB28365 for ; Tue, 9 Aug 2016 16:00:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752357AbcHIQAh (ORCPT ); Tue, 9 Aug 2016 12:00:37 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:35090 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752051AbcHIQAg (ORCPT ); Tue, 9 Aug 2016 12:00:36 -0400 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OBN00L7GGGU0H10@mailout3.samsung.com>; Wed, 10 Aug 2016 01:00:33 +0900 (KST) X-AuditID: cbfee61a-f78ff6d000001462-3b-57a9fe2189ae Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 6A.AE.05218.12EF9A75; Wed, 10 Aug 2016 01:00:33 +0900 (KST) Received: from AMDC1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OBN0073ZGGMBM90@mmp2.samsung.com>; Wed, 10 Aug 2016 01:00:33 +0900 (KST) From: Sylwester Nawrocki To: davem@davemloft.net Cc: netdev@vger.kernel.org, robert.jarzmik@free.fr, linus.walleij@linaro.org, tglx@linutronix.de, b.zolnierkie@samsung.com, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki Subject: [PATCH] dm9000: Fix irq trigger type setup on non-dt platforms Date: Tue, 09 Aug 2016 18:00:08 +0200 Message-id: <1470758408-14248-1-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmluLIzCtJLcpLzFFi42I5/e+xoK7iv5XhBh8/q1lsnLGe1WLO+RYW iyl/ljNZXN41h81ixvl9TBbHFohZzHojbHH4TTurxeZNU5kdOD22rLzJ5NG/7jOrx51re9g8 3p07x+7Rt2UVo8fnTXIBbFFcNimpOZllqUX6dglcGe2919kKJotXbDq8hb2BsVu4i5GTQ0LA ROL+wfPMELaYxIV769m6GLk4hARmMUrsWPIcyvnFKDF94hImkCo2AUOJ3qN9jCC2iIC4RPOb p2BxZoE3jBK3G9hAbGEBd4mpxw6AxVkEVCVun5rD2sXIwcEr4CYxfYkWxDI5iZPHJrNOYORe wMiwilEitSC5oDgpPdcwL7Vcrzgxt7g0L10vOT93EyM4iJ5J7WA8uMv9EKMAB6MSD2/Az5Xh QqyJZcWVuYcYJTiYlUR4r34HCvGmJFZWpRblxxeV5qQWH2KU5mBREud9/H9dmJBAemJJanZq akFqEUyWiYNTqoGxLHlZhfYkDl/uMu5pQfXlYu2P36iKTbxlqiLl3nn77abguadnXV3z8O7a iokLrVu2/VeIvXKCp8r3gkRz2rIilf/slTLeqs5H277Eb7nb1WLAXTEr+oltir3ivoleP6tq lZ4cEi+IEHsoy/B+/10J9huHmSu/XFki1vL6Q/DErSezjEN1REKVWIozEg21mIuKEwHQDwon HgIAAA== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit b5a099c67a1c36b "net: ethernet: davicom: fix devicetree irq resource" causes an interrupt storm after the ethernet interface is activated on S3C24XX platform (ARM non-dt), due to the interrupt trigger type not being set properly. It seems, after adding parsing of IRQ flags in commit 7085a7401ba54e92b "drivers: platform: parse IRQ flags from resources", there is no path for non-dt platforms where irq_set_type callback could be invoked when we don't pass the trigger type flags to the request_irq() call. In case of a board where the regression is seen the interrupt trigger type flags are passed through a platform device's resource and it is not currently handled properly without passing the irq trigger type flags to the request_irq() call. In case of OF an of_irq_get() call within platform_get_irq() function seems to be ensuring required irq_chip setup, but there is no equivalent code for non OF/ACPI platforms. This patch mostly restores irq trigger type setting code which has been removed in commit ("net: ethernet: davicom: fix devicetree irq resource"). Fixes: b5a099c67a1c36b913 ("net: ethernet: davicom: fix devicetree irq resource") Signed-off-by: Sylwester Nawrocki Acked-by: Robert Jarzmik --- Perhaps instead the core could be configuring the irqchip automatically as it is done for OF/ACPI cases. I had doubts though if trying to make such changes for a bug fix patch was the right thing to do. --- drivers/net/ethernet/davicom/dm9000.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c index 1471e16..f45385f 100644 --- a/drivers/net/ethernet/davicom/dm9000.c +++ b/drivers/net/ethernet/davicom/dm9000.c @@ -1299,6 +1299,7 @@ static int dm9000_open(struct net_device *dev) { struct board_info *db = netdev_priv(dev); + unsigned int irq_flags = irq_get_trigger_type(dev->irq); if (netif_msg_ifup(db)) dev_dbg(db->dev, "enabling %s\n", dev->name); @@ -1306,9 +1307,11 @@ dm9000_open(struct net_device *dev) /* If there is no IRQ type specified, tell the user that this is a * problem */ - if (irq_get_trigger_type(dev->irq) == IRQF_TRIGGER_NONE) + if (irq_flags == IRQF_TRIGGER_NONE) dev_warn(db->dev, "WARNING: no IRQ resource flags set.\n"); + irq_flags |= IRQF_SHARED; + /* GPIO0 on pre-activate PHY, Reg 1F is not set by reset */ iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */ mdelay(1); /* delay needs by DM9000B */ @@ -1316,8 +1319,7 @@ dm9000_open(struct net_device *dev) /* Initialize DM9000 board */ dm9000_init_dm9000(dev); - if (request_irq(dev->irq, dm9000_interrupt, IRQF_SHARED, - dev->name, dev)) + if (request_irq(dev->irq, dm9000_interrupt, irq_flags, dev->name, dev)) return -EAGAIN; /* Now that we have an interrupt handler hooked up we can unmask * our interrupts