search for: send_control_msg

Displaying 20 results from an estimated 54 matches for "send_control_msg".

Did you mean: __send_control_msg
2012 Apr 25
1
[PATCH 1/1] virtio: console: tell host of open ports after resume from s3/s4
...t a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index ddf86b6..cdf2f54 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1895,6 +1895,13 @@ static int virtcons_restore(struct virtio_device *vdev) /* Get port open/close status on the host */ send_control_msg(port, VIRTIO_CONSOLE_PORT_READY, 1); + + /* + * If a port was open at the time of suspending, we + * have to let the host know that it's still open. + */ + if (port->guest_connected) + send_control_msg(port, VIRTIO_CONSOLE_PORT_OPEN, 1); } return 0; } -- 1.7.7.6
2012 Apr 25
1
[PATCH 1/1] virtio: console: tell host of open ports after resume from s3/s4
...t a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index ddf86b6..cdf2f54 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1895,6 +1895,13 @@ static int virtcons_restore(struct virtio_device *vdev) /* Get port open/close status on the host */ send_control_msg(port, VIRTIO_CONSOLE_PORT_READY, 1); + + /* + * If a port was open at the time of suspending, we + * have to let the host know that it's still open. + */ + if (port->guest_connected) + send_control_msg(port, VIRTIO_CONSOLE_PORT_OPEN, 1); } return 0; } -- 1.7.7.6
2010 Apr 05
2
[PATCH 00/10] (v5) virtio: console: Fixes, new way of discovering ports
...ps for the removed ports. Looks like we don't lose much by removing hvc_remove(). New in this version: - Complete support for non-blocking write() - Don't call hvc_remove() - Return -EPIPE for hvc operations if a console port was hot-unplugged. Amit Shah (10): virtio: console: Add a __send_control_msg() that can send messages without a valid port virtio: console: Let host know of port or device add failures virtio: console: Return -EPIPE to hvc_console if we lost the connection virtio: console: Don't call hvc_remove() on unplugging console ports virtio: console: Remove config...
2010 Apr 05
2
[PATCH 00/10] (v5) virtio: console: Fixes, new way of discovering ports
...ps for the removed ports. Looks like we don't lose much by removing hvc_remove(). New in this version: - Complete support for non-blocking write() - Don't call hvc_remove() - Return -EPIPE for hvc operations if a console port was hot-unplugged. Amit Shah (10): virtio: console: Add a __send_control_msg() that can send messages without a valid port virtio: console: Let host know of port or device add failures virtio: console: Return -EPIPE to hvc_console if we lost the connection virtio: console: Don't call hvc_remove() on unplugging console ports virtio: console: Remove config...
2010 Apr 08
3
[PATCH 00/11] (v6) virtio: console: Fixes, new way of discovering ports
..._used_buffers() now, letting us use spin_lock_irq() instead of spin_lock_irqsave() from non-irq contexts. - Remove extra line spotted by Rusty Rusty, please apply for -next if all is well. Amit Shah (11): Revert "virtio: disable multiport console support." virtio: console: Add a __send_control_msg() that can send messages without a valid port virtio: console: Let host know of port or device add failures virtio: console: Return -EPIPE to hvc_console if we lost the connection virtio: console: Don't call hvc_remove() on unplugging console ports virtio: console: Remove config...
2010 Apr 08
3
[PATCH 00/11] (v6) virtio: console: Fixes, new way of discovering ports
..._used_buffers() now, letting us use spin_lock_irq() instead of spin_lock_irqsave() from non-irq contexts. - Remove extra line spotted by Rusty Rusty, please apply for -next if all is well. Amit Shah (11): Revert "virtio: disable multiport console support." virtio: console: Add a __send_control_msg() that can send messages without a valid port virtio: console: Let host know of port or device add failures virtio: console: Return -EPIPE to hvc_console if we lost the connection virtio: console: Don't call hvc_remove() on unplugging console ports virtio: console: Remove config...
2010 Mar 23
0
[PATCH 09/11] virtio: console: Don't always create a port 0 if using multiport
...port_console(struct port *port) spin_unlock_irq(&pdrvdata_lock); port->guest_connected = true; + /* + * Start using the new console output if this is the first + * console to come up. + */ + if (early_put_chars) + early_put_chars = NULL; + /* Notify host of port being opened */ send_control_msg(port, VIRTIO_CONSOLE_PORT_OPEN, 1); @@ -1056,14 +1063,8 @@ static void handle_control_message(struct ports_device *portdev, switch (cpkt->event) { case VIRTIO_CONSOLE_PORT_ADD: if (port) { - /* - * This can happen for port 0: we have to - * create a console port during probe() a...
2010 Mar 23
0
[PATCH 09/11] virtio: console: Don't always create a port 0 if using multiport
...port_console(struct port *port) spin_unlock_irq(&pdrvdata_lock); port->guest_connected = true; + /* + * Start using the new console output if this is the first + * console to come up. + */ + if (early_put_chars) + early_put_chars = NULL; + /* Notify host of port being opened */ send_control_msg(port, VIRTIO_CONSOLE_PORT_OPEN, 1); @@ -1056,14 +1063,8 @@ static void handle_control_message(struct ports_device *portdev, switch (cpkt->event) { case VIRTIO_CONSOLE_PORT_ADD: if (port) { - /* - * This can happen for port 0: we have to - * create a console port during probe() a...
2010 May 27
3
[PATCH 1/2] virtio: console: Fix crash when hot-unplugging a port and read is blocked
...ole.c +++ b/drivers/char/virtio_console.c @@ -1099,6 +1099,13 @@ static int remove_port(struct port *port) { struct port_buffer *buf; + if (port->guest_connected) { + port->guest_connected = false; + port->host_connected = false; + wake_up_interruptible(&port->waitqueue); + send_control_msg(port, VIRTIO_CONSOLE_PORT_OPEN, 0); + } + spin_lock_irq(&port->portdev->ports_lock); list_del(&port->list); spin_unlock_irq(&port->portdev->ports_lock); @@ -1120,9 +1127,6 @@ static int remove_port(struct port *port) hvc_remove(port->cons.hvc); #endif } - i...
2010 May 27
3
[PATCH 1/2] virtio: console: Fix crash when hot-unplugging a port and read is blocked
...ole.c +++ b/drivers/char/virtio_console.c @@ -1099,6 +1099,13 @@ static int remove_port(struct port *port) { struct port_buffer *buf; + if (port->guest_connected) { + port->guest_connected = false; + port->host_connected = false; + wake_up_interruptible(&port->waitqueue); + send_control_msg(port, VIRTIO_CONSOLE_PORT_OPEN, 0); + } + spin_lock_irq(&port->portdev->ports_lock); list_del(&port->list); spin_unlock_irq(&port->portdev->ports_lock); @@ -1120,9 +1127,6 @@ static int remove_port(struct port *port) hvc_remove(port->cons.hvc); #endif } - i...
2010 Sep 02
14
[PATCH 00/14] virtio: console: Hot-unplug fixes
...et would be applicable for 2.6.36 as well as 2.6.35, but I'll let you decide as it's quite big. Amit Shah (14): virtio: console: Reset vdev before removing device virtio: console: Remove control vq data only if using multiport support virtio: console: Check if portdev is valid in send_control_msg() virtio: console: Unblock reads on chardev close virtio: console: Unblock poll on port hot-unplug virtio: console: Make read() return -ENODEV on hot-unplug virtio: console: Make write() return -ENODEV on hot-unplug virtio: console: remove_port() should return void virtio: console: open...
2010 Sep 02
14
[PATCH 00/14] virtio: console: Hot-unplug fixes
...et would be applicable for 2.6.36 as well as 2.6.35, but I'll let you decide as it's quite big. Amit Shah (14): virtio: console: Reset vdev before removing device virtio: console: Remove control vq data only if using multiport support virtio: console: Check if portdev is valid in send_control_msg() virtio: console: Unblock reads on chardev close virtio: console: Unblock poll on port hot-unplug virtio: console: Make read() return -ENODEV on hot-unplug virtio: console: Make write() return -ENODEV on hot-unplug virtio: console: remove_port() should return void virtio: console: open...
2010 Mar 30
3
[PATCH 4/4] virtio: disable multiport console support.
..._chars is called from - * early_init - */ - if (!portdev->vdev) - return 0; - return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT); + return false; } static void free_buf(struct port_buffer *buf) @@ -373,31 +368,8 @@ out: return ret; } -static ssize_t send_control_msg(struct port *port, unsigned int event, - unsigned int value) -{ - struct scatterlist sg[1]; - struct virtio_console_control cpkt; - struct virtqueue *vq; - unsigned int len; - - if (!use_multiport(port->portdev)) - return 0; - - cpkt.id = port->id; - cpkt.event = event; - cpkt.value = val...
2010 Mar 30
3
[PATCH 4/4] virtio: disable multiport console support.
..._chars is called from - * early_init - */ - if (!portdev->vdev) - return 0; - return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT); + return false; } static void free_buf(struct port_buffer *buf) @@ -373,31 +368,8 @@ out: return ret; } -static ssize_t send_control_msg(struct port *port, unsigned int event, - unsigned int value) -{ - struct scatterlist sg[1]; - struct virtio_console_control cpkt; - struct virtqueue *vq; - unsigned int len; - - if (!use_multiport(port->portdev)) - return 0; - - cpkt.id = port->id; - cpkt.event = event; - cpkt.value = val...
2010 Feb 23
2
virtio: console: Barrier needed before dropping early_put_chars?
Hey Rusty, Christian, Christoph Hellwig asked why we don't need a barrier before this code in virtcons_probe(): > + /* Start using the new console output. */ > + early_put_chars = NULL; > return 0; Since only s390 uses early_put_chars so far, you'd know why it's not needed / why we're safe. Thanks, Amit
2010 Mar 08
3
[PATCH 0/2] virtio: console: Trivial fixes based on review comments
Hello, Here are a couple of small fixes for the virtio_console code, it's mostly stylistic fixes. Michael, can you push these to Linus? Thanks. Amit Shah (2): virtio: console: Fix type of 'len' as unsigned int virtio: console: Use better variable names for fill_queue operation drivers/char/virtio_console.c | 29 ++++++++++++++++------------- 1 files changed, 16
2010 Apr 14
1
[PULL] virtio console fixes, abi change
...e.c b/drivers/char/virtio_console.c index b06a0e5..a64558f 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1083,6 +1083,8 @@ free_cdev: free_port: kfree(port); fail: + /* The host might want to notify management sw about port add failure */ + send_control_msg(port, VIRTIO_CONSOLE_PORT_READY, 0); return err; } @@ -1407,17 +1513,14 @@ static int __devinit virtcons_probe(struct virtio_device *vdev) err = -ENOMEM; goto free_vqs; } + } else { + /* + *...
2010 Feb 23
2
virtio: console: Barrier needed before dropping early_put_chars?
Hey Rusty, Christian, Christoph Hellwig asked why we don't need a barrier before this code in virtcons_probe(): > + /* Start using the new console output. */ > + early_put_chars = NULL; > return 0; Since only s390 uses early_put_chars so far, you'd know why it's not needed / why we're safe. Thanks, Amit
2010 Mar 08
3
[PATCH 0/2] virtio: console: Trivial fixes based on review comments
Hello, Here are a couple of small fixes for the virtio_console code, it's mostly stylistic fixes. Michael, can you push these to Linus? Thanks. Amit Shah (2): virtio: console: Fix type of 'len' as unsigned int virtio: console: Use better variable names for fill_queue operation drivers/char/virtio_console.c | 29 ++++++++++++++++------------- 1 files changed, 16
2010 Apr 14
1
[PULL] virtio console fixes, abi change
...e.c b/drivers/char/virtio_console.c index b06a0e5..a64558f 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1083,6 +1083,8 @@ free_cdev: free_port: kfree(port); fail: + /* The host might want to notify management sw about port add failure */ + send_control_msg(port, VIRTIO_CONSOLE_PORT_READY, 0); return err; } @@ -1407,17 +1513,14 @@ static int __devinit virtcons_probe(struct virtio_device *vdev) err = -ENOMEM; goto free_vqs; } + } else { + /* + *...