diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2014-10-20 09:58:49 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-11-13 02:53:26 -0500 |
commit | 65eca3a20264a8999570c269406196bd1ae23be7 (patch) | |
tree | 4a858297ded216b231be941fab08bae31110136c /drivers/char/virtio_console.c | |
parent | 206c5f60a3d902bc4b56dab2de3e88de5eb06108 (diff) |
virtio_console: move early VQ enablement
Commit f5866db6 (virtio_console: enable VQs early) tried to make
sure that DRIVER_OK was set when virtio_console started using its
virtqueues. Doing this in add_port(), however, means that we try
to set DRIVER_OK again when when a port is dynamically added after
the probe function is done.
Let's move virtio_device_ready() to the probe function just before
trying to use the virtqueues instead. This is fine as nothing can
fail inbetween.
Reported-by: Thomas Graf <tgraf@suug.ch>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/char/virtio_console.c')
-rw-r--r-- | drivers/char/virtio_console.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index bfa640023e64..cf7a561fad7c 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -1449,8 +1449,6 @@ static int add_port(struct ports_device *portdev, u32 id) | |||
1449 | spin_lock_init(&port->outvq_lock); | 1449 | spin_lock_init(&port->outvq_lock); |
1450 | init_waitqueue_head(&port->waitqueue); | 1450 | init_waitqueue_head(&port->waitqueue); |
1451 | 1451 | ||
1452 | virtio_device_ready(portdev->vdev); | ||
1453 | |||
1454 | /* Fill the in_vq with buffers so the host can send us data. */ | 1452 | /* Fill the in_vq with buffers so the host can send us data. */ |
1455 | nr_added_bufs = fill_queue(port->in_vq, &port->inbuf_lock); | 1453 | nr_added_bufs = fill_queue(port->in_vq, &port->inbuf_lock); |
1456 | if (!nr_added_bufs) { | 1454 | if (!nr_added_bufs) { |
@@ -2026,6 +2024,8 @@ static int virtcons_probe(struct virtio_device *vdev) | |||
2026 | spin_lock_init(&portdev->ports_lock); | 2024 | spin_lock_init(&portdev->ports_lock); |
2027 | INIT_LIST_HEAD(&portdev->ports); | 2025 | INIT_LIST_HEAD(&portdev->ports); |
2028 | 2026 | ||
2027 | virtio_device_ready(portdev->vdev); | ||
2028 | |||
2029 | if (multiport) { | 2029 | if (multiport) { |
2030 | unsigned int nr_added_bufs; | 2030 | unsigned int nr_added_bufs; |
2031 | 2031 | ||