From patchwork Fri Sep 25 05:15:18 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram X-Patchwork-Id: 50099 Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8P5HHML030665 for ; Fri, 25 Sep 2009 05:17:18 GMT Received: from dlep36.itg.ti.com ([157.170.170.91]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id n8P5FOeP028078 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 25 Sep 2009 00:15:24 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id n8P5FN8W026436; Fri, 25 Sep 2009 00:15:23 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id C8E9480627; Fri, 25 Sep 2009 00:15:23 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dbdp31.itg.ti.com (dbdp31.itg.ti.com [172.24.170.98]) by linux.omap.com (Postfix) with ESMTP id 6AEB180626 for ; Fri, 25 Sep 2009 00:15:22 -0500 (CDT) Received: from psplinux050.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id n8P5FJnv014319; Fri, 25 Sep 2009 10:45:19 +0530 (IST) Received: from psplinux050.india.ti.com (localhost [127.0.0.1]) by psplinux050.india.ti.com (8.13.1/8.13.1) with ESMTP id n8P5FINc029642; Fri, 25 Sep 2009 10:45:18 +0530 Received: (from a0875517@localhost) by psplinux050.india.ti.com (8.13.1/8.13.1/Submit) id n8P5FIDg028410; Fri, 25 Sep 2009 10:45:18 +0530 From: Sriram To: netdev@vger.kernel.org Date: Fri, 25 Sep 2009 10:45:18 +0530 Message-Id: <1253855718-6871-1-git-send-email-srk@ti.com> X-Mailer: git-send-email 1.6.2.4 Cc: Sriram , davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH] TI Davinci EMAC: Fix in vector definition for EMAC_VERSION_2 X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com In the emac_poll function when looking for interrupt status masks correct definition must be chosen based on EMAC_VERSION(the bit mask has changed from version 1 to version 2). Signed-off-by: Sriram Acked-by: Chaithrika U S --- drivers/net/davinci_emac.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 12fd446..376f527 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c @@ -200,6 +200,9 @@ static const char emac_version_string[] = "TI DaVinci EMAC Linux v6.1"; /** NOTE:: For DM646x the IN_VECTOR has changed */ #define EMAC_DM646X_MAC_IN_VECTOR_RX_INT_VEC BIT(EMAC_DEF_RX_CH) #define EMAC_DM646X_MAC_IN_VECTOR_TX_INT_VEC BIT(16 + EMAC_DEF_TX_CH) +#define EMAC_DM646X_MAC_IN_VECTOR_HOST_INT BIT(26) +#define EMAC_DM646X_MAC_IN_VECTOR_STATPEND_INT BIT(27) + /* CPPI bit positions */ #define EMAC_CPPI_SOP_BIT BIT(31) @@ -2168,7 +2171,11 @@ static int emac_poll(struct napi_struct *napi, int budget) emac_int_enable(priv); } - if (unlikely(status & EMAC_DM644X_MAC_IN_VECTOR_HOST_INT)) { + mask = EMAC_DM644X_MAC_IN_VECTOR_HOST_INT; + if (priv->version == EMAC_VERSION_2) + mask = EMAC_DM646X_MAC_IN_VECTOR_HOST_INT; + + if (unlikely(status & mask)) { u32 ch, cause; dev_err(emac_dev, "DaVinci EMAC: Fatal Hardware Error\n"); netif_stop_queue(ndev);