From: Stephen Rothwell Date: Mon, 5 Aug 2013 02:08:00 +0000 (+1000) Subject: Merge remote-tracking branch 'virtio/virtio-next' X-Git-Tag: next-20130805~56 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=835c96a05b584ebeb66c6676393c86bdb4ae4ced;p=karo-tx-linux.git Merge remote-tracking branch 'virtio/virtio-next' --- 835c96a05b584ebeb66c6676393c86bdb4ae4ced diff --cc drivers/char/virtio_console.c index fc45567ad3ac,5b60956edc28..d0e75aa904ac --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@@ -1554,16 -1542,16 +1558,18 @@@ static void unplug_port(struct port *po list_del(&port->list); spin_unlock_irq(&port->portdev->ports_lock); + spin_lock_irq(&port->inbuf_lock); if (port->guest_connected) { + /* Let the app know the port is going down. */ + send_sigio_to_port(port); + + /* Do this after sigio is actually sent */ port->guest_connected = false; port->host_connected = false; - wake_up_interruptible(&port->waitqueue); - /* Let the app know the port is going down. */ - send_sigio_to_port(port); + wake_up_interruptible(&port->waitqueue); } + spin_unlock_irq(&port->inbuf_lock); if (is_console_port(port)) { spin_lock_irq(&pdrvdata_lock);