Panic on reloading a driver with same DEVICE_PROBE() return value

John Baldwin jhb at freebsd.org
Mon Feb 8 18:37:09 UTC 2016


On Monday, February 08, 2016 08:13:26 PM Sreekanth Reddy wrote:
> sc->facts = malloc(sizeof(MPI2_IOC_FACTS_REPLY), M_MPR, M_ZERO|M_NOWAIT);

M_NOWAIT can fail with NULL.  Normally in an attach routine you should use a
blocking malloc (M_WAITOK) which will not fail with NULL.

> * How can I reload the modified driver with return same device_probe()
> value as the one which has loaded during the OS boot time. I observed
> that whenever I try to load this modified driver using "kldload
> ./mpr.ko" command then I see that driver in the /boot/kernel/ path has
> executed.

At runtime you can use the devctl(8) command on HEAD (it will be included
in 10.3) to force a device to detach/attach to force a re-probe.

e.g.

devctl detach mpr0

# note that the device won't be named mpr0, you will need to use its PCI
# location for this next:

devctl attach pci0:4:0:0

-- 
John Baldwin


More information about the freebsd-scsi mailing list