Thread (18 messages) flat view 18 messages, 7 authors, 2005-09-09

Re: [PATCH] 3c59x: read current link status from phy

From: Tommy Christensen <hidden>
Date: 2005-09-08 22:36:59
Also in: lkml

Bogdan Costescu wrote:
I now understood what the problem was, so I'll put it in words for 
posterity: the Link Status bit of the MII Status register needs to be 
read twice to first clear the error state (link bit=0) after which the 
bit reports the actual value of the link. From the manual:
Yes, this is exactly the point.
But I still don't agree with your solution: you are reading the Status 
register twice in all cases, which is wrong. What you want is to read it 
a second time only after the link was marked as down: a simple check if 
bit 2 of the Status register is 0, in which case you issue the second 
read. This still means that there will be 2 reads if the link remains 
down, but at least there is only 1 read for the case where the link is 
up and remains up.
I don't think this makes much of a difference in the big picture, but
you're certainly right: let's not waste more cycles than we have to.

Can we agree on the patch below?


-Tommy

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help