From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amit Shah Subject: [PATCH 04/10] virtio: console: Don't call hvc_remove() on unplugging console ports Date: Mon, 5 Apr 2010 19:24:08 +0530 Message-ID: <1270475654-399-5-git-send-email-amit.shah@redhat.com> References: <1270475654-399-1-git-send-email-amit.shah@redhat.com> <1270475654-399-2-git-send-email-amit.shah@redhat.com> <1270475654-399-3-git-send-email-amit.shah@redhat.com> <1270475654-399-4-git-send-email-amit.shah@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1270475654-399-4-git-send-email-amit.shah@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Virtualization List Cc: Amit Shah , "Michael S. Tsirkin" List-Id: virtualization@lists.linuxfoundation.org hvc_remove() has some bug which freezes other active hvc ports when one port is removed. So disable calling of hvc_remove() which deregisters a port with the hvc_console. If the hvc_console code calls into our get_chars() routine as a result of a poll operation, we will return -EPIPE and the hvc_console code will then do the necessary cleanup. This call will be restored when the bug in hvc_remove() is found and fixed. Signed-off-by: Amit Shah --- drivers/char/virtio_console.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 733276d..b40b112 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -876,7 +876,18 @@ static int remove_port(struct port *port) spin_lock_irq(&pdrvdata_lock); list_del(&port->cons.list); spin_unlock_irq(&pdrvdata_lock); +#if 0 + /* + * hvc_remove() not called as removing one hvc port + * results in other hvc ports getting frozen. + * + * Once this is resolved in hvc, this functionality + * will be enabled. Till that is done, the -EPIPE + * return from get_chars() above will help + * hvc_console.c to clean up on ports we remove here. + */ hvc_remove(port->cons.hvc); +#endif } if (port->guest_connected) send_control_msg(port, VIRTIO_CONSOLE_PORT_OPEN, 0); -- 1.6.2.5