#1465 closed defect (wontfix)

Network autonegotiation fails with GRETH driver

Reported by: Joris van Rantwijk Owned by: Jiri Gaisler
Priority: normal Milestone: 4.11
Component: arch/sparc Version: 4.11
Severity: minor Keywords:
Cc: joel.sherrill@…, daniel@…, gedare@… Blocked By:
Blocking:

Description (last modified by Joel Sherrill)

The RTEMS driver for the GRETH Ethernet core incorrectly reports a timeout during link autonegotiation. The output looks like this:

Auto negotiation timed out. Selecting default config
greth: driver attached
PHY
Vendor: 1f0 Device: a Revision: 3
Current Operating Mode: 10 Mbit Half Duplex
Autonegotiation Time: 4295959ms

But in fact autonegotiation has succeeded and the link is already in 100 Mbit full duplex mode. Also note the insane autonegatiation time reported.

This is caused by a bug in the the timeout logic.
In c/src/libchip/network/greth.c, there is a line that says:

msecs = (tnow.seconds-tstart.seconds)*1000+(tnow.microseconds-tstart.microseconds)/1000;

The variable tnow.microsenconds has type uint32_t, therefore the calculation is incorrect when tnow.microseconds < tstart.microseconds.

Better would be:

msecs = (tnow.seconds-tstart.seconds)*1000+tnow.microseconds/1000-tstart.microseconds/1000;

I'm using a recent CVS version of RTEMS. My platform is the LEON3 core from grlib-1.0.21 on a Digilent XC3S1600E board.

Greetings, Joris.

Attachments (3)

greth_autoneg_fix.diff (855 bytes) - added by Joris van Rantwijk on Feb 4, 2012 at 8:42:25 AM.
Fix arithmetic in calculation of GRETH autonegotiation timeout
0008-GRETH-Fixed-autonego-timeout-overflow-problem.patch (1.3 KB) - added by Daniel Hellstrom on Feb 6, 2012 at 8:09:17 AM.
Patch for HEAD
0001-GRETH-Fixed-autonego-timeout-overflow-problem.patch (1.2 KB) - added by Daniel Hellstrom on Feb 6, 2012 at 8:18:00 AM.
patch 2 for HEAD

Download all attachments as: .zip

Change History (12)

comment:1 Changed on Jun 24, 2010 at 9:55:06 PM by Joel Sherrill

Owner: changed from Joel Sherrill to Jiri Gaisler

comment:2 Changed on Aug 6, 2010 at 10:07:05 PM by Joel Sherrill

Cc: Joel Sherrill added
Milestone: 4.10Not Assigned

comment:3 Changed on Aug 10, 2010 at 2:01:47 PM by Daniel Hellstrom

Cc: Daniel Hellstrom added

Changed on Feb 4, 2012 at 8:42:25 AM by Joris van Rantwijk

Attachment: greth_autoneg_fix.diff added

Fix arithmetic in calculation of GRETH autonegotiation timeout

comment:4 Changed on Feb 4, 2012 at 2:49:26 PM by Gedare Bloom

Cc: Gedare Bloom added

Changed on Feb 6, 2012 at 8:09:17 AM by Daniel Hellstrom

Patch for HEAD

Changed on Feb 6, 2012 at 8:18:00 AM by Daniel Hellstrom

patch 2 for HEAD

comment:5 Changed on Feb 6, 2012 at 8:18:00 AM by Daniel Hellstrom

attachments.isobsolete: 01

comment:6 Changed on Mar 27, 2012 at 1:35:11 PM by Daniel Hellstrom

Resolution: wontfix
Status: newclosed

See previous message for reason why this bug is closed.

comment:7 Changed on Nov 20, 2014 at 4:41:05 AM by Chris Johns

Milestone: Not Assigned4.11

All fixed and close on HEAD.

comment:8 Changed on Nov 23, 2014 at 7:09:58 PM by Joel Sherrill

Description: modified (diff)
Version: unknown4.11

comment:9 Changed on Oct 10, 2017 at 6:32:00 AM by Sebastian Huber

Component: libcpuarch/sparc
Note: See TracTickets for help on using tickets.