Skip to content

virtio: console: Hot-unplug fixes

Amit Shah virtualization 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14virtio: console: Reset vdev before removing devicedrivers/char/virtio_console.c+3 -00 replies
2/14virtio: console: Remove control vq data only if using multiport supportdrivers/char/virtio_console.c+9 -62 replies
3/14virtio: console: Check if portdev is valid in send_control_msg()drivers/char/virtio_console.c+4 -10 replies
4/14virtio: console: Un-block reads on chardev closedrivers/char/virtio_console.c+4 -00 replies
5/14virtio: console: Unblock poll on port hot-unplugdrivers/char/virtio_console.c+4 -00 replies
6/14virtio: console: Make read() return -ENODEV on hot-unplugdrivers/char/virtio_console.c+3 -00 replies
7/14virtio: console: Make write() return -ENODEV on hot-unplugdrivers/char/virtio_console.c+3 -00 replies
8/14virtio: console: remove_port() should return voiddrivers/char/virtio_console.c+1 -20 replies
9/14virtio: console: open: Use a common path for error handlingdrivers/char/virtio_console.c+9 -30 replies
10/14virtio: console: Add a list of portdevs that are activedrivers/char/virtio_console.c+15 -00 replies
11/14virtio: console: Add a find_port_by_devt() functiondrivers/char/virtio_console.c+36 -10 replies
12/14virtio: console: Use cdev_alloc() instead of cdev_init()drivers/char/virtio_console.c+13 -70 replies
13/14virtio: console: Add reference counting for port structdrivers/char/virtio_console.c+64 -160 replies
14/14virtio: console: Reference counting portdev structs is not neededdrivers/char/virtio_console.c+8 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/14] virtio: console: Hot-unplug fixes

Hey Rusty,

These are the patches that rework a few bits to make hot-unplug while ports are open not crash apps (or kernels).

The problem is when hot-unplug is performed when a port is open, the cdev struct is kept around by the file pointers and when the app later does a 'close', things go boom-boom.

This patch series makes sure port as well as device hot-unplug is now safe to perform at any time: when ports are open, not open, hvc consoles are active, inactive, module removal, applications doing blocking read/write/poll calls while port / devices are going away...

Ideally this patchset 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: Use a common path for error handling
virtio: console: Add a list of portdevs that are active
virtio: console: Add a find_port_by_devt() function
virtio: console: Use cdev_alloc() instead of cdev_init()
virtio: console: Add reference counting for port struct
virtio: console: Reference counting portdev structs is not needed

 drivers/char/virtio_console.c |  206 ++++++++++++++++++++++++++++++++++-------
 1 files changed, 173 insertions(+), 33 deletions(-)
Signature · 1 line
1.7.2.2