diff mbox

[U-Boot] net: fix wrong initialization in davinci-emac driver

Message ID 1454768906-5468-1-git-send-email-agust@denx.de
State Accepted
Commit abbf2d9b56f2583b5f047f64a6efe11c01ef8d4b
Delegated to: Anatolij Gustschin
Headers show

Commit Message

Anatolij Gustschin Feb. 6, 2016, 2:28 p.m. UTC
From: Vishwas Srivastava <vishu.kernel@gmail.com>

emac module of the davinci platform supports only 8 tx and 8
rx channels (total 16). emac driver for davinci platform,
however, while doing initialization of the dma descriptor
head pointers, wrongly initializes the 16 head pointers
(instead of  8) for tx dma and 16 head pointers (insted of 8)
for rx dma, which is wrong. The result is, that this register
initilization spills over the other registers which was not
intended and is undesirable. This patch fixes this problem.

Signed-off-by: Vishwas Srivastava <vishu.kernel@gmail.com>
CC: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
---

Changes for v4:
	- slightly edit the commit message
	- prepare properly formated patch

Changes for v3:
	- Added the missing patch part of v2

Changes for v2:
	- cleaned up the style format
	- addressed various comments given by Joe

 drivers/net/davinci_emac.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Anatolij Gustschin Feb. 6, 2016, 2:35 p.m. UTC | #1
On Sat,  6 Feb 2016 15:28:26 +0100
Anatolij Gustschin agust@denx.de wrote:

> From: Vishwas Srivastava <vishu.kernel@gmail.com>
> 
> emac module of the davinci platform supports only 8 tx and 8
> rx channels (total 16). emac driver for davinci platform,
> however, while doing initialization of the dma descriptor
> head pointers, wrongly initializes the 16 head pointers
> (instead of  8) for tx dma and 16 head pointers (insted of 8)
> for rx dma, which is wrong. The result is, that this register
> initilization spills over the other registers which was not
> intended and is undesirable. This patch fixes this problem.
> 
> Signed-off-by: Vishwas Srivastava <vishu.kernel@gmail.com>
> CC: Joe Hershberger <joe.hershberger@ni.com>
> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
> 
> Changes for v4:
> 	- slightly edit the commit message
> 	- prepare properly formated patch
> 
> Changes for v3:
> 	- Added the missing patch part of v2
> 
> Changes for v2:
> 	- cleaned up the style format
> 	- addressed various comments given by Joe
> 
>  drivers/net/davinci_emac.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to u-boot-staging, thanks!

--
Anatolij
diff mbox

Patch

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 92c3dca..6f2dc8d 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -459,11 +459,11 @@  static int davinci_eth_open(struct eth_device *dev, bd_t *bis)
 
 	/* Set DMA 8 TX / 8 RX Head pointers to 0 */
 	addr = &adap_emac->TX0HDP;
-	for(cnt = 0; cnt < 16; cnt++)
+	for (cnt = 0; cnt < 8; cnt++)
 		writel(0, addr++);
 
 	addr = &adap_emac->RX0HDP;
-	for(cnt = 0; cnt < 16; cnt++)
+	for (cnt = 0; cnt < 8; cnt++)
 		writel(0, addr++);
 
 	/* Clear Statistics (do this before setting MacControl register) */