From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by ozlabs.org (Postfix) with ESMTP id A392EB7D2F for ; Thu, 6 May 2010 06:38:04 +1000 (EST) From: Amit Shah To: Rusty Russell Subject: [PATCH 1/3] virtio: console: Resize console port 0 on config intr only if multiport is off Date: Thu, 6 May 2010 02:05:07 +0530 Message-Id: <1273091709-19963-2-git-send-email-amit.shah@redhat.com> In-Reply-To: <1273091709-19963-1-git-send-email-amit.shah@redhat.com> References: <1273091709-19963-1-git-send-email-amit.shah@redhat.com> Cc: Amit Shah , Christian Borntraeger , Kusanagi Kouichi , linuxppc-dev@ozlabs.org, Virtualization List List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 --- drivers/char/virtio_console.c | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index a64558f..e2d05ea 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) -- 1.6.2.5