2.6.22-ppc8xx fec.c bugs

raul.moreno at telvent.abengoa.com raul.moreno at telvent.abengoa.com
Fri Jan 11 02:57:46 EST 2008

Hello everyone,

I don't know who the maintainer of the FEC (Fast Ethernet Controller) in
the ppc8xx achitecture is, so I am writing this email here.

After spending some time working withy kernel 2.6.15 for the ppc8xx
architecture, I've recently started to port to the 2.6.22. Doing so I have
found some bugs in the code managing the FEC (fec.c).

First I found (and cleared) some compilation errors due to inconsistent
changes in function prototypes (i.e. INIT_WORK). Moreover, if the "MDIO for
PHY" configuration is used (in my case for an LXT971 fec) the kernel
couldn't manage to finish booting and was caught in an infinite loop
waiting for fec intialization.

I've seen that some bugs were fixed in the latest kernel but others haven't
been addressed (possibly undetected yet). The following is a diff with
corrections I made to the 2.6.22 'fec.c' file (currently seems to work




> #else

>     fep->link = 1;    /* If PHY_INTERRUPT is not defined, fep->link  must
be also put to 1 */

> #endif


< #endif /* CONFIG_FEC_LXT970 */


> #endif /* CONFIG_FEC_LXT971 */


<           container_of(work, struct fec_enet_private, phy_task);


>           container_of(work, struct fec_enet_private, phy_task2);
/* use phy_task2 -->config */


<     cbd_base = (cbd_t *)dma_alloc_coherent(dev->class_dev.dev, PAGE_SIZE,


>     /* The first parameter has changed */

>     cbd_base = (cbd_t *)dma_alloc_coherent(&dev->dev, PAGE_SIZE,


<           ba = (unsigned char *)dma_alloc_coherent(dev->class_dev.dev,


>           /* The first parameter has changed */

>           ba = (unsigned char *)dma_alloc_coherent(&dev->dev,


< #ifdef    CONFIG_USE_MDIO

<     INIT_WORK(&fep->phy_task, mii_relink, (void *)dev);

<     INIT_WORK(&fep->phy_task2, mii_display_config, (void *)dev);


> #ifdef    CONFIG_USE_MDIO         /* INIT_WORK has only two parameter
since 2.6.20 */

>     INIT_WORK(&fep->phy_task, mii_relink);

>     INIT_WORK(&fep->phy_task2, mii_display_config);

I hope this helps.
Best regards,

Raúl Moreno

More information about the Linuxppc-embedded mailing list