net/virtio: wait device ready during reset
authorXueming Li <xuemingl@nvidia.com>
Wed, 15 Sep 2021 10:12:04 +0000 (18:12 +0800)
committerMaxime Coquelin <maxime.coquelin@redhat.com>
Tue, 28 Sep 2021 15:26:50 +0000 (17:26 +0200)
commitf5d4c819376b9a59e0f272e366fef0cd1fe9e4f2
tree1b8d5fe4ff8906a6c6afa321ee733f8565cccff6
parent9de76dfb929807f6fbf0b7ceec4bc8274221ddde
net/virtio: wait device ready during reset

According to virtio spec, the device MUST reset when 0 is written to
device_status, and present 0 in device_status once reset is done.

This patch waits status value to be 0 during reset operation, if
timeout in 3 seconds, log and continue.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
drivers/net/virtio/virtio.c