diff mbox

[U-Boot] : net: Wrong Initialization in davinci-emac driver

Message ID CAGM3cC5UKCZGf6HYLd2UkYzzpdUtd3rWNAPmw4hYwqSRsVFYOQ@mail.gmail.com
State Changes Requested
Delegated to: Joe Hershberger
Headers show

Commit Message

Vishwas Srivastava Jan. 25, 2016, 5 p.m. UTC
Author: Vishwas Srivastava <vishu.kernel@gmail.com>
Date:   Mon Jan 25 21:28:17 2016 +0530

    Wrong Initialization in davinci emac driver

    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 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: Sergey Kubushyn <ksi@koi8.net>;Joe Hershberger <
joe.hershberger@ni.com>
    Signed-off-by: Vishwas Srivastava <vishu.kernel@gmail.com>

        /* Clear Statistics (do this before setting MacControl register) */

Comments

Joe Hershberger Jan. 27, 2016, 6:53 p.m. UTC | #1
On Mon, Jan 25, 2016 at 11:00 AM, Vishwas Srivastava
<vishu.kernel@gmail.com> wrote:
> Author: Vishwas Srivastava <vishu.kernel@gmail.com>
> Date:   Mon Jan 25 21:28:17 2016 +0530
>
>     Wrong Initialization in davinci emac driver
>
>     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 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: Sergey Kubushyn <ksi@koi8.net>;Joe Hershberger <
> joe.hershberger@ni.com>
>     Signed-off-by: Vishwas Srivastava <vishu.kernel@gmail.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Joe Hershberger Jan. 27, 2016, 7:57 p.m. UTC | #2
On Mon, Jan 25, 2016 at 11:00 AM, Vishwas Srivastava
<vishu.kernel@gmail.com> wrote:
> Author: Vishwas Srivastava <vishu.kernel@gmail.com>
> Date:   Mon Jan 25 21:28:17 2016 +0530

Please fix the patch subject. No Leading colon.

>
>     Wrong Initialization in davinci emac driver
>
>     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 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: Sergey Kubushyn <ksi@koi8.net>;Joe Hershberger <
> joe.hershberger@ni.com>

Please fix this formatting. One "Cc:" per line.

>     Signed-off-by: Vishwas Srivastava <vishu.kernel@gmail.com>

Don't specify this twice.

>
> diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
> index 92c3dca..3f54a3f 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)

This line wrap is corrupt. The patch won't apply cleanly.

>
>         /* 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) */

This line was corrupted by patchwork. You are doing something wrong.

> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

Please correct all these issues, but for the content of the patch, still Acked.

Thanks,
-Joe
diff mbox

Patch

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 92c3dca..3f54a3f 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++);