Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/devctl/devctl.8
Show All 18 Lines | |||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd August 29, 2016 | .Dd April 4, 2019 | ||||
imp: date here
| |||||
.Dt DEVCTL 8 | .Dt DEVCTL 8 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm devctl | .Nm devctl | ||||
.Nd device control utility | .Nd device control utility | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Nm | .Nm | ||||
.Cm attach | .Cm attach | ||||
Show All 25 Lines | |||||
.Ar device driver | .Ar device driver | ||||
.Nm | .Nm | ||||
.Cm rescan | .Cm rescan | ||||
.Ar device | .Ar device | ||||
.Nm | .Nm | ||||
.Cm delete | .Cm delete | ||||
.Op Fl f | .Op Fl f | ||||
.Ar device | .Ar device | ||||
.Nm | |||||
.Cm reset | |||||
.Op Fl d | |||||
.Ar device | |||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Nm | .Nm | ||||
utility adjusts the state of individual devices in the kernel's | utility adjusts the state of individual devices in the kernel's | ||||
internal device hierarchy. | internal device hierarchy. | ||||
Each invocation of | Each invocation of | ||||
.Nm | .Nm | ||||
consists of a single command followed by command-specific arguments. | consists of a single command followed by command-specific arguments. | ||||
Show All 37 Lines | |||||
.It Cm enable Ar device | .It Cm enable Ar device | ||||
Enable a device. | Enable a device. | ||||
The device will probe and attach if a suitable device driver is found. | The device will probe and attach if a suitable device driver is found. | ||||
Note that this can re-enable a device disabled at boot time via a | Note that this can re-enable a device disabled at boot time via a | ||||
loader tunable. | loader tunable. | ||||
.It Cm suspend Ar device | .It Cm suspend Ar device | ||||
Suspend a device. | Suspend a device. | ||||
This may include placing the device in a reduced power state. | This may include placing the device in a reduced power state. | ||||
.It Cm resume Ar device | .It Cm resume Ar device | ||||
Done Inline ActionsArguably this belongs in a separate BUGS section. Actually, I did document this in devctl(3) in the BUGS section there. We could perhaps add an explicit BUGS section in devctl.8 that points the reader at the section in devctl.3 (or just duplicates the content.) Ah, you did add it to BUGS below, so I don't think you need the note here. jhb: Arguably this belongs in a separate BUGS section. Actually, I did document this in devctl(3)… | |||||
Resume a suspended device to a fully working state. | Resume a suspended device to a fully working state. | ||||
.It Xo Cm set driver | .It Xo Cm set driver | ||||
.Op Fl f | .Op Fl f | ||||
.Ar device driver | .Ar device driver | ||||
.Xc | .Xc | ||||
Force the device to use a device driver named | Force the device to use a device driver named | ||||
.Ar driver . | .Ar driver . | ||||
If the device is already attached to a device driver and the | If the device is already attached to a device driver and the | ||||
Show All 30 Lines | |||||
Delete the device from the device tree. | Delete the device from the device tree. | ||||
If the | If the | ||||
.Fl f | .Fl f | ||||
flag is specified, | flag is specified, | ||||
the device will be deleted even if it is physically present. | the device will be deleted even if it is physically present. | ||||
This command should be used with care as a device that is deleted but present | This command should be used with care as a device that is deleted but present | ||||
can no longer be used unless the parent bus device rediscovers the device via | can no longer be used unless the parent bus device rediscovers the device via | ||||
a rescan request. | a rescan request. | ||||
.It Xo Cm reset | |||||
.Op Fl d | |||||
.Ar device | |||||
.Xc | |||||
Reset the device, using bus-specific reset method. | |||||
Drivers for the devices being reset are suspended around the reset. | |||||
If the | |||||
.Fl d | |||||
option is specified, drivers are detached instead. | |||||
.Pp | |||||
Currently, resets are implemented for PCIe buses and PCI devices. | |||||
For PCIe bus, the link is disabled and then re-trained, causing all | |||||
children of the bus to reset. | |||||
Use | |||||
.Fl p | |||||
option of | |||||
.Xr devinfo 8 | |||||
tool to report parent bus for the device. | |||||
For PCI device, if Function-Level Reset is implemented by it, FLR is | |||||
tried first; if failed or not implemented, power reset is tried. | |||||
.Pp | |||||
If you have detached or suspended a child device explicitly and then | |||||
do a reset, the child device will end up attached. | |||||
.El | .El | ||||
.Sh BUGS | |||||
Currently there is no administrative flag to prevent re-attach or resume | |||||
Done Inline ActionsI would s/un-suspend/resume/g. jhb: I would s/un-suspend/resume/g. | |||||
of the manually detached or suspended devices after reset. | |||||
Similarly, there is no flag to prevent un-suspending of the the manually | |||||
suspended devices after system resume. | |||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr devctl 3 , | .Xr devctl 3 , | ||||
.Xr devinfo 8 | .Xr devinfo 8 | ||||
.Sh HISTORY | .Sh HISTORY | ||||
The | The | ||||
.Nm | .Nm | ||||
utility first appeared in | utility first appeared in | ||||
.Fx 10.3 . | .Fx 10.3 . |
date here