From owner-freebsd-current@FreeBSD.ORG Wed Dec 29 12:44:34 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6CF8E16A4CE for ; Wed, 29 Dec 2004 12:44:34 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0DBA643D31 for ; Wed, 29 Dec 2004 12:44:34 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: by wproxy.gmail.com with SMTP id 58so16402wri for ; Wed, 29 Dec 2004 04:44:33 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=ayYUu+dIdTGru6ycPKFFZFcfJeutD3SNivNQ8/z8673igKPXjns0xOsqyzG6F3hn9yydC85amiwwbLkBt8ySIy3msJ1iEW5pxr+z7Ho9OA77g5PMJcxFH24hzMnNco40GDjSzImO556F0LmP0LGTmm8J8FpcNJd7CuodvR5LO/g= Received: by 10.54.11.9 with SMTP id 9mr131894wrk; Wed, 29 Dec 2004 04:44:33 -0800 (PST) Received: by 10.54.57.76 with HTTP; Wed, 29 Dec 2004 04:44:33 -0800 (PST) Message-ID: <34cb7c840412290444497d2dd7@mail.gmail.com> Date: Wed, 29 Dec 2004 12:44:33 +0000 From: Peter Edwards To: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= , "Li-Lun Wang (Leland Wang)" In-Reply-To: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_487_11899736.1104324273433" References: cc: current@freebsd.org Subject: Re: fxp EEPROM checksum mismatch in recent -CURRENT X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: peadar@freebsd.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Dec 2004 12:44:34 -0000 ------=_Part_487_11899736.1104324273433 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sat, 25 Dec 2004 19:26:57 +0100, Dag-Erling Sm=F8rgrav wrot= e: > Yesterday's -CURRENT fails to attach the onboard fxp on my Gigabyte > motherboard: >=20 > fxp0: port 0xb000-0xb03f mem 0= xfb050000-0xfb050fff irq 20 at device 8.0 on pci2 > fxp0: Disabling dynamic standby mode in EEPROM > fxp0: New EEPROM ID: 0xfffd > fxp0: EEPROM checksum @ 0xff: 0xffff -> 0xbbb9 > fxp0: MII without any PHY! > device_attach: fxp0 attach returned 6 I had this problem, but had put it down to dodgy hardware. Seeing as a few = other people saw it, I had a look: It turns out that the problems are due to the base address register for the device's memory range being bogus when you get into fxp_attach. Tracing further, it looks like on waking up from D3 into D0, the fxp device needs some time to settle, or the config write to restore the BAR doesn't "take". That explains why it works if it's dragged in from the loader: the device probes without ever going to sleep. The attached ugly hack makes my fxp module behave. I'm not sure if this is a good idea for the general case, or if a quirk entry of some sort might be preferrable. I'd imagine this is probably an issue that might happen with other devices. Any PCI gurus have an opinion? --=20 peadar ------=_Part_487_11899736.1104324273433 Content-Type: text/plain; name="pcipatch.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="pcipatch.txt" ? sys/dev/pci/.pci.c.swp ? sys/dev/pci/.swp Index: sys/dev/pci/pci.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/cvs/FreeBSD-CVS/src/sys/dev/pci/pci.c,v retrieving revision 1.273 diff -u -r1.273 pci.c --- sys/dev/pci/pci.c=098 Dec 2004 04:35:19 -0000=091.273 +++ sys/dev/pci/pci.c=0929 Dec 2004 12:38:48 -0000 @@ -534,9 +534,11 @@ =09=09default: =09=09=09result =3D EINVAL; =09=09} -=09=09if (result =3D=3D 0) +=09=09if (result =3D=3D 0) { =09=09=09PCI_WRITE_CONFIG(dev, child, cfg->pp.pp_status, status, =09=09=09=09=09 2); +=09=09=09DELAY(10); +=09=09} =09} else { =09=09result =3D ENXIO; =09} ------=_Part_487_11899736.1104324273433--