From owner-freebsd-current@FreeBSD.ORG Thu Oct 12 21:05:43 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org 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 BD78616A407 for ; Thu, 12 Oct 2006 21:05:43 +0000 (UTC) (envelope-from jiashiun@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id 301E643D8B for ; Thu, 12 Oct 2006 21:05:28 +0000 (GMT) (envelope-from jiashiun@gmail.com) Received: by py-out-1112.google.com with SMTP id f25so795403pyf for ; Thu, 12 Oct 2006 14:04:55 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=BwQQL899pWijCeL34McmsDBz9jvZKhZxfb5FseYpnhkIftJoYQFECewjHojiPeXjgrd0TjtY7h/bhGzRWn83Kj1jOKlnZzlvu68Nj0LDMGexhj5sChWmn0tuT88hp9oW3lVHI2loyQvDqmN+M4BISqgJvGmo24yM7fovK7gFnEI= Received: by 10.35.83.6 with SMTP id k6mr3999826pyl; Thu, 12 Oct 2006 14:04:54 -0700 (PDT) Received: by 10.35.111.4 with HTTP; Thu, 12 Oct 2006 14:04:54 -0700 (PDT) Message-ID: <1d6d20bc0610121404r600bfee6n9633d621b6dc2e87@mail.gmail.com> Date: Fri, 13 Oct 2006 05:04:54 +0800 From: "Jia-Shiun Li" To: freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: using dev nameunit prior to probe & attach in pcib_alloc_resource() X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2006 21:05:43 -0000 This is a cosmetic bug (probably). I noticed that pcib prints some null pointer string in verbose dmesg like the following example. The pcib driver prints "(null) requested memory...". It turns out that pcib_alloc_resource() intended to use dev->nameunit to show device name. But the function is called for the first time during pci bus device enumeration. By the time the driver probing function is not called yet, and hence no valid nameunit. I suppose this code fragment in pcib_alloc_resource(): if (bootverbose) device_printf(dev,"%s requested memory range " "0x%lx-0x%lx: good\n", device_get_nameunit(child), start, end); should be changed to use something else, for example pci device(slot) and function numbers, to identify the newly enumerated and yet probed pci devices. Any comment? The verbose dmesg example: pcib3: at device 30.0 on pci0 pcib3: secondary bus 1 pcib3: subordinate bus 1 pcib3: I/O decode 0xc000-0xcfff pcib3: memory decode 0xdec00000-0xdeefffff pcib3: prefetched decode 0xdf000000-0xdfffffff pcib3: Subtractively decoded bridge. pci1: on pcib3 pci1: physical bus=1 found-> vendor=0x1039, dev=0x6326, revid=0x0b bus=1, slot=9, func=0 class=03-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0007, statreg=0x0230, cachelnsz=0 (dwords) lattimer=0x40 (1920 ns), mingnt=0x02 (500 ns), maxlat=0x00 (0 ns) powerspec 1 supports D0 D2 D3 current D0 map[10]: type 3, range 32, base df000000, size 23, enabled pcib3: (null) requested memory range 0xdf000000-0xdf7fffff: good map[14]: type 1, range 32, base decf0000, size 16, enabled pcib3: (null) requested memory range 0xdecf0000-0xdecfffff: good map[18]: type 4, range 32, base 0000c400, size 7, enabled pcib3: (null) requested I/O range 0xc400-0xc47f: in range found-> vendor=0x8086, dev=0x1229, revid=0x02 bus=1, slot=10, func=0 class=02-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0007, statreg=0x0280, cachelnsz=0 (dwords) lattimer=0x40 (1920 ns), mingnt=0x08 (2000 ns), maxlat=0x38 (14000 ns) intpin=a, irq=5 map[10]: type 3, range 32, base dffff000, size 12, enabled pcib3: (null) requested memory range 0xdffff000-0xdfffffff: good map[14]: type 4, range 32, base 0000c800, size 5, enabled pcib3: (null) requested I/O range 0xc800-0xc81f: in range map[18]: type 1, range 32, base dee00000, size 20, enabled pcib3: (null) requested memory range 0xdee00000-0xdeefffff: good pcib3: matched entry for 1.10.INTA pcib3: slot 10 INTA hardwired to IRQ 21 vgapci0: port 0xc400-0xc47f mem 0xdf000000-0xdf7fffff,0xdecf0000-0xdecfffff at device 9.0 o n pci1 fxp0: port 0xc800-0xc81f mem 0xdffff000-0xdfffffff,0xdee00000-0xdeefffff irq 21 at de vice 10.0 on pci1 fxp0: Reserved 0x1000 bytes for rid 0x10 type 3 at 0xdffff000 fxp0: using memory space register mapping fxp0: PCI IDs: 8086 1229 0000 0000 0002 fxp0: Dynamic Standby mode is disabled miibus0: on fxp0 amphy0: on miibus0 amphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto fxp0: bpf attached fxp0: Ethernet address: 00:c0:0c:70:10:05 ioapic0: routing intpin 21 (PCI IRQ 21) to vector 49 fxp0: [MPSAFE] Jia-Shiun.