mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-29 23:24:11 +08:00
virtio: document virtio_reset_device
Looks like most callers get driver/device removal wrong. Document what's expected of callers. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
4fa59ede95
commit
c46eccdaad
@ -202,6 +202,22 @@ static int virtio_features_ok(struct virtio_device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* virtio_reset_device - quiesce device for removal
|
||||
* @dev: the device to reset
|
||||
*
|
||||
* Prevents device from sending interrupts and accessing memory.
|
||||
*
|
||||
* Generally used for cleanup during driver / device removal.
|
||||
*
|
||||
* Once this has been invoked, caller must ensure that
|
||||
* virtqueue_notify / virtqueue_kick are not in progress.
|
||||
*
|
||||
* Note: this guarantees that vq callbacks are not in progress, however caller
|
||||
* is responsible for preventing access from other contexts, such as a system
|
||||
* call/workqueue/bh. Invoking virtio_break_device then flushing any such
|
||||
* contexts is one way to handle that.
|
||||
* */
|
||||
void virtio_reset_device(struct virtio_device *dev)
|
||||
{
|
||||
dev->config->reset(dev);
|
||||
|
Loading…
Reference in New Issue
Block a user