Skip to contentSkip to conversation

FCC driver for Motorola MPC82xx - an error found

DISCUSSION Martin Roth 2 participants 2 messages Nov 24, 2015 – Dec 8, 2015

lore
Share & tools
lore
#0 lore raw

I was looking for an error on MPC8270 processor 100 Mbps Ethernet FCC port. The port may become locked if it is set to AUTO, while the peer is forced to 100 Mbs full duplex (non AUTO).
I was looking for an error in the area of collision handling of the driver. It looks like I found the problem.

The error is at line 555:
http://lxr.free-electrons.com/source/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c#L555

The problem is that the last descriptor address is not calculated correctly.

Instead of
last_tx_bd = fep->tx_bd_base + (fpi->tx_ring * sizeof(cbd_t));
The fix should be:
last_tx_bd = fep->tx_bd_base + ((fpi->tx_ring-1)* sizeof(cbd_t));

Is it a bug?
Thanks,
Martin Roth

--
View this message in context: http://linuxppc.10917.n7.nabble.com/FCC-driver-for-Motorola-MPC82xx-an-error-found-tp101297.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.

#1 lore raw
Quoted 12 lines · Martin Roth

I was looking for an error on MPC8270 processor 100 Mbps Ethernet FCC port. The port may become locked if it is set to AUTO, while the peer is forced to 100 Mbs full duplex (non AUTO).
I was looking for an error in the area of collision handling of the driver. It looks like I found the problem.

The error is at line 555:
http://lxr.free-electrons.com/source/drivers/net/ethernet/freescale/fs_enet/
mac-fcc.c#L555

The problem is that the last descriptor address is not calculated correctly.

Quoted 8 lines

Instead of
last_tx_bd = fep->tx_bd_base + (fpi->tx_ring * sizeof(cbd_t));
The fix should be:

   last_tx_bd = fep->tx_bd_base + ((fpi->tx_ring-1)* sizeof(cbd_t));

Is it a bug?
Thanks,
Martin Roth

Yes, it looks like a bug. Could you send a patch to the netdev list and maintainer?

-Scott