svn commit: r298709 - in head: lib/libdevctl sys/kern sys/sys usr.sbin/devctl

John Baldwin jhb at freebsd.org
Wed Apr 27 16:42:35 UTC 2016


On Wednesday, April 27, 2016 04:33:17 PM John Baldwin wrote:
> Author: jhb
> Date: Wed Apr 27 16:33:17 2016
> New Revision: 298709
> URL: https://svnweb.freebsd.org/changeset/base/298709
> 
> Log:
>   Add 'devctl delete' that calls device_delete_child().
>   
>   'devctl delete' can be used to delete a device that is no longer present.
>   As an anti-foot-shooting measure, 'delete' will not delete a device
>   unless it's parent bus says it is no longer present.  This can be
>   overridden by passing the force ('-f') flag.
>   
>   Note that this command should be used with care.  If a device is deleted
>   that is actually present it can't be resurrected unless the parent bus
>   device's driver supports rescans.
>   
>   Differential Revision:	https://reviews.freebsd.org/D6019

Oops, both of the devctl commits probably warranted a 'Relnotes: yes'.

One obscure-ish use case for these commands is if you are working with a
PCI FPGA adapter that you can flash while the host machine is running.
The new configuration may involve changes to BAR layout, etc.  In that
case you should now be able to 'devctl delete' the device before flashing
it and 'devctl rescan' the parent bus after the flash is complete.

You can also use 'devctl rescan' for a poor-man's PCI-e hotplug support
on bridges that support automated PCI-e hotplug (no power controller, etc.)
such as the ExpressCard slot on the two Lenovo's I have (T400 and X220).

-- 
John Baldwin


More information about the svn-src-head mailing list