From patchwork Fri Jan 2 18:10:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 5560371 Return-Path: X-Original-To: patchwork-linux-omap@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 D584EBF6C3 for ; Fri, 2 Jan 2015 18:11:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F3B1920259 for ; Fri, 2 Jan 2015 18:11:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 117F02013D for ; Fri, 2 Jan 2015 18:11:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751950AbbABSLG (ORCPT ); Fri, 2 Jan 2015 13:11:06 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:41062 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751779AbbABSLF (ORCPT ); Fri, 2 Jan 2015 13:11:05 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t02IB2ow003651; Fri, 2 Jan 2015 12:11:02 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t02IB2Z0004848; Fri, 2 Jan 2015 12:11:02 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Fri, 2 Jan 2015 12:11:02 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t02IB1NP026995; Fri, 2 Jan 2015 12:11:02 -0600 From: Felipe Balbi To: David Miller CC: Mugunthan V N , Yegor Yefremov , Linux OMAP Mailing List , , Felipe Balbi Subject: [PATCH 4/4] net: ethernet: cpsw: don't requests IRQs we don't use Date: Fri, 2 Jan 2015 12:10:28 -0600 Message-ID: <1420222228-31949-5-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.2.0 In-Reply-To: <1420222228-31949-1-git-send-email-balbi@ti.com> References: <1420222228-31949-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 CPSW never uses RX_THRESHOLD or MISC interrupts. In fact, they are always kept masked in their appropriate IRQ Enable register. Instead of allocating an IRQ that never fires, it's best to remove that code altogether and let future patches implement it if anybody needs those. Signed-off-by: Felipe Balbi --- drivers/net/ethernet/ti/cpsw.c | 55 ++++++++++++------------------------------ 1 file changed, 15 insertions(+), 40 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index c9081bd..fd0acd9 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -754,16 +754,6 @@ requeue: dev_kfree_skb_any(new_skb); } -static irqreturn_t cpsw_dummy_interrupt(int irq, void *dev_id) -{ - struct cpsw_priv *priv = dev_id; - int value = irq - priv->irqs_table[0]; - - cpdma_ctlr_eoi(priv->dma, value); - - return IRQ_HANDLED; -} - static irqreturn_t cpsw_tx_interrupt(int irq, void *dev_id) { struct cpsw_priv *priv = dev_id; @@ -1635,8 +1625,8 @@ static void cpsw_ndo_poll_controller(struct net_device *ndev) cpsw_intr_disable(priv); cpdma_ctlr_int_ctrl(priv->dma, false); - cpsw_rx_interrupt(priv->irq[1], priv); - cpsw_tx_interrupt(priv->irq[2], priv); + cpsw_rx_interrupt(priv->irq[0], priv); + cpsw_tx_interrupt(priv->irq[1], priv); cpdma_ctlr_int_ctrl(priv->dma, true); cpsw_intr_enable(priv); } @@ -2358,30 +2348,27 @@ static int cpsw_probe(struct platform_device *pdev) goto clean_dma_ret; } - ndev->irq = platform_get_irq(pdev, 0); + ndev->irq = platform_get_irq(pdev, 1); if (ndev->irq < 0) { dev_err(priv->dev, "error getting irq resource\n"); ret = -ENOENT; goto clean_ale_ret; } - irq = platform_get_irq(pdev, 0); - if (irq < 0) - goto clean_ale_ret; - - priv->irqs_table[0] = irq; - ret = devm_request_irq(&pdev->dev, irq, cpsw_dummy_interrupt, - 0, dev_name(&pdev->dev), priv); - if (ret < 0) { - dev_err(priv->dev, "error attaching irq (%d)\n", ret); - goto clean_ale_ret; - } + /* Grab RX and TX IRQs. Note that we also have RX_THRESHOLD and + * MISC IRQs which are always kept disabled with this driver so + * we will not request them. + * + * If anyone wants to implement support for those, make sure to + * first request and append them to irqs_table array. + */ + /* RX IRQ */ irq = platform_get_irq(pdev, 1); if (irq < 0) goto clean_ale_ret; - priv->irqs_table[1] = irq; + priv->irqs_table[0] = irq; ret = devm_request_irq(&pdev->dev, irq, cpsw_rx_interrupt, 0, dev_name(&pdev->dev), priv); if (ret < 0) { @@ -2389,31 +2376,19 @@ static int cpsw_probe(struct platform_device *pdev) goto clean_ale_ret; } + /* TX IRQ */ irq = platform_get_irq(pdev, 2); if (irq < 0) goto clean_ale_ret; - priv->irqs_table[2] = irq; + priv->irqs_table[1] = irq; ret = devm_request_irq(&pdev->dev, irq, cpsw_tx_interrupt, 0, dev_name(&pdev->dev), priv); if (ret < 0) { dev_err(priv->dev, "error attaching irq (%d)\n", ret); goto clean_ale_ret; } - - irq = platform_get_irq(pdev, 3); - if (irq < 0) - goto clean_ale_ret; - - priv->irqs_table[3] = irq; - ret = devm_request_irq(&pdev->dev, irq, cpsw_dummy_interrupt, - 0, dev_name(&pdev->dev), priv); - if (ret < 0) { - dev_err(priv->dev, "error attaching irq (%d)\n", ret); - goto clean_ale_ret; - } - - priv->num_irqs = 4; + priv->num_irqs = 2; ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;