using dev nameunit prior to probe & attach in pcib_alloc_resource()

John Baldwin jhb at freebsd.org
Wed Nov 29 10:21:15 PST 2006


On Thursday 12 October 2006 17:04, Jia-Shiun Li wrote:
> 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?

This should be fixed now.

-- 
John Baldwin


More information about the freebsd-current mailing list