From owner-cvs-src@FreeBSD.ORG Tue Mar 20 20:48:15 2007 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D460F16A404; Tue, 20 Mar 2007 20:48:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.freebsd.org (Postfix) with ESMTP id 9181113C46A; Tue, 20 Mar 2007 20:48:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from niksun.com (anuket [10.70.0.5]) by anuket.mj.niksun.com (8.13.6/8.13.6) with ESMTP id l2KKmCJB099144; Tue, 20 Mar 2007 16:48:12 -0400 (EDT) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: cvs-src@FreeBSD.org Date: Tue, 20 Mar 2007 16:48:02 -0400 User-Agent: KMail/1.6.2 References: <200703192317.l2JNHd59062213@repoman.freebsd.org> <460035F8.3080507@polstra.com> In-Reply-To: <460035F8.3080507@polstra.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200703201648.09419.jkim@FreeBSD.org> X-Virus-Scanned: ClamAV 0.88.6/2881/Tue Mar 20 15:53:24 2007 on anuket.mj.niksun.com X-Virus-Status: Clean Cc: src-committers@FreeBSD.org, cvs-all@FreeBSD.org, John Polstra Subject: Re: cvs commit: src/sys/dev/mii brgphy.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2007 20:48:15 -0000 On Tuesday 20 March 2007 03:28 pm, John Polstra wrote: > Jung-uk Kim wrote: > > jkim 2007-03-19 23:17:39 UTC > > > > FreeBSD src repository > > > > Modified files: > > sys/dev/mii brgphy.c > > Log: > > Revert couple of changes from 1.51 and 1.52. Reading link > > status with BMSR is okay for most of the chipsets but BCM5701 PHY > > does not seem to like it. > > I'm not sure what you mean by "does not seem to like it", but did > you try reading the BMSR twice? The link status bit is a latching > bit. If you read the register once and it shows no link status, > that only means that at some point since you previously read the > register, link was lost. It says nothing about the current status > of link. The only way to find out the current status of link is to > read the register twice. The first read clears the latch, and the > second read reports the current status. This is not specific to > the Broadcom chips. It is standard across all PHYs. Believe me, I know that. ;-) I was experimenting on brgphy.c some time ago and discovered all of my Broadcom PHYs are not 'standard' PHYs (in your definition), i.e., BMSR's link status bit is not latching. That is why I just used BMSR instead of aux status register to reduce register access. This commit actually reverts them to the old (but safer) behavior because BCM5701 PHY 'seems' to be more standard. Unfortunately we don't have any documents to verify anything ATM. We are flying blind. :-( Jung-uk Kim