Panic on reloading a driver with same DEVICE_PROBE() return value
Sreekanth Reddy
sreekanth.reddy at broadcom.com
Wed Feb 10 11:07:28 UTC 2016
On Wed, Feb 10, 2016 at 3:30 AM, John Baldwin <jhb at freebsd.org> wrote:
> On Tuesday, February 09, 2016 05:45:38 PM Sreekanth Reddy wrote:
>> Hi,
>>
>> While debugging more, I got one more clue,
>>
>> -----------------------------------------------------------------------------------------------
>> static driver_t mps_pci_driver = {
>> "mpr",
>> mps_methods,
>> sizeof(struct mps_softc)
>> };
>>
>> static devclass_t mps_devclass;
>> DRIVER_MODULE(mpr, pci, mps_pci_driver, mps_devclass, 0, 0);
>> -------------------------------------------------------------------------------------------------
>>
>> in the above code snip-set, if I changed "DRIVER_MODULE" line as
>> DRIVER_MODULE(mpr3, pci, mps_pci_driver, mps_devclass, 0, 0);
>> (i.e. from "mpr" to "mpr3") then I am not observing any panic and I
>> can load & unload the mpr driver multiple times.
>
> Oh, that might be required, yes. DRIVER_MODULE uses its arguments to define
> a module name (in this case as "pci/mpr") and module names are required to
> be unique. I believe you should be getting a printf warning about this on
> the console. Something like:
>
> "module_register: cannot register pci/mpr from blah.ko; already loaded from foo.ko"
Yes, I am getting below messages, at OS boot time for Out-of-box driver
module_register: module pci/mpr already exists!
Module pci/mpr failed to register: 17
>
> --
> John Baldwin
More information about the freebsd-scsi
mailing list