From owner-p4-projects@FreeBSD.ORG Fri Jan 6 20:27:06 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D5CF916A422; Fri, 6 Jan 2006 20:27:05 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AFA5316A41F for ; Fri, 6 Jan 2006 20:27:05 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BE1E43D45 for ; Fri, 6 Jan 2006 20:27:05 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k06KR5nt041713 for ; Fri, 6 Jan 2006 20:27:05 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k06KR5gM041710 for perforce@freebsd.org; Fri, 6 Jan 2006 20:27:05 GMT (envelope-from imp@freebsd.org) Date: Fri, 6 Jan 2006 20:27:05 GMT Message-Id: <200601062027.k06KR5gM041710@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 89292 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2006 20:27:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=89292 Change 89292 by imp@imp_Speedy on 2006/01/06 20:26:04 A short delay is needed before reading the management registers. The reason is unknown. Maybe there's a back to back problem with certain registers. We hang otherwise. Noticed this when it worked with debug but failed w/o it. DEALY(1) is currently about 7.812ms, but this code works with delays as short as 10us (maybe even smaller). Affected files ... .. //depot/projects/arm/src/sys/arm/at91/if_ate.c#13 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/if_ate.c#13 (text+ko) ==== @@ -587,7 +587,10 @@ * XXX to make sure that the clock to the emac is on here */ + if (phy != 0) + return (0xffff); sc = device_get_softc(dev); + DELAY(1); /* Hangs w/o this delay really 7.812ms atm */ WR4(sc, ETH_MAN, ETH_MAN_REG_RD(phy, reg)); while ((RD4(sc, ETH_SR) & ETH_SR_IDLE) == 0) continue;