From: Amit Shah Date: Wed, 5 May 2010 20:35:07 +0000 (+0530) Subject: virtio: console: Resize console port 0 on config intr only if multiport is off X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=4038f5b767a610c5a5d92d7047755c663ead1568;p=deliverable%2Flinux.git virtio: console: Resize console port 0 on config intr only if multiport is off When using multiport, we'll use control messages. Ensure we don't accidentally update port 0 size on config interrupts. Signed-off-by: Amit Shah CC: Christian Borntraeger CC: linuxppc-dev@ozlabs.org CC: Kusanagi Kouichi Signed-off-by: Rusty Russell --- diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 4175a2ae972f..1e3f4674da4a 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1319,13 +1319,16 @@ static void config_intr(struct virtio_device *vdev) portdev = vdev->priv; - /* - * We'll use this way of resizing only for legacy support. - * For newer userspace (VIRTIO_CONSOLE_F_MULTPORT+), use - * control messages to indicate console size changes so that - * it can be done per-port - */ - resize_console(find_port_by_id(portdev, 0)); + if (!use_multiport(portdev)) { + /* + * We'll use this way of resizing only for legacy + * support. For newer userspace + * (VIRTIO_CONSOLE_F_MULTPORT+), use control messages + * to indicate console size changes so that it can be + * done per-port. + */ + resize_console(find_port_by_id(portdev, 0)); + } } static int init_vqs(struct ports_device *portdev)