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

From: John Baldwin <jhb_at_freebsd.org>
Date: Wed, 29 Nov 2006 11:51:26 -0500
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
Received on Wed Nov 29 2006 - 17:21:15 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:03 UTC