From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755451AbbBSBB7 (ORCPT ); Wed, 18 Feb 2015 20:01:59 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:35398 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753173AbbBSAeA (ORCPT ); Wed, 18 Feb 2015 19:34:00 -0500 From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Mugunthan V N , "David S. Miller" , Kamal Mostafa Subject: [PATCH 3.13.y-ckt 022/103] drivers: net: cpsw: enable interrupts after napi enable and clearing previous interrupts Date: Wed, 18 Feb 2015 16:31:49 -0800 Message-Id: <1424305990-17983-23-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424305990-17983-1-git-send-email-kamal@canonical.com> References: <1424305990-17983-1-git-send-email-kamal@canonical.com> X-Extended-Stable: 3.13 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.13.11-ckt16 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Mugunthan V N commit f63a975e8f07a75dbf0386402788330d0bebd8d8 upstream. When the Ethernet interface is put down and up with heavy Ethernet traffic, then there is prossibility of an interrupt waiting in irq controller to be processed, so when the interface is brought up again just after enable interrupt, it goes to ISR due to the previous unhandled interrutp and in ISR napi is not scheduled as the napi is not enabled in ndo_open which results in disabled interrupt for CPSW and no packets are received in cpsw. So this patch moves enabling of interupts after napi_enable and clearing CPDMA interrupts. Signed-off-by: Mugunthan V N Signed-off-by: David S. Miller Signed-off-by: Kamal Mostafa --- drivers/net/ethernet/ti/cpsw.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 5330fd2..a6fb1c1 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -1169,6 +1169,12 @@ static int cpsw_ndo_open(struct net_device *ndev) cpsw_set_coalesce(ndev, &coal); } + napi_enable(&priv->napi); + cpdma_ctlr_start(priv->dma); + cpsw_intr_enable(priv); + cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); + cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); + prim_cpsw = cpsw_get_slave_priv(priv, 0); if (prim_cpsw->irq_enabled == false) { if ((priv == prim_cpsw) || !netif_running(prim_cpsw->ndev)) { @@ -1177,12 +1183,6 @@ static int cpsw_ndo_open(struct net_device *ndev) } } - napi_enable(&priv->napi); - cpdma_ctlr_start(priv->dma); - cpsw_intr_enable(priv); - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); - if (priv->data.dual_emac) priv->slaves[priv->emac_port].open_stat = true; return 0; -- 1.9.1